commit 036cdcb228ffbc1cc8d22328bd6cd8d3f0eb8071 Author: TAO Cheng Date: Thu May 9 20:29:54 2013 +0800 Machine Interface Utility:VER1.0 diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..574b82c --- /dev/null +++ b/.hgignore @@ -0,0 +1,19 @@ +syntax: glob +*.~h +*.~CPP +*.sdf +*.dll +*.aps +*.pch +*.ilk +*.pdb +*.exe +*.obj +*.jpg +*.~* +*.orig +PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Win32/Release +PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Win32/Debug +PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Debug +PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Release +PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.cpp new file mode 100644 index 0000000..ac61bf3 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.cpp @@ -0,0 +1,2355 @@ + + +#include "stdafx.h" +#include "Animatics_Proto.h" +#include "math.h" + + +#define MAX_IN_BUFF_SIZE 1024 + +//***** Static Data ***** +static char *outBuff = NULL; +//================================================================ +HANDLE g_machine_event=NULL; + +//================================================================ +int SmartMotor_Proto::g_machine_Thread_State=THREAD_PAUSED; +HANDLE SmartMotor_Proto::g_machine_Thread_Id=NULL; +HANDLE SmartMotor_Proto::g_machine_Serial_Mutex; + +//================================================================ +struct_smartmotor_machine SmartMotor_Proto::g_machine; +CLogger *SmartMotor_Proto::g_pLogger; +HANDLE SmartMotor_Proto::g_hHomedEvent = NULL; + + +//=========================================================================== +// Worker Thread to send command to and receive data from smart motor. +//=========================================================================== +unsigned __stdcall SmartMotor_Proto::g_machine_Thread(LPVOID pThis) +{ + SmartMotor_Proto* _This = (SmartMotor_Proto*)pThis; + for (;;) + { + TRACE0("g_machine_Thread in loop set.\n"); + if (g_machine_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(g_machine_event,INFINITE); + TRACE0("g_machine_Thread obtained event.\n"); + switch (g_machine_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING_STATE: + { + _This->smartmotor_motion_get_motion_status(); + break; + } + default: + ExitThread(0); + } + }; + g_machine_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + + +//****************************************************************************** +SmartMotor_Proto::SmartMotor_Proto() +{ + g_machine.x.address=1; + g_machine.y.address=2; + g_machine.z.address=3; + + g_machine.x._Move_Speed_Gear=1; + g_machine.x._l_move_dis=0; + g_machine.x._d_move_dis=0; + g_machine.x._l_cur_pos=0; + g_machine.x._d_cur_pos=0; + g_machine.x._dSet_Zero_Pos=0; + g_machine.x._lSet_Zero_Pos=0; + g_machine.x.s_machine_status.StatusWord[0]=0; + g_machine.x.s_machine_status.StatusWord[1]=0; + g_machine.x.s_machine_status.DriverRdy=FALSE; + g_machine.x.s_machine_status.MotorOff=FALSE; + g_machine.x.s_machine_status.VoltageFault=FALSE; + g_machine.x.s_machine_status.PosErr=FALSE; + g_machine.x.s_machine_status.OverHeat=FALSE; + g_machine.x.s_machine_status.NegLimit=FALSE; + g_machine.x.s_machine_status.PosLimit=FALSE; + + g_machine.y._Move_Speed_Gear=1; + g_machine.y._l_move_dis=0; + g_machine.y._d_move_dis=0; + g_machine.y._l_cur_pos=0; + g_machine.y._d_cur_pos=0; + g_machine.y._dSet_Zero_Pos=0; + g_machine.y._lSet_Zero_Pos=0; + g_machine.y.s_machine_status.StatusWord[0]=0; + g_machine.y.s_machine_status.StatusWord[1]=0; + g_machine.y.s_machine_status.DriverRdy=FALSE; + g_machine.y.s_machine_status.MotorOff=FALSE; + g_machine.y.s_machine_status.VoltageFault=FALSE; + g_machine.y.s_machine_status.PosErr=FALSE; + g_machine.y.s_machine_status.OverHeat=FALSE; + g_machine.y.s_machine_status.NegLimit=FALSE; + g_machine.y.s_machine_status.PosLimit=FALSE; + + g_machine.z._Move_Speed_Gear=1; + g_machine.z._l_move_dis=0; + g_machine.z._d_move_dis=0; + g_machine.z._l_cur_pos=0; + g_machine.z._d_cur_pos=0; + g_machine.z._dSet_Zero_Pos=0; + g_machine.z._lSet_Zero_Pos=0; + g_machine.z.s_machine_status.StatusWord[0]=0; + g_machine.z.s_machine_status.StatusWord[1]=0; + g_machine.z.s_machine_status.DriverRdy=FALSE; + g_machine.z.s_machine_status.MotorOff=FALSE; + g_machine.z.s_machine_status.VoltageFault=FALSE; + g_machine.z.s_machine_status.PosErr=FALSE; + g_machine.z.s_machine_status.OverHeat=FALSE; + g_machine.z.s_machine_status.NegLimit=FALSE; + g_machine.z.s_machine_status.PosLimit=FALSE; + + g_machine.s_status._bXHomed=FALSE; + g_machine.s_status._bYHomed=FALSE; + g_machine.s_status._bZHomed=FALSE; + g_machine.s_status._bXYZHomed=FALSE; + g_machine.s_status._machine_running=FALSE; + g_machine.s_status._bXMoving=FALSE; + g_machine.s_status._bYMoving=FALSE; + g_machine.s_status._bZMoving=FALSE; + g_machine.s_status._bXYZMoving=FALSE; + + _reset_config_parameter(); + m_bHomingActive=false; + + g_pLogger = new CLogger(_T("\\UtilityDebug.Log")); +}; + +//****************************************************************************** +SmartMotor_Proto::~SmartMotor_Proto() +{ + if (g_pLogger) + { + g_pLogger->Send(_T("Destruct Csmartmotor_Proto.\r\n")); + delete g_pLogger; + g_pLogger = NULL; + } +} + + +//=========================================================================== +double SmartMotor_Proto::ScaleToMM(long lCount, double dResolution) +{ + double dMM = 0.0; + dMM = (lCount* dResolution) /1000 ; + return dMM; +} + +//=========================================================================== +long SmartMotor_Proto::MMtoScale(double lDistanceMM, double dResolution) +{ + long lCounts(0); + if (dResolution) + lCounts = static_cast (lDistanceMM *1000 / dResolution); + else + ASSERT(0); + return lCounts; +} + +//===================================================================================== +long SmartMotor_Proto::_4char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[3]; + c_array[1] = cBuff[2]; + c_array[2] = cBuff[1]; + c_array[3] = cBuff[0]; + return(l_value); +} + +//===================================================================================== +long SmartMotor_Proto::_3char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[2]; + c_array[1] = cBuff[1]; + c_array[2] = cBuff[0]; + return(l_value); +} +//======================================================================== +void SmartMotor_Proto::_reverse_dword(DWORD *dWord) +{ + BYTE cBuff[4]; + BYTE *dwBuff = (BYTE *)dWord; + for ( int ii = 0 ; ii < 4 ; ++ii ) + cBuff[ii]= dwBuff[ii]; + + dwBuff[0] = cBuff[3]; + dwBuff[1] = cBuff[2]; + dwBuff[2] = cBuff[1]; + dwBuff[3] = cBuff[0]; +} + +//****************************************************************************** +void SmartMotor_Proto::_scale2inch(unsigned long scale, double &inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +void SmartMotor_Proto::_inch2scale(unsigned long &scale, double inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +// convert a string of characters into its binary form +void SmartMotor_Proto::_char2bin(unsigned char *cBuff, BYTE *cBytes, int iLen) +{ + memset(cBytes, 0, MAX_BUFF_SIZE); + for (int i=0;i>8; + Val = MSB|LSB; +} + +//****************************************************************************** +double SmartMotor_Proto::TimeInSecs(void) +{ + double Secs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPersec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Secs = ((double)HPTicks.QuadPart / HPCounterTicksPersec); + } + else + { + // Use clock with less resolution. + Secs = GetTickCount(); + Secs /= 1000.0; + } + return Secs; +} + + +#pragma warning(disable:4996) +//============================================================================== +//****************************************************************************** + +void SmartMotor_Proto::_reset_config_parameter() +{ + for(INT i=0;i<5;i++) + { + g_machine.s_machine_config.x_axis._speed_[i]=0; + g_machine.s_machine_config.x_axis._accel_[i]=0; + g_machine.s_machine_config.x_axis._decel_[i]=0; + + g_machine.s_machine_config.y_axis._speed_[i]=0; + g_machine.s_machine_config.y_axis._accel_[i]=0; + g_machine.s_machine_config.y_axis._decel_[i]=0; + + g_machine.s_machine_config.z_axis._speed_[i]=0; + g_machine.s_machine_config.z_axis._accel_[i]=0; + g_machine.s_machine_config.z_axis._decel_[i]=0; + } + g_machine.s_machine_config.x_axis._neg_working_limit=0; + g_machine.s_machine_config.x_axis._pos_working_limit=200; + g_machine.s_machine_config.x_axis._scale_resolution=0.4; + + g_machine.s_machine_config.y_axis._neg_working_limit=0; + g_machine.s_machine_config.y_axis._pos_working_limit=200; + g_machine.s_machine_config.y_axis._scale_resolution=0.4; + + g_machine.s_machine_config.z_axis._neg_working_limit=0; + g_machine.s_machine_config.z_axis._pos_working_limit=200; + g_machine.s_machine_config.z_axis._scale_resolution=0.4; + + +} +//========================================================================================= +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::SaveSmartMotorConfig() +{ + FILE* m_pOutFile; + char *outBuff = NULL; + // char tmp; + CString csAppPath; + GetAppPath(csAppPath); + CString csSO7ConfigFile =csAppPath+_T("\\smartmotor_config.ini"); + _wfopen_s(&m_pOutFile, csSO7ConfigFile, _T("wt")); + if (!m_pOutFile) + { + free(outBuff); + }; + outBuff="[HARDWARE]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + //=================================X================================== + outBuff="SPEED_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._accel_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._decel_[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._accel_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._decel_[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._accel_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._decel_[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._accel_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._decel_[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._accel_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._decel_[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + //=================================Y================================== + outBuff="SPEED_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._accel_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._decel_[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._accel_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._decel_[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._accel_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._decel_[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._accel_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._decel_[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._accel_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._decel_[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + //=================================Z================================== + outBuff="SPEED_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._speed_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._accel_[0]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._decel_[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._speed_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._accel_[1]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._decel_[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._speed_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._accel_[2]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._decel_[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._speed_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._accel_[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._decel_[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._speed_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="ACCELERATION_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._accel_[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="DECELERATION_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.z_axis._decel_[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + //===========worktable===================== + + outBuff="[WORKTABLE]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + outBuff="X_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + + + fclose(m_pOutFile); + return SSI_STATUS_SMARTMOTOR_NORMAL; +} +//****************************************************************************** +//log file shows the machine speed data +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::LoadSmartMotorConfig() +{ + FILE *hConfigFile = NULL; + char szLine[MAX_BUFF_SIZE]; + char *token = NULL; + char seps[] = " =,\t\n"; + char cTemp[20]={0}; + CString csAppPath; + GetAppPath(csAppPath); + CString csSO7ConfigFile =csAppPath+_T("\\smartmotor_config.ini");//iniFile + _wfopen_s(&hConfigFile,csSO7ConfigFile,_T("rt")); + if(hConfigFile) + { + while (!feof(hConfigFile)) + { + fgets(szLine,MAX_BUFF_SIZE,hConfigFile);//read a line + if((szLine[0]!=';')&&(strlen(szLine)>2)) + { + token = strtok(szLine,seps); + //============================X============================ + if(!_stricmp(token,"SPEED_X1"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_X1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._accel_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_X1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._decel_[0]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_X2"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_X2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._accel_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_X2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._decel_[1]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_X3"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_X3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._accel_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_X3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._decel_[2]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_X4"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_X4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._accel_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_X4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._decel_[3]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_X5"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_X5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._accel_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_X5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._decel_[4]=atoi(cTemp); + } + } + //===========================Y============================ + else if(!_stricmp(token,"SPEED_Y1"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Y1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._accel_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Y1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._decel_[0]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Y2"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Y2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._accel_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Y2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._decel_[1]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Y3"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Y3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._accel_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Y3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._decel_[2]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Y4"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Y4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._accel_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Y4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._decel_[3]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Y5"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Y5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._accel_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Y5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._decel_[4]=atoi(cTemp); + } + } + //===========================Z============================ + else if(!_stricmp(token,"SPEED_Z1"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Z1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._accel_[0]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Z1")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._decel_[0]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Z2"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Z2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._accel_[1]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Z2")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._decel_[1]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Z3"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Z3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._accel_[2]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Z3")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._decel_[2]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Z4"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Z4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._accel_[3]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Z4")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._decel_[3]=atoi(cTemp); + } + } + //-------------------------------------------- + else if(!_stricmp(token,"SPEED_Z5"))// + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"ACCELERATION_Z5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._accel_[4]=atoi(cTemp); + } + } + else if(!_stricmp(token,"DECELERATION_Z5")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._decel_[4]=atoi(cTemp); + } + } + //=====================[WORKTABLE]======================== + else if(!_stricmp(token, "X_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "X_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "X_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._pos_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._pos_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._pos_working_limit=atof(cTemp); + } + } + } + } + fclose(hConfigFile); + } + + return SSI_STATUS_SMARTMOTOR_NORMAL; +} + +//****************************************************************************** +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::GetAppPath(CString &Path) +{ + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) + { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//****************************************************************************** +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::ExtractAppPath(CString &Path) +{ + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) + { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } + else + { // not a complete path + Path=""; + }; + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//****************************************************************************** +//set up the thread +//****************************************************************************** +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::Create_thread() +{ + //Set initial state of the machine + g_machine.s_status._machine_running = false; + + + SSI_STATUS_SMARTMOTOR Status=SSI_STATUS_SMARTMOTOR_NORMAL; + UNREFERENCED_PARAMETER(Status); + + + + // ******************************************************************** + // + g_machine_event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_machine_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_machine_Thread, + (LPVOID) this, + 0, + NULL); + g_machine_Thread_State = THREAD_RUNNING_STATE; + + // ******************************************************************** + // Prepare and start EP_S07_81 Thread - Use async commit. + // + g_machine_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + // ********************************************************************* + g_hHomedEvent = CreateEvent(NULL, // default security attributes + TRUE, // manual reset event object + FALSE, // initial state is signaled + NULL); // unamed object + + + return SSI_STATUS_SMARTMOTOR_NORMAL; +} + +//****************************************************************************** +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::Exit_thread() +{ + SSI_STATUS_SMARTMOTOR Status=SSI_STATUS_SMARTMOTOR_NORMAL; + + g_machine_Thread_State = THREAD_EXIT; + + SetEvent(g_machine_event); + if (g_machine_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_machine_Thread_Id,&dwCode); + Sleep(1); + } + } + + SetEvent(g_machine_event); + CloseHandle(g_machine_event); + g_machine_Thread_State = THREAD_EXIT; + ReleaseMutex(g_machine_Serial_Mutex); + CloseHandle(g_machine_Serial_Mutex); + return Status; +} + + + +//****************************************************************************** +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_start_machine() +{ + Create_thread(); + InitSmartMotor(); + StartSmartMotor(); + LoadSmartMotorConfig(); + //smartmotor_motion_Dcc_Home(); + g_machine_Thread_State = THREAD_RUNNING_STATE; + g_machine.s_status._machine_running = true; + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; + +//=============================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_shutdown_machine() +{ + StopSmartMotor(); + Exit_thread(); + g_machine.s_status._machine_running = false; + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; + + +//**********************************************************************// +//**********************************************************************// +//========================================================================== +BOOL SmartMotor_Proto::InitSmartMotor() +{ + try + { + // Create SMIHost object and interfaces + HRESULT hr = CommInterface.CreateInstance(__uuidof(SMIHost)); + if(FAILED(hr)) + { + AfxMessageBox(_T("Cannot create an instance of \"SMIHost\" class!")); + return FALSE; + } + hr = CommInterface.QueryInterface(__uuidof(ISMICMotion),&CMotionInterface); + if(FAILED(hr)) + { + AfxMessageBox(_T("The interface \"ISMICMotion\" not found!")); + return FALSE; + } + hr = CommInterface.QueryInterface(__uuidof(ISMIPath),&PathInterface); + if(FAILED(hr)) + { + AfxMessageBox(_T("The interface \"ISMIPath\" not found!")); + return FALSE; + } + CString Str = _T("N/A"); + long Version = CommInterface->EngineVersion; + if(Version) + { + Str.Format(_T("IntegMotorInterface Version: %d.%d%d%d"), + HIBYTE(HIWORD(Version)), + LOBYTE(HIWORD(Version)), + HIBYTE(LOWORD(Version)), + LOBYTE(LOWORD(Version))); + } + return TRUE; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + return FALSE; + } +} +//========================================================================== +void SmartMotor_Proto::StartSmartMotor() +{ + try + { + CommInterface->BaudRate = 19200; + CommInterface->OpenPort(_bstr_t(_T("COM1"))); + CommInterface->InitRS485(3, 1); + CommInterface->DefaultMotor = 0; + CommInterface->WriteCommand(("RUN")); + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + } +} +//========================================================================== +void SmartMotor_Proto::StopSmartMotor() +{ + try + { + CommInterface->DefaultMotor = 0; + CommInterface->WriteCommand(_bstr_t("c=1")); + CommInterface->WriteCommand(("S")); + CommInterface->WriteCommand(("OFF")); + CommInterface->ClosePort(); + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + } +} +//======================================================================== +// Move the stage left/right until the index location is non-zero +//======================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_Dcc_Home() +{ + try + { + g_machine.s_status._bXYZHomed=FALSE; + g_machine.s_status._bXHomed=FALSE; + g_machine.s_status._bYHomed=FALSE; + g_machine.s_status._bZHomed=FALSE; + + CommInterface->DefaultMotor=0; + CommInterface->WriteCommand(_bstr_t("c=1")); + + m_bHomingActive=true; + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } + +} + +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_IS_Homed() +{ + try + { + if (g_machine.s_status._bXYZHomed && m_bHomingActive) + { + m_bHomingActive=false; + SetEvent(g_hHomedEvent); + } + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } + +} +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_startup(double dScaleResolutionX, double dScaleResolutionY, double dScaleResolutionZ) +{ + g_machine.s_machine_config.x_axis._scale_resolution = dScaleResolutionX; + g_machine.s_machine_config.y_axis._scale_resolution = dScaleResolutionY; + g_machine.s_machine_config.z_axis._scale_resolution = dScaleResolutionZ; + + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_get_position_xyz(double & dX, double & dY, double & dZ) +{ + //WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_GET_POS_XYZ(); + g_machine.x._d_cur_pos=ScaleToMM(g_machine.x._l_cur_pos,g_machine.s_machine_config.x_axis._scale_resolution); + g_machine.y._d_cur_pos=ScaleToMM(g_machine.y._l_cur_pos,g_machine.s_machine_config.y_axis._scale_resolution); + g_machine.z._d_cur_pos=ScaleToMM(g_machine.z._l_cur_pos,g_machine.s_machine_config.z_axis._scale_resolution); + + dX=g_machine.x._d_cur_pos; + dY=g_machine.y._d_cur_pos; + dZ=g_machine.z._d_cur_pos; + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_get_pos_pulse_xyz(long & lX, long & lY, long & lZ) +{ + //WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_GET_POS_XYZ(); + lX=g_machine.x._l_cur_pos; + lY=g_machine.y._l_cur_pos; + lZ=g_machine.z._l_cur_pos; + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_MOVETOX_ABS(dX); + _send_cmd_SMARTMOTOR_MOVETOY_ABS(dY); + _send_cmd_SMARTMOTOR_MOVETOZ_ABS(dZ); + +#pragma message("Test settle wait comparing the status bit to the scale monitor") + + if (bWait) + { + const long lSleep = 20; + const long lMaxLoopCnt = 10000/lSleep; // use max homing time of 20 seconds + long lLoopCnt = 0; + Sleep(lSleep); + + while (g_machine.s_status._bXYZMoving && lLoopCnt < lMaxLoopCnt) + { + Sleep(lSleep); + smartmotor_motion_get_motion_status(); + ++lLoopCnt; + } + + } + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; + +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_move_rel_dis_xyz(double dX, double dY, double dZ, bool bWait) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_MOVETOX_REL(dX); + _send_cmd_SMARTMOTOR_MOVETOY_REL(dY); + _send_cmd_SMARTMOTOR_MOVETOZ_REL(dZ); + + + if (bWait) + { + const long lSleep = 20; + const long lMaxLoopCnt = 10000/lSleep; // use max homing time of 20 seconds + long lLoopCnt = 0; + Sleep(lSleep); + + while (g_machine.s_status._bXYZMoving && lLoopCnt < lMaxLoopCnt) + { + Sleep(lSleep); + smartmotor_motion_get_motion_status(); + ++lLoopCnt; + } + + } + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_stop_xyz() +{ + //WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_DECEL_STOPX(); + _send_cmd_SMARTMOTOR_DECEL_STOPY(); + _send_cmd_SMARTMOTOR_DECEL_STOPZ(); + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_stop_xyz_S() +{ + //WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_ABRUPT_STOPX(); + _send_cmd_SMARTMOTOR_ABRUPT_STOPY(); + _send_cmd_SMARTMOTOR_ABRUPT_STOPZ(); + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_get_home_status() +{ + //WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + if(!g_machine.s_status._bXHomed) + _send_cmd_SMARTMOTOR_GET_HOME_STATUS_X(); + if(!g_machine.s_status._bYHomed) + _send_cmd_SMARTMOTOR_GET_HOME_STATUS_Y(); + if(!g_machine.s_status._bZHomed) + _send_cmd_SMARTMOTOR_GET_HOME_STATUS_Z(); + + g_machine.s_status._bXYZHomed=g_machine.s_status._bXHomed && g_machine.s_status._bYHomed && g_machine.s_status._bZHomed; + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; + +//================================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_get_motion_status() +{ + // WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_X(); + _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Y(); + _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Z(); + + g_machine.s_status._bXYZMoving=g_machine.s_status._bXMoving || g_machine.s_status._bYMoving || g_machine.s_status._bZMoving; + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::smartmotor_motion_get_status_word() +{ + // WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SMARTMOTOR_GET_STATUS_WORD0(); + _send_cmd_SMARTMOTOR_GET_STATUS_WORD16(); + + g_machine.x.s_machine_status.DriverRdy = g_machine.x.s_machine_status.StatusWord[0] & HBIT0; + g_machine.x.s_machine_status.MotorOff = g_machine.x.s_machine_status.StatusWord[0] & HBIT1; + g_machine.x.s_machine_status.VoltageFault = g_machine.x.s_machine_status.StatusWord[0] & HBIT3; + g_machine.x.s_machine_status.PosErr = g_machine.x.s_machine_status.StatusWord[0] & HBIT6; + g_machine.x.s_machine_status.OverHeat = g_machine.x.s_machine_status.StatusWord[0] & HBIT8; + g_machine.x.s_machine_status.NegLimit = g_machine.x.s_machine_status.StatusWord[1] & HBIT3; + g_machine.x.s_machine_status.PosLimit = g_machine.x.s_machine_status.StatusWord[1] & HBIT2; + + g_machine.y.s_machine_status.DriverRdy = g_machine.y.s_machine_status.StatusWord[0] & HBIT0; + g_machine.y.s_machine_status.MotorOff = g_machine.y.s_machine_status.StatusWord[0] & HBIT1; + g_machine.y.s_machine_status.VoltageFault = g_machine.y.s_machine_status.StatusWord[0] & HBIT3; + g_machine.y.s_machine_status.PosErr = g_machine.y.s_machine_status.StatusWord[0] & HBIT6; + g_machine.y.s_machine_status.OverHeat = g_machine.y.s_machine_status.StatusWord[0] & HBIT8; + g_machine.y.s_machine_status.NegLimit = g_machine.y.s_machine_status.StatusWord[1] & HBIT3; + g_machine.y.s_machine_status.PosLimit = g_machine.y.s_machine_status.StatusWord[1] & HBIT2; + + g_machine.z.s_machine_status.DriverRdy = g_machine.z.s_machine_status.StatusWord[0] & HBIT0; + g_machine.z.s_machine_status.MotorOff = g_machine.z.s_machine_status.StatusWord[0] & HBIT1; + g_machine.z.s_machine_status.VoltageFault = g_machine.z.s_machine_status.StatusWord[0] & HBIT3; + g_machine.z.s_machine_status.PosErr = g_machine.z.s_machine_status.StatusWord[0] & HBIT6; + g_machine.z.s_machine_status.OverHeat = g_machine.z.s_machine_status.StatusWord[0] & HBIT8; + g_machine.z.s_machine_status.NegLimit = g_machine.z.s_machine_status.StatusWord[1] & HBIT3; + g_machine.z.s_machine_status.PosLimit = g_machine.z.s_machine_status.StatusWord[1] & HBIT2; + + + return SSI_STATUS_SMARTMOTOR_NORMAL; +}; +////======================================================================== +//SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_calculate_straightline_motion(double dSpeedMM) +//{ +// +// return SSI_STATUS_SMARTMOTOR_NORMAL; +//} + +//**********************************************************************// + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_POS_XYZ() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + Sleep(10); + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(_bstr_t("RPA")); + g_machine.x._l_cur_pos=atoi(CommInterface->ReadResponse()); + Sleep(10); + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(_bstr_t("RPA")); + g_machine.y._l_cur_pos=atoi(CommInterface->ReadResponse()); + Sleep(10); + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(_bstr_t("RPA")); + g_machine.z._l_cur_pos=atoi(CommInterface->ReadResponse()); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOX_ABS(double dis) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("MP")); + g_machine.x._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.x_axis._scale_resolution); + csTmp.Format(_T("PT=%d"),g_machine.x._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.x_axis._speed_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.x_axis._accel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.x_axis._decel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOY_ABS(double dis) +{ try +{ + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("MP")); + g_machine.y._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.y_axis._scale_resolution); + csTmp.Format(_T("PT=%d"),g_machine.y._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.y_axis._speed_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.y_axis._accel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.y_axis._decel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; +} +catch(_com_error e) +{ + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; +} +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOZ_ABS(double dis) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("MP")); + g_machine.z._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.z_axis._scale_resolution); + csTmp.Format(_T("PT=%d"),g_machine.z._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.z_axis._speed_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.z_axis._accel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.z_axis._decel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOX_REL(double dis) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("MP")); + g_machine.x._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.x_axis._scale_resolution); + csTmp.Format(_T("PRT=%d"),g_machine.x._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.x_axis._speed_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.x_axis._accel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.x_axis._decel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOY_REL(double dis) +{ try +{ + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("MP")); + g_machine.y._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.y_axis._scale_resolution); + csTmp.Format(_T("PRT=%d"),g_machine.y._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.y_axis._speed_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.y_axis._accel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.y_axis._decel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; +} +catch(_com_error e) +{ + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; +} +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVETOZ_REL(double dis) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("MP")); + g_machine.z._l_move_dis=MMtoScale(dis,g_machine.s_machine_config.z_axis._scale_resolution); + csTmp.Format(_T("PRT=%d"),g_machine.z._l_move_dis); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.z_axis._speed_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.z_axis._accel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.z_axis._decel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVEX(BOOL dir) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("MV")); + if (dir) + { + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.x_axis._speed_[g_machine.x._Move_Speed_Gear]); + } + else + { + csTmp.Format(_T("VT=%d"),-g_machine.s_machine_config.x_axis._speed_[g_machine.x._Move_Speed_Gear]); + } + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.x_axis._accel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.x_axis._decel_[g_machine.x._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("XS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVEY(BOOL dir) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("MV")); + if (dir) + { + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.y_axis._speed_[g_machine.y._Move_Speed_Gear]); + } + else + { + csTmp.Format(_T("VT=%d"),-g_machine.s_machine_config.y_axis._speed_[g_machine.y._Move_Speed_Gear]); + } + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.y_axis._accel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.y_axis._decel_[g_machine.y._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("YS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_MOVEZ(BOOL dir) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CString csTmp; + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("MV")); + if (dir) + { + csTmp.Format(_T("VT=%d"),g_machine.s_machine_config.z_axis._speed_[g_machine.z._Move_Speed_Gear]); + } + else + { + csTmp.Format(_T("VT=%d"),-g_machine.s_machine_config.z_axis._speed_[g_machine.z._Move_Speed_Gear]); + } + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("AT=%d"),g_machine.s_machine_config.z_axis._accel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + csTmp.Format(_T("DT=%d"),g_machine.s_machine_config.z_axis._decel_[g_machine.z._Move_Speed_Gear]); + CommInterface->WriteCommand(_bstr_t(csTmp)); + CommInterface->WriteCommand(("ZS")); + CommInterface->WriteCommand(("G")); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_ABRUPT_STOPX() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("S")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_ABRUPT_STOPY() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("S")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_ABRUPT_STOPZ() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("S")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_DECEL_STOPX() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("X")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_DECEL_STOPY() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("X")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_DECEL_STOPZ() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("X")); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_COMM_CMDX(CString _command) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(_bstr_t(_command)); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_COMM_CMDY(CString _command) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(_bstr_t(_command)); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_COMM_CMDZ(CString _command) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(_bstr_t(_command)); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEX(CString &_response) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + _response=static_cast(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEY(CString &_response) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + _response=static_cast(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEZ(CString &_response) +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + _response=static_cast(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_HOME_STATUS_X() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(_bstr_t("Rhh")); + g_machine.s_status._bXHomed=(atoi)(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_HOME_STATUS_Y() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(_bstr_t("Rhh")); + g_machine.s_status._bYHomed=(atoi)(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_HOME_STATUS_Z() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(_bstr_t("Rhh")); + g_machine.s_status._bZHomed=(atoi)(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_MOVE_STATUS_X() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("RBt")); + g_machine.s_status._bXMoving=atoi(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Y() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("RBt")); + g_machine.s_status._bYMoving=atoi(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Z() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("RBt")); + g_machine.s_status._bZMoving=atoi(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; + + +//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_STATUS_WORD0() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("RW(0)")); + g_machine.x.s_machine_status.StatusWord[0]=atoi(CommInterface->ReadResponse()); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("RW(0)")); + g_machine.y.s_machine_status.StatusWord[0]=atoi(CommInterface->ReadResponse()); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("RW(0)")); + g_machine.z.s_machine_status.StatusWord[0]=atoi(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +};//============================================================== +SSI_STATUS_SMARTMOTOR SmartMotor_Proto::_send_cmd_SMARTMOTOR_GET_STATUS_WORD16() +{ + try + { + WaitForSingleObject(g_machine_Serial_Mutex, INFINITE); + + CommInterface->DefaultMotor=g_machine.x.address; + CommInterface->WriteCommand(("RW(16)")); + g_machine.x.s_machine_status.StatusWord[1]=atoi(CommInterface->ReadResponse()); + + CommInterface->DefaultMotor=g_machine.y.address; + CommInterface->WriteCommand(("RW(16)")); + g_machine.y.s_machine_status.StatusWord[1]=atoi(CommInterface->ReadResponse()); + + CommInterface->DefaultMotor=g_machine.z.address; + CommInterface->WriteCommand(("RW(16)")); + g_machine.z.s_machine_status.StatusWord[1]=atoi(CommInterface->ReadResponse()); + + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_NORMAL; + } + catch(_com_error e) + { + MessageBox(NULL,e.Description(),_T("IntegMotorInterface Error!"),MB_ICONWARNING); + ReleaseMutex(g_machine_Serial_Mutex); + return SSI_STATUS_SMARTMOTOR_COMMERR; + } +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.h b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.h new file mode 100644 index 0000000..dc30a32 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/Animatics_Proto.h @@ -0,0 +1,249 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef AFX_ANIMATICS_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + #define AFX_ANIMATICS_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#if _MSC_VER > 1000 + #pragma once +#endif // _MSC_VER > 1000 + +#include "..\Tools\UsbUtility\logger.h" +#include "..\MicroVu\SsiStatus.h" +#include "SMIDefs.h" +//#include "IntegMotorInterface.h" + + +#import "IntegMotorInterface.tlb" +using namespace INTEGMOTORINTERFACELib; + +#define MAX_BUFF_SIZE 0x200 + +#define THREAD_RUNNING_STATE 0 +#define THREAD_PAUSED 1 +#define THREAD_EXIT -1 +#define HBIT0 0X0001 +#define HBIT1 0X0002 +#define HBIT2 0X0004 +#define HBIT3 0X0008 +#define HBIT4 0X0010 +#define HBIT5 0X0020 +#define HBIT6 0X0040 +#define HBIT7 0X0080 +#define HBIT8 0X0100 +#define HBIT9 0X0200 +#define HBIT10 0X0400 +#define HBIT11 0X0800 +#define HBIT12 0X1000 +#define HBIT13 0X2000 +#define HBIT14 0X4000 +#define HBIT15 0X8000 + + +#pragma pack(push) +#pragma pack(1) +//==================================================================================================== +typedef struct s_smartmotor_axis // axis parameters +{ + char _Move_Speed_Gear; + long _l_move_dis; + double _d_move_dis; + long _l_cur_pos; + double _d_cur_pos; + double _dSet_Zero_Pos; + long _lSet_Zero_Pos; + long address; + struct s_machine_status + { + int StatusWord[2]; + + BOOL DriverRdy; + BOOL MotorOff; + BOOL VoltageFault; + BOOL PosErr; + BOOL OverHeat; + BOOL NegLimit; + BOOL PosLimit; + + + } s_machine_status; + +} SMARTMOTORAXIS; +//==================================================================================================== +struct s_smartmotor_axis_config // axis configuration +{ + double _motor_precision;//set precision + + int _speed_[5]; + int _accel_[5]; + int _decel_[5]; + + double _neg_working_limit; + double _pos_working_limit; + + double _scale_resolution; +}; +//==================================================================================================== +typedef struct s_smartmotor_xyzzm +{ + bool bFast; + long from; + long to; + long speed; + long acc; + long dec; + double dFromMM; + double dToMM; +} SMARTMOTORAXISMOVE; +//==================================================================================================== +struct struct_smartmotor_machine +{ // g_machine structure + struct s_machine_config + { + struct s_smartmotor_axis_config x_axis; + struct s_smartmotor_axis_config y_axis; + struct s_smartmotor_axis_config z_axis; + + } s_machine_config; + struct s_status { + BOOL _bXHomed; + BOOL _bYHomed; + BOOL _bZHomed; + BOOL _bXYZHomed; + + BOOL _machine_running; + BOOL _bXMoving; + BOOL _bYMoving; + BOOL _bZMoving; + BOOL _bXYZMoving; + } s_status; + + struct s_smartmotor_axis x; + struct s_smartmotor_axis y; + struct s_smartmotor_axis z; +}; + +#pragma pack(pop) + +//==================================================================================================== +class SmartMotor_Proto +{ +public: + //=============Smart Motor=================== + //ISMICommPtr CommInterface; + //ISMICMotionPtr CMotionInterface; + //ISMIPathPtr PathInterface; + + ISMICommPtr CommInterface; + ISMICMotionPtr CMotionInterface; + ISMIPathPtr PathInterface; + + // machine threads. + static int g_machine_Thread_State; + static unsigned __stdcall g_machine_Thread(LPVOID pThis); + static HANDLE g_machine_Thread_Id; + static HANDLE g_machine_Serial_Mutex; // EP02 + + static HANDLE g_hHomedEvent; + + // + SmartMotor_Proto(); + virtual ~SmartMotor_Proto(); + + // Global Structures + static struct_smartmotor_machine g_machine; + + static double TimeInSecs(void); + static CLogger* g_pLogger; + + bool m_bHomingActive; + + double ScaleToMM(long lCount, double dResolution); + long MMtoScale(double lDistanceMM, double dResolution); + static void _swap_byte(unsigned short &Val); + static void _reverse_dword(DWORD *); + static void _scale2inch(unsigned long scale, double &inch); + static void _inch2scale(unsigned long &scale, double inch); + static long _4char2long(unsigned char *cBuff); + static long _3char2long(unsigned char *cBuff); + static void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len); + + SSI_STATUS_SMARTMOTOR Create_thread(); + SSI_STATUS_SMARTMOTOR Exit_thread(); + + + + SSI_STATUS_SMARTMOTOR GetAppPath(CString &Path); + SSI_STATUS_SMARTMOTOR ExtractAppPath(CString &Path); + SSI_STATUS_SMARTMOTOR SaveSmartMotorConfig(); + SSI_STATUS_SMARTMOTOR LoadSmartMotorConfig(); + + BOOL InitSmartMotor(); + void StartSmartMotor(); + void StopSmartMotor(); + void _reset_config_parameter(); + + + SSI_STATUS_SMARTMOTOR smartmotor_motion_startup(double x_scale_resolution, double y_scale_resolution, double z_scale_resolution); + SSI_STATUS_SMARTMOTOR smartmotor_motion_Dcc_Home(); + SSI_STATUS_SMARTMOTOR smartmotor_motion_IS_Homed(); + + SSI_STATUS_SMARTMOTOR _start_machine(); + SSI_STATUS_SMARTMOTOR _shutdown_machine(); + + SSI_STATUS_SMARTMOTOR smartmotor_motion_get_position_xyz(double & dX, double & dY, double & dZ); + SSI_STATUS_SMARTMOTOR smartmotor_motion_get_pos_pulse_xyz(long & lX, long & lY, long & lZ); + SSI_STATUS_SMARTMOTOR smartmotor_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait); + SSI_STATUS_SMARTMOTOR smartmotor_motion_move_rel_dis_xyz(double dX, double dY, double dZ, bool bWait); + SSI_STATUS_SMARTMOTOR smartmotor_motion_stop_xyz(); + SSI_STATUS_SMARTMOTOR smartmotor_motion_stop_xyz_S(); + + SSI_STATUS_SMARTMOTOR smartmotor_motion_get_home_status(); + SSI_STATUS_SMARTMOTOR smartmotor_motion_get_motion_status(); + SSI_STATUS_SMARTMOTOR smartmotor_motion_get_status_word(); + + SSI_STATUS_SMARTMOTOR _calculate_straightline_motion(double dSpeedMM); + + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_POS_XYZ(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOX_ABS(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOY_ABS(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOZ_ABS(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOX_REL(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOY_REL(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVETOZ_REL(double dis); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVEX(BOOL dir); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVEY(BOOL dir); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_MOVEZ(BOOL dir); + + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_ABRUPT_STOPX(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_ABRUPT_STOPY(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_ABRUPT_STOPZ(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_DECEL_STOPX(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_DECEL_STOPY(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_DECEL_STOPZ(); + + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_COMM_CMDX(CString _command); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_COMM_CMDY(CString _command); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_COMM_CMDZ(CString _command); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_COMM_RESPONSEX(CString &_response); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_COMM_RESPONSEY(CString &_response); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_COMM_RESPONSEZ(CString &_response); + + + + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_X(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Y(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_MOVE_STATUS_Z(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_HOME_STATUS_X(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_HOME_STATUS_Y(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_HOME_STATUS_Z(); + + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_STATUS_WORD0(); + SSI_STATUS_SMARTMOTOR _send_cmd_SMARTMOTOR_GET_STATUS_WORD16(); + + static SSI_STATUS_SMARTMOTOR _process_SO7_CMD_MOVE_TO_POS_XYZ(); + + +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.h b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.h new file mode 100644 index 0000000..39a5154 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.h @@ -0,0 +1,6616 @@ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 6.00.0366 */ +/* at Wed Oct 03 14:05:49 2012 + */ +/* Compiler settings for .\IntegMotorInterface.idl: + Oicf, W1, Zp8, env=Win32 (32b run) + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +//@@MIDL_FILE_HEADING( ) + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +/* verify that the version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 475 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of +#endif // __RPCNDR_H_VERSION__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __IntegMotorInterface_h__ +#define __IntegMotorInterface_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +/* Forward Declarations */ + +#ifndef __ISMIMotor_FWD_DEFINED__ +#define __ISMIMotor_FWD_DEFINED__ +typedef interface ISMIMotor ISMIMotor; +#endif /* __ISMIMotor_FWD_DEFINED__ */ + + +#ifndef __ISMIComm_FWD_DEFINED__ +#define __ISMIComm_FWD_DEFINED__ +typedef interface ISMIComm ISMIComm; +#endif /* __ISMIComm_FWD_DEFINED__ */ + + +#ifndef __ISMICMotion_FWD_DEFINED__ +#define __ISMICMotion_FWD_DEFINED__ +typedef interface ISMICMotion ISMICMotion; +#endif /* __ISMICMotion_FWD_DEFINED__ */ + + +#ifndef __ISMIPath_FWD_DEFINED__ +#define __ISMIPath_FWD_DEFINED__ +typedef interface ISMIPath ISMIPath; +#endif /* __ISMIPath_FWD_DEFINED__ */ + + +#ifndef __ISMIScan_FWD_DEFINED__ +#define __ISMIScan_FWD_DEFINED__ +typedef interface ISMIScan ISMIScan; +#endif /* __ISMIScan_FWD_DEFINED__ */ + + +#ifndef __ISMIErrors_FWD_DEFINED__ +#define __ISMIErrors_FWD_DEFINED__ +typedef interface ISMIErrors ISMIErrors; +#endif /* __ISMIErrors_FWD_DEFINED__ */ + + +#ifndef __SMIHost_FWD_DEFINED__ +#define __SMIHost_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SMIHost SMIHost; +#else +typedef struct SMIHost SMIHost; +#endif /* __cplusplus */ + +#endif /* __SMIHost_FWD_DEFINED__ */ + + +#ifndef __SMIMotor_FWD_DEFINED__ +#define __SMIMotor_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SMIMotor SMIMotor; +#else +typedef struct SMIMotor SMIMotor; +#endif /* __cplusplus */ + +#endif /* __SMIMotor_FWD_DEFINED__ */ + + +#ifndef __SMIScan_FWD_DEFINED__ +#define __SMIScan_FWD_DEFINED__ + +#ifdef __cplusplus +typedef class SMIScan SMIScan; +#else +typedef struct SMIScan SMIScan; +#endif /* __cplusplus */ + +#endif /* __SMIScan_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +void * __RPC_USER MIDL_user_allocate(size_t); +void __RPC_USER MIDL_user_free( void * ); + +/* interface __MIDL_itf_IntegMotorInterface_0000 */ +/* [local] */ + +typedef /* [public][public][public] */ +enum __MIDL___MIDL_itf_IntegMotorInterface_0000_0001 + { smi_none = 0, + smi_odd = 1, + smi_even = 2, + smi_mark = 3, + smi_space = 4 + } enum_parity; + +typedef /* [public][public][public] */ +enum __MIDL___MIDL_itf_IntegMotorInterface_0000_0002 + { smi_counterclockwise = 0, + smi_clockwise = 1 + } enum_arcdirection; + + + +extern RPC_IF_HANDLE __MIDL_itf_IntegMotorInterface_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_IntegMotorInterface_0000_v0_0_s_ifspec; + +#ifndef __ISMIMotor_INTERFACE_DEFINED__ +#define __ISMIMotor_INTERFACE_DEFINED__ + +/* interface ISMIMotor */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMIMotor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0FBA614D-B688-4D74-9D8A-E592DA3F65D3") + ISMIMotor : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetPosition( + /* [retval][out] */ long *Pos) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_P( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_P( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_V( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_V( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_A( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_A( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSpeed( + /* [retval][out] */ long *Speed) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetAcceleration( + /* [retval][out] */ long *Acceleration) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Go( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteCommand( + /* [string][in] */ BSTR Command) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetResponseOf( + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetPositionMode( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetVelocityMode( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Version( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SampleRate( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WaitForStop( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Stop( + /* [in] */ VARIANT_BOOL Decelerate) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GoTo( + /* [in] */ long Position, + /* [in] */ long Velocity, + /* [in] */ long Acceleration) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Download( + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Upload( + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DownloadEx( + /* [in] */ BSTR FileName, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE UploadEx( + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ClearProgram( + /* [in] */ long Flags) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorInfo( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetSerialNumber( + /* [string][retval][out] */ BSTR *SN) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetModelStr( + /* [string][retval][out] */ BSTR *ModelStr) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetEncoderResolution( + /* [retval][out] */ long *EncoderResolution) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorByte( + /* [in] */ long Address, + /* [retval][out] */ BYTE *TheByte) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorWord( + /* [in] */ long Address, + /* [retval][out] */ WORD *TheWord) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorDWord( + /* [in] */ long Address, + /* [retval][out] */ DWORD *TheDWord) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetMotorByte( + /* [in] */ long Address, + /* [in] */ BYTE TheByte) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetMotorWord( + /* [in] */ long Address, + /* [in] */ WORD TheWord) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetMotorDWord( + /* [in] */ long Address, + /* [in] */ DWORD TheDWord) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsServo( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DownloadProgramStr( + /* [in] */ BSTR ProgramStr, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE UploadProgramStr( + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE UpProgramStr( + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorInt( + /* [in] */ long Address, + /* [retval][out] */ short *TheInt) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotorLong( + /* [in] */ long Address, + /* [retval][out] */ long *TheLong) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetMotorInt( + /* [in] */ long Address, + /* [in] */ short TheInt) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetMotorLong( + /* [in] */ long Address, + /* [in] */ long TheLong) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AT( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_AT( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DT( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DT( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_ADT( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PT( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PT( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_VT( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_VT( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsClass5( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsClass9( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsClass5or9( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetIPAddressStr( + /* [string][retval][out] */ BSTR *IPAddressStr) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetStatusWord( + /* [in] */ SHORT DesiredWord, + /* [retval][out] */ WORD *StatusWord) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadLongSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ LONG *pValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadWordSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ WORD *pValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadByteSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ BYTE *pValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteLongSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ LONG Value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteWordSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ WORD Value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteByteSDO( + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ BYTE Value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetProgramInfo( + /* [string][retval][out] */ BSTR *ProgramInfo) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KP( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KP( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KI( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KI( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KD( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KD( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KL( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KL( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KS( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KS( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KV( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KV( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KA( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KA( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_KG( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_KG( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteFilters( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadUserVariable( + /* [in] */ BSTR VariableName, + /* [retval][out] */ LONG *Value) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteUserVariable( + /* [in] */ BSTR VariableName, + /* [in] */ LONG newValue) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadOnboardIO( + /* [retval][out] */ LONG *pOnboardIO) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadPositionError( + /* [retval][out] */ LONG *pPositionError) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteMaxPositionError( + /* [in] */ LONG MaxPositionError) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadMaxPositionError( + /* [retval][out] */ LONG *pMaxPositionError) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetProgramChecksum( + /* [retval][out] */ LONG *pProgramCheckSum) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ResetFaults( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ProgramRun( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ProgramEnd( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DriveDisable( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ConfigurePort( + /* [in] */ LONG PortNumber, + /* [in] */ LONG DesiredType) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WritePositionOrigin( + /* [in] */ LONG PositionOrigin) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_FollowAddress( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_FollowAddress( + /* [in] */ LONG newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GoAndFollower( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE StopAndFollower( + /* [in] */ VARIANT_BOOL Decelerate) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PC( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetCommandedSpeed( + /* [retval][out] */ LONG *CommandedSpeed) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadExpandedIO( + /* [retval][out] */ LONG *pExpandedIO) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsClass6( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE IsClass5or6or9( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetProgramInfoBytes( + /* [in] */ BYTE *pProgramInfo) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMIMotorVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMIMotor * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMIMotor * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMIMotor * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMIMotor * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMIMotor * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMIMotor * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMIMotor * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetPosition )( + ISMIMotor * This, + /* [retval][out] */ long *Pos); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_P )( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_P )( + ISMIMotor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_V )( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_V )( + ISMIMotor * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_A )( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_A )( + ISMIMotor * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSpeed )( + ISMIMotor * This, + /* [retval][out] */ long *Speed); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetAcceleration )( + ISMIMotor * This, + /* [retval][out] */ long *Acceleration); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Go )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteCommand )( + ISMIMotor * This, + /* [string][in] */ BSTR Command); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetResponseOf )( + ISMIMotor * This, + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetPositionMode )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetVelocityMode )( + ISMIMotor * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Version )( + ISMIMotor * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SampleRate )( + ISMIMotor * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WaitForStop )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Stop )( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL Decelerate); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GoTo )( + ISMIMotor * This, + /* [in] */ long Position, + /* [in] */ long Velocity, + /* [in] */ long Acceleration); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Download )( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Upload )( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DownloadEx )( + ISMIMotor * This, + /* [in] */ BSTR FileName, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *UploadEx )( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ClearProgram )( + ISMIMotor * This, + /* [in] */ long Flags); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorInfo )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetSerialNumber )( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *SN); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetModelStr )( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *ModelStr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetEncoderResolution )( + ISMIMotor * This, + /* [retval][out] */ long *EncoderResolution); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorByte )( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ BYTE *TheByte); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorWord )( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ WORD *TheWord); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorDWord )( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ DWORD *TheDWord); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetMotorByte )( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ BYTE TheByte); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetMotorWord )( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ WORD TheWord); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetMotorDWord )( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ DWORD TheDWord); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsServo )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DownloadProgramStr )( + ISMIMotor * This, + /* [in] */ BSTR ProgramStr, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *UploadProgramStr )( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *UpProgramStr )( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorInt )( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ short *TheInt); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotorLong )( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ long *TheLong); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetMotorInt )( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ short TheInt); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetMotorLong )( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ long TheLong); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AT )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_AT )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DT )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DT )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_ADT )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PT )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PT )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_VT )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_VT )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsClass5 )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsClass9 )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsClass5or9 )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetIPAddressStr )( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *IPAddressStr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetStatusWord )( + ISMIMotor * This, + /* [in] */ SHORT DesiredWord, + /* [retval][out] */ WORD *StatusWord); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadLongSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ LONG *pValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadWordSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ WORD *pValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadByteSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ BYTE *pValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteLongSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ LONG Value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteWordSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ WORD Value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteByteSDO )( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ BYTE Value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetProgramInfo )( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *ProgramInfo); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KP )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KP )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KI )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KI )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KD )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KD )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KL )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KL )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KS )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KS )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KV )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KV )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KA )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KA )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_KG )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_KG )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteFilters )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadUserVariable )( + ISMIMotor * This, + /* [in] */ BSTR VariableName, + /* [retval][out] */ LONG *Value); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteUserVariable )( + ISMIMotor * This, + /* [in] */ BSTR VariableName, + /* [in] */ LONG newValue); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadOnboardIO )( + ISMIMotor * This, + /* [retval][out] */ LONG *pOnboardIO); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadPositionError )( + ISMIMotor * This, + /* [retval][out] */ LONG *pPositionError); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteMaxPositionError )( + ISMIMotor * This, + /* [in] */ LONG MaxPositionError); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadMaxPositionError )( + ISMIMotor * This, + /* [retval][out] */ LONG *pMaxPositionError); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetProgramChecksum )( + ISMIMotor * This, + /* [retval][out] */ LONG *pProgramCheckSum); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ResetFaults )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ProgramRun )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ProgramEnd )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DriveDisable )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ConfigurePort )( + ISMIMotor * This, + /* [in] */ LONG PortNumber, + /* [in] */ LONG DesiredType); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WritePositionOrigin )( + ISMIMotor * This, + /* [in] */ LONG PositionOrigin); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_FollowAddress )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_FollowAddress )( + ISMIMotor * This, + /* [in] */ LONG newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GoAndFollower )( + ISMIMotor * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *StopAndFollower )( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL Decelerate); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PC )( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetCommandedSpeed )( + ISMIMotor * This, + /* [retval][out] */ LONG *CommandedSpeed); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadExpandedIO )( + ISMIMotor * This, + /* [retval][out] */ LONG *pExpandedIO); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsClass6 )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *IsClass5or6or9 )( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetProgramInfoBytes )( + ISMIMotor * This, + /* [in] */ BYTE *pProgramInfo); + + END_INTERFACE + } ISMIMotorVtbl; + + interface ISMIMotor + { + CONST_VTBL struct ISMIMotorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMIMotor_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMIMotor_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMIMotor_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMIMotor_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMIMotor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMIMotor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMIMotor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMIMotor_GetPosition(This,Pos) \ + (This)->lpVtbl -> GetPosition(This,Pos) + +#define ISMIMotor_get_P(This,pVal) \ + (This)->lpVtbl -> get_P(This,pVal) + +#define ISMIMotor_put_P(This,newVal) \ + (This)->lpVtbl -> put_P(This,newVal) + +#define ISMIMotor_get_V(This,pVal) \ + (This)->lpVtbl -> get_V(This,pVal) + +#define ISMIMotor_put_V(This,newVal) \ + (This)->lpVtbl -> put_V(This,newVal) + +#define ISMIMotor_get_A(This,pVal) \ + (This)->lpVtbl -> get_A(This,pVal) + +#define ISMIMotor_put_A(This,newVal) \ + (This)->lpVtbl -> put_A(This,newVal) + +#define ISMIMotor_GetSpeed(This,Speed) \ + (This)->lpVtbl -> GetSpeed(This,Speed) + +#define ISMIMotor_GetAcceleration(This,Acceleration) \ + (This)->lpVtbl -> GetAcceleration(This,Acceleration) + +#define ISMIMotor_Go(This) \ + (This)->lpVtbl -> Go(This) + +#define ISMIMotor_WriteCommand(This,Command) \ + (This)->lpVtbl -> WriteCommand(This,Command) + +#define ISMIMotor_GetResponseOf(This,Command,Response) \ + (This)->lpVtbl -> GetResponseOf(This,Command,Response) + +#define ISMIMotor_SetPositionMode(This) \ + (This)->lpVtbl -> SetPositionMode(This) + +#define ISMIMotor_SetVelocityMode(This) \ + (This)->lpVtbl -> SetVelocityMode(This) + +#define ISMIMotor_get_Version(This,pVal) \ + (This)->lpVtbl -> get_Version(This,pVal) + +#define ISMIMotor_get_SampleRate(This,pVal) \ + (This)->lpVtbl -> get_SampleRate(This,pVal) + +#define ISMIMotor_WaitForStop(This) \ + (This)->lpVtbl -> WaitForStop(This) + +#define ISMIMotor_Stop(This,Decelerate) \ + (This)->lpVtbl -> Stop(This,Decelerate) + +#define ISMIMotor_GoTo(This,Position,Velocity,Acceleration) \ + (This)->lpVtbl -> GoTo(This,Position,Velocity,Acceleration) + +#define ISMIMotor_Download(This,FileName) \ + (This)->lpVtbl -> Download(This,FileName) + +#define ISMIMotor_Upload(This,FileName) \ + (This)->lpVtbl -> Upload(This,FileName) + +#define ISMIMotor_DownloadEx(This,FileName,Flags,pVal) \ + (This)->lpVtbl -> DownloadEx(This,FileName,Flags,pVal) + +#define ISMIMotor_UploadEx(This,FileName) \ + (This)->lpVtbl -> UploadEx(This,FileName) + +#define ISMIMotor_ClearProgram(This,Flags) \ + (This)->lpVtbl -> ClearProgram(This,Flags) + +#define ISMIMotor_GetMotorInfo(This,pVal) \ + (This)->lpVtbl -> GetMotorInfo(This,pVal) + +#define ISMIMotor_GetSerialNumber(This,SN) \ + (This)->lpVtbl -> GetSerialNumber(This,SN) + +#define ISMIMotor_GetModelStr(This,ModelStr) \ + (This)->lpVtbl -> GetModelStr(This,ModelStr) + +#define ISMIMotor_GetEncoderResolution(This,EncoderResolution) \ + (This)->lpVtbl -> GetEncoderResolution(This,EncoderResolution) + +#define ISMIMotor_GetMotorByte(This,Address,TheByte) \ + (This)->lpVtbl -> GetMotorByte(This,Address,TheByte) + +#define ISMIMotor_GetMotorWord(This,Address,TheWord) \ + (This)->lpVtbl -> GetMotorWord(This,Address,TheWord) + +#define ISMIMotor_GetMotorDWord(This,Address,TheDWord) \ + (This)->lpVtbl -> GetMotorDWord(This,Address,TheDWord) + +#define ISMIMotor_SetMotorByte(This,Address,TheByte) \ + (This)->lpVtbl -> SetMotorByte(This,Address,TheByte) + +#define ISMIMotor_SetMotorWord(This,Address,TheWord) \ + (This)->lpVtbl -> SetMotorWord(This,Address,TheWord) + +#define ISMIMotor_SetMotorDWord(This,Address,TheDWord) \ + (This)->lpVtbl -> SetMotorDWord(This,Address,TheDWord) + +#define ISMIMotor_IsServo(This,pVal) \ + (This)->lpVtbl -> IsServo(This,pVal) + +#define ISMIMotor_DownloadProgramStr(This,ProgramStr,Flags,pVal) \ + (This)->lpVtbl -> DownloadProgramStr(This,ProgramStr,Flags,pVal) + +#define ISMIMotor_UploadProgramStr(This,CalPrg,ProgramStr) \ + (This)->lpVtbl -> UploadProgramStr(This,CalPrg,ProgramStr) + +#define ISMIMotor_UpProgramStr(This,CalPrg,ProgramStr) \ + (This)->lpVtbl -> UpProgramStr(This,CalPrg,ProgramStr) + +#define ISMIMotor_GetMotorInt(This,Address,TheInt) \ + (This)->lpVtbl -> GetMotorInt(This,Address,TheInt) + +#define ISMIMotor_GetMotorLong(This,Address,TheLong) \ + (This)->lpVtbl -> GetMotorLong(This,Address,TheLong) + +#define ISMIMotor_SetMotorInt(This,Address,TheInt) \ + (This)->lpVtbl -> SetMotorInt(This,Address,TheInt) + +#define ISMIMotor_SetMotorLong(This,Address,TheLong) \ + (This)->lpVtbl -> SetMotorLong(This,Address,TheLong) + +#define ISMIMotor_get_AT(This,pVal) \ + (This)->lpVtbl -> get_AT(This,pVal) + +#define ISMIMotor_put_AT(This,newVal) \ + (This)->lpVtbl -> put_AT(This,newVal) + +#define ISMIMotor_get_DT(This,pVal) \ + (This)->lpVtbl -> get_DT(This,pVal) + +#define ISMIMotor_put_DT(This,newVal) \ + (This)->lpVtbl -> put_DT(This,newVal) + +#define ISMIMotor_put_ADT(This,newVal) \ + (This)->lpVtbl -> put_ADT(This,newVal) + +#define ISMIMotor_get_PT(This,pVal) \ + (This)->lpVtbl -> get_PT(This,pVal) + +#define ISMIMotor_put_PT(This,newVal) \ + (This)->lpVtbl -> put_PT(This,newVal) + +#define ISMIMotor_get_VT(This,pVal) \ + (This)->lpVtbl -> get_VT(This,pVal) + +#define ISMIMotor_put_VT(This,newVal) \ + (This)->lpVtbl -> put_VT(This,newVal) + +#define ISMIMotor_IsClass5(This,pVal) \ + (This)->lpVtbl -> IsClass5(This,pVal) + +#define ISMIMotor_IsClass9(This,pVal) \ + (This)->lpVtbl -> IsClass9(This,pVal) + +#define ISMIMotor_IsClass5or9(This,pVal) \ + (This)->lpVtbl -> IsClass5or9(This,pVal) + +#define ISMIMotor_GetIPAddressStr(This,IPAddressStr) \ + (This)->lpVtbl -> GetIPAddressStr(This,IPAddressStr) + +#define ISMIMotor_GetStatusWord(This,DesiredWord,StatusWord) \ + (This)->lpVtbl -> GetStatusWord(This,DesiredWord,StatusWord) + +#define ISMIMotor_ReadLongSDO(This,index,subindex,pValue) \ + (This)->lpVtbl -> ReadLongSDO(This,index,subindex,pValue) + +#define ISMIMotor_ReadWordSDO(This,index,subindex,pValue) \ + (This)->lpVtbl -> ReadWordSDO(This,index,subindex,pValue) + +#define ISMIMotor_ReadByteSDO(This,index,subindex,pValue) \ + (This)->lpVtbl -> ReadByteSDO(This,index,subindex,pValue) + +#define ISMIMotor_WriteLongSDO(This,index,subindex,Value) \ + (This)->lpVtbl -> WriteLongSDO(This,index,subindex,Value) + +#define ISMIMotor_WriteWordSDO(This,index,subindex,Value) \ + (This)->lpVtbl -> WriteWordSDO(This,index,subindex,Value) + +#define ISMIMotor_WriteByteSDO(This,index,subindex,Value) \ + (This)->lpVtbl -> WriteByteSDO(This,index,subindex,Value) + +#define ISMIMotor_GetProgramInfo(This,ProgramInfo) \ + (This)->lpVtbl -> GetProgramInfo(This,ProgramInfo) + +#define ISMIMotor_get_KP(This,pVal) \ + (This)->lpVtbl -> get_KP(This,pVal) + +#define ISMIMotor_put_KP(This,newVal) \ + (This)->lpVtbl -> put_KP(This,newVal) + +#define ISMIMotor_get_KI(This,pVal) \ + (This)->lpVtbl -> get_KI(This,pVal) + +#define ISMIMotor_put_KI(This,newVal) \ + (This)->lpVtbl -> put_KI(This,newVal) + +#define ISMIMotor_get_KD(This,pVal) \ + (This)->lpVtbl -> get_KD(This,pVal) + +#define ISMIMotor_put_KD(This,newVal) \ + (This)->lpVtbl -> put_KD(This,newVal) + +#define ISMIMotor_get_KL(This,pVal) \ + (This)->lpVtbl -> get_KL(This,pVal) + +#define ISMIMotor_put_KL(This,newVal) \ + (This)->lpVtbl -> put_KL(This,newVal) + +#define ISMIMotor_get_KS(This,pVal) \ + (This)->lpVtbl -> get_KS(This,pVal) + +#define ISMIMotor_put_KS(This,newVal) \ + (This)->lpVtbl -> put_KS(This,newVal) + +#define ISMIMotor_get_KV(This,pVal) \ + (This)->lpVtbl -> get_KV(This,pVal) + +#define ISMIMotor_put_KV(This,newVal) \ + (This)->lpVtbl -> put_KV(This,newVal) + +#define ISMIMotor_get_KA(This,pVal) \ + (This)->lpVtbl -> get_KA(This,pVal) + +#define ISMIMotor_put_KA(This,newVal) \ + (This)->lpVtbl -> put_KA(This,newVal) + +#define ISMIMotor_get_KG(This,pVal) \ + (This)->lpVtbl -> get_KG(This,pVal) + +#define ISMIMotor_put_KG(This,newVal) \ + (This)->lpVtbl -> put_KG(This,newVal) + +#define ISMIMotor_WriteFilters(This) \ + (This)->lpVtbl -> WriteFilters(This) + +#define ISMIMotor_ReadUserVariable(This,VariableName,Value) \ + (This)->lpVtbl -> ReadUserVariable(This,VariableName,Value) + +#define ISMIMotor_WriteUserVariable(This,VariableName,newValue) \ + (This)->lpVtbl -> WriteUserVariable(This,VariableName,newValue) + +#define ISMIMotor_ReadOnboardIO(This,pOnboardIO) \ + (This)->lpVtbl -> ReadOnboardIO(This,pOnboardIO) + +#define ISMIMotor_ReadPositionError(This,pPositionError) \ + (This)->lpVtbl -> ReadPositionError(This,pPositionError) + +#define ISMIMotor_WriteMaxPositionError(This,MaxPositionError) \ + (This)->lpVtbl -> WriteMaxPositionError(This,MaxPositionError) + +#define ISMIMotor_ReadMaxPositionError(This,pMaxPositionError) \ + (This)->lpVtbl -> ReadMaxPositionError(This,pMaxPositionError) + +#define ISMIMotor_GetProgramChecksum(This,pProgramCheckSum) \ + (This)->lpVtbl -> GetProgramChecksum(This,pProgramCheckSum) + +#define ISMIMotor_ResetFaults(This) \ + (This)->lpVtbl -> ResetFaults(This) + +#define ISMIMotor_ProgramRun(This) \ + (This)->lpVtbl -> ProgramRun(This) + +#define ISMIMotor_ProgramEnd(This) \ + (This)->lpVtbl -> ProgramEnd(This) + +#define ISMIMotor_DriveDisable(This) \ + (This)->lpVtbl -> DriveDisable(This) + +#define ISMIMotor_ConfigurePort(This,PortNumber,DesiredType) \ + (This)->lpVtbl -> ConfigurePort(This,PortNumber,DesiredType) + +#define ISMIMotor_WritePositionOrigin(This,PositionOrigin) \ + (This)->lpVtbl -> WritePositionOrigin(This,PositionOrigin) + +#define ISMIMotor_get_FollowAddress(This,pVal) \ + (This)->lpVtbl -> get_FollowAddress(This,pVal) + +#define ISMIMotor_put_FollowAddress(This,newVal) \ + (This)->lpVtbl -> put_FollowAddress(This,newVal) + +#define ISMIMotor_GoAndFollower(This) \ + (This)->lpVtbl -> GoAndFollower(This) + +#define ISMIMotor_StopAndFollower(This,Decelerate) \ + (This)->lpVtbl -> StopAndFollower(This,Decelerate) + +#define ISMIMotor_get_PC(This,pVal) \ + (This)->lpVtbl -> get_PC(This,pVal) + +#define ISMIMotor_GetCommandedSpeed(This,CommandedSpeed) \ + (This)->lpVtbl -> GetCommandedSpeed(This,CommandedSpeed) + +#define ISMIMotor_ReadExpandedIO(This,pExpandedIO) \ + (This)->lpVtbl -> ReadExpandedIO(This,pExpandedIO) + +#define ISMIMotor_IsClass6(This,pVal) \ + (This)->lpVtbl -> IsClass6(This,pVal) + +#define ISMIMotor_IsClass5or6or9(This,pVal) \ + (This)->lpVtbl -> IsClass5or6or9(This,pVal) + +#define ISMIMotor_GetProgramInfoBytes(This,pProgramInfo) \ + (This)->lpVtbl -> GetProgramInfoBytes(This,pProgramInfo) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetPosition_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *Pos); + + +void __RPC_STUB ISMIMotor_GetPosition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_P_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIMotor_get_P_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_P_Proxy( + ISMIMotor * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIMotor_put_P_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_V_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIMotor_get_V_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_V_Proxy( + ISMIMotor * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIMotor_put_V_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_A_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIMotor_get_A_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_A_Proxy( + ISMIMotor * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIMotor_put_A_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetSpeed_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *Speed); + + +void __RPC_STUB ISMIMotor_GetSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetAcceleration_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *Acceleration); + + +void __RPC_STUB ISMIMotor_GetAcceleration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_Go_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_Go_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteCommand_Proxy( + ISMIMotor * This, + /* [string][in] */ BSTR Command); + + +void __RPC_STUB ISMIMotor_WriteCommand_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetResponseOf_Proxy( + ISMIMotor * This, + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response); + + +void __RPC_STUB ISMIMotor_GetResponseOf_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetPositionMode_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_SetPositionMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetVelocityMode_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_SetVelocityMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_Version_Proxy( + ISMIMotor * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB ISMIMotor_get_Version_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_SampleRate_Proxy( + ISMIMotor * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMIMotor_get_SampleRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WaitForStop_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_WaitForStop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_Stop_Proxy( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL Decelerate); + + +void __RPC_STUB ISMIMotor_Stop_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GoTo_Proxy( + ISMIMotor * This, + /* [in] */ long Position, + /* [in] */ long Velocity, + /* [in] */ long Acceleration); + + +void __RPC_STUB ISMIMotor_GoTo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_Download_Proxy( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIMotor_Download_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_Upload_Proxy( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIMotor_Upload_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_DownloadEx_Proxy( + ISMIMotor * This, + /* [in] */ BSTR FileName, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_DownloadEx_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_UploadEx_Proxy( + ISMIMotor * This, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIMotor_UploadEx_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ClearProgram_Proxy( + ISMIMotor * This, + /* [in] */ long Flags); + + +void __RPC_STUB ISMIMotor_ClearProgram_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorInfo_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_GetMotorInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetSerialNumber_Proxy( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *SN); + + +void __RPC_STUB ISMIMotor_GetSerialNumber_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetModelStr_Proxy( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *ModelStr); + + +void __RPC_STUB ISMIMotor_GetModelStr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetEncoderResolution_Proxy( + ISMIMotor * This, + /* [retval][out] */ long *EncoderResolution); + + +void __RPC_STUB ISMIMotor_GetEncoderResolution_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorByte_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ BYTE *TheByte); + + +void __RPC_STUB ISMIMotor_GetMotorByte_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorWord_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ WORD *TheWord); + + +void __RPC_STUB ISMIMotor_GetMotorWord_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorDWord_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ DWORD *TheDWord); + + +void __RPC_STUB ISMIMotor_GetMotorDWord_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetMotorByte_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ BYTE TheByte); + + +void __RPC_STUB ISMIMotor_SetMotorByte_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetMotorWord_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ WORD TheWord); + + +void __RPC_STUB ISMIMotor_SetMotorWord_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetMotorDWord_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ DWORD TheDWord); + + +void __RPC_STUB ISMIMotor_SetMotorDWord_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsServo_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsServo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_DownloadProgramStr_Proxy( + ISMIMotor * This, + /* [in] */ BSTR ProgramStr, + /* [in] */ long Flags, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_DownloadProgramStr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_UploadProgramStr_Proxy( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr); + + +void __RPC_STUB ISMIMotor_UploadProgramStr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_UpProgramStr_Proxy( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL CalPrg, + /* [string][retval][out] */ BSTR *ProgramStr); + + +void __RPC_STUB ISMIMotor_UpProgramStr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorInt_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ short *TheInt); + + +void __RPC_STUB ISMIMotor_GetMotorInt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetMotorLong_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [retval][out] */ long *TheLong); + + +void __RPC_STUB ISMIMotor_GetMotorLong_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetMotorInt_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ short TheInt); + + +void __RPC_STUB ISMIMotor_SetMotorInt_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_SetMotorLong_Proxy( + ISMIMotor * This, + /* [in] */ long Address, + /* [in] */ long TheLong); + + +void __RPC_STUB ISMIMotor_SetMotorLong_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_AT_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_AT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_AT_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_AT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_DT_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_DT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_DT_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_DT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_ADT_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_ADT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_PT_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_PT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_PT_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_PT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_VT_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_VT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_VT_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_VT_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsClass5_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsClass5_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsClass9_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsClass9_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsClass5or9_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsClass5or9_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetIPAddressStr_Proxy( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *IPAddressStr); + + +void __RPC_STUB ISMIMotor_GetIPAddressStr_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetStatusWord_Proxy( + ISMIMotor * This, + /* [in] */ SHORT DesiredWord, + /* [retval][out] */ WORD *StatusWord); + + +void __RPC_STUB ISMIMotor_GetStatusWord_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadLongSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ LONG *pValue); + + +void __RPC_STUB ISMIMotor_ReadLongSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadWordSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ WORD *pValue); + + +void __RPC_STUB ISMIMotor_ReadWordSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadByteSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [retval][out] */ BYTE *pValue); + + +void __RPC_STUB ISMIMotor_ReadByteSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteLongSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ LONG Value); + + +void __RPC_STUB ISMIMotor_WriteLongSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteWordSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ WORD Value); + + +void __RPC_STUB ISMIMotor_WriteWordSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteByteSDO_Proxy( + ISMIMotor * This, + /* [in] */ LONG index, + /* [in] */ LONG subindex, + /* [in] */ BYTE Value); + + +void __RPC_STUB ISMIMotor_WriteByteSDO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetProgramInfo_Proxy( + ISMIMotor * This, + /* [string][retval][out] */ BSTR *ProgramInfo); + + +void __RPC_STUB ISMIMotor_GetProgramInfo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KP_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KP_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KP_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KP_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KI_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KI_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KI_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KD_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KD_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KD_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KL_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KL_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KL_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KS_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KS_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KS_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KV_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KV_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KV_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KV_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KA_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KA_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KA_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_KG_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_KG_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_KG_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_KG_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteFilters_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_WriteFilters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadUserVariable_Proxy( + ISMIMotor * This, + /* [in] */ BSTR VariableName, + /* [retval][out] */ LONG *Value); + + +void __RPC_STUB ISMIMotor_ReadUserVariable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteUserVariable_Proxy( + ISMIMotor * This, + /* [in] */ BSTR VariableName, + /* [in] */ LONG newValue); + + +void __RPC_STUB ISMIMotor_WriteUserVariable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadOnboardIO_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pOnboardIO); + + +void __RPC_STUB ISMIMotor_ReadOnboardIO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadPositionError_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pPositionError); + + +void __RPC_STUB ISMIMotor_ReadPositionError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WriteMaxPositionError_Proxy( + ISMIMotor * This, + /* [in] */ LONG MaxPositionError); + + +void __RPC_STUB ISMIMotor_WriteMaxPositionError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadMaxPositionError_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pMaxPositionError); + + +void __RPC_STUB ISMIMotor_ReadMaxPositionError_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetProgramChecksum_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pProgramCheckSum); + + +void __RPC_STUB ISMIMotor_GetProgramChecksum_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ResetFaults_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_ResetFaults_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ProgramRun_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_ProgramRun_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ProgramEnd_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_ProgramEnd_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_DriveDisable_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_DriveDisable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ConfigurePort_Proxy( + ISMIMotor * This, + /* [in] */ LONG PortNumber, + /* [in] */ LONG DesiredType); + + +void __RPC_STUB ISMIMotor_ConfigurePort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_WritePositionOrigin_Proxy( + ISMIMotor * This, + /* [in] */ LONG PositionOrigin); + + +void __RPC_STUB ISMIMotor_WritePositionOrigin_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_FollowAddress_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_FollowAddress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIMotor_put_FollowAddress_Proxy( + ISMIMotor * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIMotor_put_FollowAddress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GoAndFollower_Proxy( + ISMIMotor * This); + + +void __RPC_STUB ISMIMotor_GoAndFollower_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_StopAndFollower_Proxy( + ISMIMotor * This, + /* [in] */ VARIANT_BOOL Decelerate); + + +void __RPC_STUB ISMIMotor_StopAndFollower_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIMotor_get_PC_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIMotor_get_PC_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetCommandedSpeed_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *CommandedSpeed); + + +void __RPC_STUB ISMIMotor_GetCommandedSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_ReadExpandedIO_Proxy( + ISMIMotor * This, + /* [retval][out] */ LONG *pExpandedIO); + + +void __RPC_STUB ISMIMotor_ReadExpandedIO_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsClass6_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsClass6_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_IsClass5or6or9_Proxy( + ISMIMotor * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIMotor_IsClass5or6or9_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIMotor_GetProgramInfoBytes_Proxy( + ISMIMotor * This, + /* [in] */ BYTE *pProgramInfo); + + +void __RPC_STUB ISMIMotor_GetProgramInfoBytes_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMIMotor_INTERFACE_DEFINED__ */ + + +#ifndef __ISMIComm_INTERFACE_DEFINED__ +#define __ISMIComm_INTERFACE_DEFINED__ + +/* interface ISMIComm */ +/* [helpcontext][unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMIComm; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BC26FBB8-00E1-11D4-B5D0-00600831E1F3") + ISMIComm : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE OpenPort( + BSTR PortName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ClosePort( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PortHandle( + /* [retval][out] */ long **pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ClearBuffer( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BytesAvailable( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteCommand( + /* [string][in] */ BSTR Command) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteString( + /* [string][in] */ BSTR Data) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadResponse( + /* [string][retval][out] */ BSTR *Response) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadString( + /* [in] */ long NoOfBytes, + /* [string][retval][out] */ BSTR *Data) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EstablishChain( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddressMotorChain( + /* [retval][out] */ long *MotorCount) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Wait( + /* [in] */ long Time) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DefaultMotor( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DefaultMotor( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Echo( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Echo( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Parity( + /* [retval][out] */ enum_parity *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Parity( + /* [in] */ enum_parity newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_BaudRate( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_BaudRate( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Timeout( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Timeout( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CharDelay( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_CharDelay( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PortName( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetResponseOf( + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GetMotor( + /* [in] */ long Address, + /* [retval][out] */ ISMIMotor **ppMotor) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxMotors( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxMotors( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Download( + /* [in] */ long Motor, + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Upload( + /* [in] */ long Motor, + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ForceUpload( + /* [in] */ long Motor, + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_IsRS485( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_IsRS485( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ClearEEPROM( + /* [in] */ long Motor) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InitializeNotification( + /* [in] */ long hWindow, + /* [in] */ long message) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteCmd( + /* [string][in] */ BSTR Command) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InitRS485( + /* [in] */ long NoOfMotors, + /* [in] */ long MotorChannel) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TxMaxRetry( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TxMaxRetry( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TxTimeoutMul( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TxTimeoutMul( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TxTimeoutConst( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TxTimeoutConst( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LogFlags( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LogFlags( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LogFileName( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LogFileName( + /* [in] */ BSTR newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EchoTimeoutMul( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EchoTimeoutMul( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EchoTimeoutConst( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EchoTimeoutConst( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DetectRS232( + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DetectRS485( + /* [in] */ long MaxAddress, + /* [in] */ long MotorChannel, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddressServos( + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NoOfMotors( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EngineVersion( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InitEthernet( + /* [in] */ long MaxAddress) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DetectNetMotors( + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE AddNetMotor( + /* [string][in] */ BSTR IPAddress, + /* [retval][out] */ long *MotorAddress) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InitUSB( + /* [in] */ long MaxAddress) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DetectUSBMotors( + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReorderMotors( + /* [in] */ long Address, + /* [string][in] */ BSTR SerialNo, + /* [retval][out] */ long *OldMotorAddress) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE InitCANOpen( + /* [in] */ long MaxAddress) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DetectCANOpenMotors( + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadCharacters( + /* [in] */ LONG NoOfBytes, + /* [retval][out] */ BSTR *pData) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_DelayEchoOff( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_DelayEchoOff( + /* [in] */ LONG newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMICommVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMIComm * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMIComm * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMIComm * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMIComm * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMIComm * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMIComm * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMIComm * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *OpenPort )( + ISMIComm * This, + BSTR PortName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ClosePort )( + ISMIComm * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortHandle )( + ISMIComm * This, + /* [retval][out] */ long **pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ClearBuffer )( + ISMIComm * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BytesAvailable )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteCommand )( + ISMIComm * This, + /* [string][in] */ BSTR Command); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteString )( + ISMIComm * This, + /* [string][in] */ BSTR Data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadResponse )( + ISMIComm * This, + /* [string][retval][out] */ BSTR *Response); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadString )( + ISMIComm * This, + /* [in] */ long NoOfBytes, + /* [string][retval][out] */ BSTR *Data); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EstablishChain )( + ISMIComm * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddressMotorChain )( + ISMIComm * This, + /* [retval][out] */ long *MotorCount); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Wait )( + ISMIComm * This, + /* [in] */ long Time); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DefaultMotor )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DefaultMotor )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Echo )( + ISMIComm * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Echo )( + ISMIComm * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Parity )( + ISMIComm * This, + /* [retval][out] */ enum_parity *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Parity )( + ISMIComm * This, + /* [in] */ enum_parity newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_BaudRate )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_BaudRate )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Timeout )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Timeout )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CharDelay )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_CharDelay )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PortName )( + ISMIComm * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetResponseOf )( + ISMIComm * This, + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GetMotor )( + ISMIComm * This, + /* [in] */ long Address, + /* [retval][out] */ ISMIMotor **ppMotor); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxMotors )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxMotors )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Download )( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Upload )( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ForceUpload )( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsRS485 )( + ISMIComm * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_IsRS485 )( + ISMIComm * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ClearEEPROM )( + ISMIComm * This, + /* [in] */ long Motor); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InitializeNotification )( + ISMIComm * This, + /* [in] */ long hWindow, + /* [in] */ long message); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteCmd )( + ISMIComm * This, + /* [string][in] */ BSTR Command); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InitRS485 )( + ISMIComm * This, + /* [in] */ long NoOfMotors, + /* [in] */ long MotorChannel); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TxMaxRetry )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TxMaxRetry )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TxTimeoutMul )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TxTimeoutMul )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TxTimeoutConst )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TxTimeoutConst )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LogFlags )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LogFlags )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LogFileName )( + ISMIComm * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LogFileName )( + ISMIComm * This, + /* [in] */ BSTR newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EchoTimeoutMul )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_EchoTimeoutMul )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EchoTimeoutConst )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_EchoTimeoutConst )( + ISMIComm * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DetectRS232 )( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DetectRS485 )( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long MotorChannel, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddressServos )( + ISMIComm * This, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NoOfMotors )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EngineVersion )( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InitEthernet )( + ISMIComm * This, + /* [in] */ long MaxAddress); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DetectNetMotors )( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *AddNetMotor )( + ISMIComm * This, + /* [string][in] */ BSTR IPAddress, + /* [retval][out] */ long *MotorAddress); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InitUSB )( + ISMIComm * This, + /* [in] */ long MaxAddress); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DetectUSBMotors )( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReorderMotors )( + ISMIComm * This, + /* [in] */ long Address, + /* [string][in] */ BSTR SerialNo, + /* [retval][out] */ long *OldMotorAddress); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *InitCANOpen )( + ISMIComm * This, + /* [in] */ long MaxAddress); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DetectCANOpenMotors )( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadCharacters )( + ISMIComm * This, + /* [in] */ LONG NoOfBytes, + /* [retval][out] */ BSTR *pData); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_DelayEchoOff )( + ISMIComm * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_DelayEchoOff )( + ISMIComm * This, + /* [in] */ LONG newVal); + + END_INTERFACE + } ISMICommVtbl; + + interface ISMIComm + { + CONST_VTBL struct ISMICommVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMIComm_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMIComm_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMIComm_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMIComm_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMIComm_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMIComm_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMIComm_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMIComm_OpenPort(This,PortName) \ + (This)->lpVtbl -> OpenPort(This,PortName) + +#define ISMIComm_ClosePort(This) \ + (This)->lpVtbl -> ClosePort(This) + +#define ISMIComm_get_PortHandle(This,pVal) \ + (This)->lpVtbl -> get_PortHandle(This,pVal) + +#define ISMIComm_ClearBuffer(This) \ + (This)->lpVtbl -> ClearBuffer(This) + +#define ISMIComm_get_BytesAvailable(This,pVal) \ + (This)->lpVtbl -> get_BytesAvailable(This,pVal) + +#define ISMIComm_WriteCommand(This,Command) \ + (This)->lpVtbl -> WriteCommand(This,Command) + +#define ISMIComm_WriteString(This,Data) \ + (This)->lpVtbl -> WriteString(This,Data) + +#define ISMIComm_ReadResponse(This,Response) \ + (This)->lpVtbl -> ReadResponse(This,Response) + +#define ISMIComm_ReadString(This,NoOfBytes,Data) \ + (This)->lpVtbl -> ReadString(This,NoOfBytes,Data) + +#define ISMIComm_EstablishChain(This) \ + (This)->lpVtbl -> EstablishChain(This) + +#define ISMIComm_AddressMotorChain(This,MotorCount) \ + (This)->lpVtbl -> AddressMotorChain(This,MotorCount) + +#define ISMIComm_Wait(This,Time) \ + (This)->lpVtbl -> Wait(This,Time) + +#define ISMIComm_get_DefaultMotor(This,pVal) \ + (This)->lpVtbl -> get_DefaultMotor(This,pVal) + +#define ISMIComm_put_DefaultMotor(This,newVal) \ + (This)->lpVtbl -> put_DefaultMotor(This,newVal) + +#define ISMIComm_get_Echo(This,pVal) \ + (This)->lpVtbl -> get_Echo(This,pVal) + +#define ISMIComm_put_Echo(This,newVal) \ + (This)->lpVtbl -> put_Echo(This,newVal) + +#define ISMIComm_get_Parity(This,pVal) \ + (This)->lpVtbl -> get_Parity(This,pVal) + +#define ISMIComm_put_Parity(This,newVal) \ + (This)->lpVtbl -> put_Parity(This,newVal) + +#define ISMIComm_get_BaudRate(This,pVal) \ + (This)->lpVtbl -> get_BaudRate(This,pVal) + +#define ISMIComm_put_BaudRate(This,newVal) \ + (This)->lpVtbl -> put_BaudRate(This,newVal) + +#define ISMIComm_get_Timeout(This,pVal) \ + (This)->lpVtbl -> get_Timeout(This,pVal) + +#define ISMIComm_put_Timeout(This,newVal) \ + (This)->lpVtbl -> put_Timeout(This,newVal) + +#define ISMIComm_get_CharDelay(This,pVal) \ + (This)->lpVtbl -> get_CharDelay(This,pVal) + +#define ISMIComm_put_CharDelay(This,newVal) \ + (This)->lpVtbl -> put_CharDelay(This,newVal) + +#define ISMIComm_get_PortName(This,pVal) \ + (This)->lpVtbl -> get_PortName(This,pVal) + +#define ISMIComm_GetResponseOf(This,Command,Response) \ + (This)->lpVtbl -> GetResponseOf(This,Command,Response) + +#define ISMIComm_GetMotor(This,Address,ppMotor) \ + (This)->lpVtbl -> GetMotor(This,Address,ppMotor) + +#define ISMIComm_get_MaxMotors(This,pVal) \ + (This)->lpVtbl -> get_MaxMotors(This,pVal) + +#define ISMIComm_put_MaxMotors(This,newVal) \ + (This)->lpVtbl -> put_MaxMotors(This,newVal) + +#define ISMIComm_Download(This,Motor,FileName) \ + (This)->lpVtbl -> Download(This,Motor,FileName) + +#define ISMIComm_Upload(This,Motor,FileName) \ + (This)->lpVtbl -> Upload(This,Motor,FileName) + +#define ISMIComm_ForceUpload(This,Motor,FileName) \ + (This)->lpVtbl -> ForceUpload(This,Motor,FileName) + +#define ISMIComm_get_IsRS485(This,pVal) \ + (This)->lpVtbl -> get_IsRS485(This,pVal) + +#define ISMIComm_put_IsRS485(This,newVal) \ + (This)->lpVtbl -> put_IsRS485(This,newVal) + +#define ISMIComm_ClearEEPROM(This,Motor) \ + (This)->lpVtbl -> ClearEEPROM(This,Motor) + +#define ISMIComm_InitializeNotification(This,hWindow,message) \ + (This)->lpVtbl -> InitializeNotification(This,hWindow,message) + +#define ISMIComm_WriteCmd(This,Command) \ + (This)->lpVtbl -> WriteCmd(This,Command) + +#define ISMIComm_InitRS485(This,NoOfMotors,MotorChannel) \ + (This)->lpVtbl -> InitRS485(This,NoOfMotors,MotorChannel) + +#define ISMIComm_get_TxMaxRetry(This,pVal) \ + (This)->lpVtbl -> get_TxMaxRetry(This,pVal) + +#define ISMIComm_put_TxMaxRetry(This,newVal) \ + (This)->lpVtbl -> put_TxMaxRetry(This,newVal) + +#define ISMIComm_get_TxTimeoutMul(This,pVal) \ + (This)->lpVtbl -> get_TxTimeoutMul(This,pVal) + +#define ISMIComm_put_TxTimeoutMul(This,newVal) \ + (This)->lpVtbl -> put_TxTimeoutMul(This,newVal) + +#define ISMIComm_get_TxTimeoutConst(This,pVal) \ + (This)->lpVtbl -> get_TxTimeoutConst(This,pVal) + +#define ISMIComm_put_TxTimeoutConst(This,newVal) \ + (This)->lpVtbl -> put_TxTimeoutConst(This,newVal) + +#define ISMIComm_get_LogFlags(This,pVal) \ + (This)->lpVtbl -> get_LogFlags(This,pVal) + +#define ISMIComm_put_LogFlags(This,newVal) \ + (This)->lpVtbl -> put_LogFlags(This,newVal) + +#define ISMIComm_get_LogFileName(This,pVal) \ + (This)->lpVtbl -> get_LogFileName(This,pVal) + +#define ISMIComm_put_LogFileName(This,newVal) \ + (This)->lpVtbl -> put_LogFileName(This,newVal) + +#define ISMIComm_get_EchoTimeoutMul(This,pVal) \ + (This)->lpVtbl -> get_EchoTimeoutMul(This,pVal) + +#define ISMIComm_put_EchoTimeoutMul(This,newVal) \ + (This)->lpVtbl -> put_EchoTimeoutMul(This,newVal) + +#define ISMIComm_get_EchoTimeoutConst(This,pVal) \ + (This)->lpVtbl -> get_EchoTimeoutConst(This,pVal) + +#define ISMIComm_put_EchoTimeoutConst(This,newVal) \ + (This)->lpVtbl -> put_EchoTimeoutConst(This,newVal) + +#define ISMIComm_DetectRS232(This,MaxAddress,Flags,ErrorCode) \ + (This)->lpVtbl -> DetectRS232(This,MaxAddress,Flags,ErrorCode) + +#define ISMIComm_DetectRS485(This,MaxAddress,MotorChannel,Flags,ErrorCode) \ + (This)->lpVtbl -> DetectRS485(This,MaxAddress,MotorChannel,Flags,ErrorCode) + +#define ISMIComm_AddressServos(This,Flags,ErrorCode) \ + (This)->lpVtbl -> AddressServos(This,Flags,ErrorCode) + +#define ISMIComm_get_NoOfMotors(This,pVal) \ + (This)->lpVtbl -> get_NoOfMotors(This,pVal) + +#define ISMIComm_get_EngineVersion(This,pVal) \ + (This)->lpVtbl -> get_EngineVersion(This,pVal) + +#define ISMIComm_InitEthernet(This,MaxAddress) \ + (This)->lpVtbl -> InitEthernet(This,MaxAddress) + +#define ISMIComm_DetectNetMotors(This,MaxAddress,Flags,ErrorCode) \ + (This)->lpVtbl -> DetectNetMotors(This,MaxAddress,Flags,ErrorCode) + +#define ISMIComm_AddNetMotor(This,IPAddress,MotorAddress) \ + (This)->lpVtbl -> AddNetMotor(This,IPAddress,MotorAddress) + +#define ISMIComm_InitUSB(This,MaxAddress) \ + (This)->lpVtbl -> InitUSB(This,MaxAddress) + +#define ISMIComm_DetectUSBMotors(This,MaxAddress,Flags,ErrorCode) \ + (This)->lpVtbl -> DetectUSBMotors(This,MaxAddress,Flags,ErrorCode) + +#define ISMIComm_ReorderMotors(This,Address,SerialNo,OldMotorAddress) \ + (This)->lpVtbl -> ReorderMotors(This,Address,SerialNo,OldMotorAddress) + +#define ISMIComm_InitCANOpen(This,MaxAddress) \ + (This)->lpVtbl -> InitCANOpen(This,MaxAddress) + +#define ISMIComm_DetectCANOpenMotors(This,MaxAddress,Flags,ErrorCode) \ + (This)->lpVtbl -> DetectCANOpenMotors(This,MaxAddress,Flags,ErrorCode) + +#define ISMIComm_ReadCharacters(This,NoOfBytes,pData) \ + (This)->lpVtbl -> ReadCharacters(This,NoOfBytes,pData) + +#define ISMIComm_get_DelayEchoOff(This,pVal) \ + (This)->lpVtbl -> get_DelayEchoOff(This,pVal) + +#define ISMIComm_put_DelayEchoOff(This,newVal) \ + (This)->lpVtbl -> put_DelayEchoOff(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_OpenPort_Proxy( + ISMIComm * This, + BSTR PortName); + + +void __RPC_STUB ISMIComm_OpenPort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ClosePort_Proxy( + ISMIComm * This); + + +void __RPC_STUB ISMIComm_ClosePort_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_PortHandle_Proxy( + ISMIComm * This, + /* [retval][out] */ long **pVal); + + +void __RPC_STUB ISMIComm_get_PortHandle_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ClearBuffer_Proxy( + ISMIComm * This); + + +void __RPC_STUB ISMIComm_ClearBuffer_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_BytesAvailable_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_BytesAvailable_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_WriteCommand_Proxy( + ISMIComm * This, + /* [string][in] */ BSTR Command); + + +void __RPC_STUB ISMIComm_WriteCommand_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_WriteString_Proxy( + ISMIComm * This, + /* [string][in] */ BSTR Data); + + +void __RPC_STUB ISMIComm_WriteString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ReadResponse_Proxy( + ISMIComm * This, + /* [string][retval][out] */ BSTR *Response); + + +void __RPC_STUB ISMIComm_ReadResponse_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ReadString_Proxy( + ISMIComm * This, + /* [in] */ long NoOfBytes, + /* [string][retval][out] */ BSTR *Data); + + +void __RPC_STUB ISMIComm_ReadString_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_EstablishChain_Proxy( + ISMIComm * This); + + +void __RPC_STUB ISMIComm_EstablishChain_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_AddressMotorChain_Proxy( + ISMIComm * This, + /* [retval][out] */ long *MotorCount); + + +void __RPC_STUB ISMIComm_AddressMotorChain_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_Wait_Proxy( + ISMIComm * This, + /* [in] */ long Time); + + +void __RPC_STUB ISMIComm_Wait_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_DefaultMotor_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_DefaultMotor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_DefaultMotor_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_DefaultMotor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_Echo_Proxy( + ISMIComm * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIComm_get_Echo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_Echo_Proxy( + ISMIComm * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMIComm_put_Echo_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_Parity_Proxy( + ISMIComm * This, + /* [retval][out] */ enum_parity *pVal); + + +void __RPC_STUB ISMIComm_get_Parity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_Parity_Proxy( + ISMIComm * This, + /* [in] */ enum_parity newVal); + + +void __RPC_STUB ISMIComm_put_Parity_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_BaudRate_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_BaudRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_BaudRate_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_BaudRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_Timeout_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_Timeout_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_Timeout_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_Timeout_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_CharDelay_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_CharDelay_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_CharDelay_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_CharDelay_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_PortName_Proxy( + ISMIComm * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB ISMIComm_get_PortName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_GetResponseOf_Proxy( + ISMIComm * This, + /* [string][in] */ BSTR Command, + /* [string][retval][out] */ BSTR *Response); + + +void __RPC_STUB ISMIComm_GetResponseOf_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_GetMotor_Proxy( + ISMIComm * This, + /* [in] */ long Address, + /* [retval][out] */ ISMIMotor **ppMotor); + + +void __RPC_STUB ISMIComm_GetMotor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_MaxMotors_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_MaxMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_MaxMotors_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_MaxMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_Download_Proxy( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIComm_Download_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_Upload_Proxy( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIComm_Upload_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ForceUpload_Proxy( + ISMIComm * This, + /* [in] */ long Motor, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIComm_ForceUpload_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_IsRS485_Proxy( + ISMIComm * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIComm_get_IsRS485_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_IsRS485_Proxy( + ISMIComm * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMIComm_put_IsRS485_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ClearEEPROM_Proxy( + ISMIComm * This, + /* [in] */ long Motor); + + +void __RPC_STUB ISMIComm_ClearEEPROM_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_InitializeNotification_Proxy( + ISMIComm * This, + /* [in] */ long hWindow, + /* [in] */ long message); + + +void __RPC_STUB ISMIComm_InitializeNotification_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_WriteCmd_Proxy( + ISMIComm * This, + /* [string][in] */ BSTR Command); + + +void __RPC_STUB ISMIComm_WriteCmd_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_InitRS485_Proxy( + ISMIComm * This, + /* [in] */ long NoOfMotors, + /* [in] */ long MotorChannel); + + +void __RPC_STUB ISMIComm_InitRS485_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_TxMaxRetry_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_TxMaxRetry_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_TxMaxRetry_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_TxMaxRetry_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_TxTimeoutMul_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_TxTimeoutMul_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_TxTimeoutMul_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_TxTimeoutMul_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_TxTimeoutConst_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_TxTimeoutConst_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_TxTimeoutConst_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_TxTimeoutConst_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_LogFlags_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_LogFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_LogFlags_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_LogFlags_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_LogFileName_Proxy( + ISMIComm * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB ISMIComm_get_LogFileName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_LogFileName_Proxy( + ISMIComm * This, + /* [in] */ BSTR newVal); + + +void __RPC_STUB ISMIComm_put_LogFileName_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_EchoTimeoutMul_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_EchoTimeoutMul_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_EchoTimeoutMul_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_EchoTimeoutMul_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_EchoTimeoutConst_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_EchoTimeoutConst_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_EchoTimeoutConst_Proxy( + ISMIComm * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIComm_put_EchoTimeoutConst_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_DetectRS232_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_DetectRS232_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_DetectRS485_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long MotorChannel, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_DetectRS485_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_AddressServos_Proxy( + ISMIComm * This, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_AddressServos_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_NoOfMotors_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_NoOfMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_EngineVersion_Proxy( + ISMIComm * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIComm_get_EngineVersion_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_InitEthernet_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress); + + +void __RPC_STUB ISMIComm_InitEthernet_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_DetectNetMotors_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_DetectNetMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_AddNetMotor_Proxy( + ISMIComm * This, + /* [string][in] */ BSTR IPAddress, + /* [retval][out] */ long *MotorAddress); + + +void __RPC_STUB ISMIComm_AddNetMotor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_InitUSB_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress); + + +void __RPC_STUB ISMIComm_InitUSB_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_DetectUSBMotors_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_DetectUSBMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ReorderMotors_Proxy( + ISMIComm * This, + /* [in] */ long Address, + /* [string][in] */ BSTR SerialNo, + /* [retval][out] */ long *OldMotorAddress); + + +void __RPC_STUB ISMIComm_ReorderMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_InitCANOpen_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress); + + +void __RPC_STUB ISMIComm_InitCANOpen_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_DetectCANOpenMotors_Proxy( + ISMIComm * This, + /* [in] */ long MaxAddress, + /* [in] */ long Flags, + /* [retval][out] */ long *ErrorCode); + + +void __RPC_STUB ISMIComm_DetectCANOpenMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIComm_ReadCharacters_Proxy( + ISMIComm * This, + /* [in] */ LONG NoOfBytes, + /* [retval][out] */ BSTR *pData); + + +void __RPC_STUB ISMIComm_ReadCharacters_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIComm_get_DelayEchoOff_Proxy( + ISMIComm * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMIComm_get_DelayEchoOff_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIComm_put_DelayEchoOff_Proxy( + ISMIComm * This, + /* [in] */ LONG newVal); + + +void __RPC_STUB ISMIComm_put_DelayEchoOff_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMIComm_INTERFACE_DEFINED__ */ + + +#ifndef __ISMICMotion_INTERFACE_DEFINED__ +#define __ISMICMotion_INTERFACE_DEFINED__ + +/* interface ISMICMotion */ +/* [helpcontext][unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMICMotion; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BC26FBB9-00E1-11D4-B5D0-00600831E1F3") + ISMICMotion : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Initialize( + /* [in] */ long NoOfMotors) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WritePosition( + /* [in] */ long Motor, + /* [in] */ long Pos) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteClock( + /* [in] */ long Motor, + /* [in] */ long Clock) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SlotsNeeded( + /* [in] */ long Motor, + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_CurrentClock( + /* [in] */ long Motor, + /* [retval][out] */ ULONG *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CheckStatus( + /* [in] */ long Motor, + /* [retval][out] */ long *FreeSlots) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TrajectorySlots( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TrajectorySlots( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Buffered( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Buffered( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SampleRate( + /* [in] */ long nMotor, + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_PIDFactor( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_PIDFactor( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EndHostMode( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Run( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SyncMotors( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MotorSlots( + /* [retval][out] */ LONG *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE PauseHostMode( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_AtPausePoint( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteUserBits( + /* [in] */ long Motor, + /* [in] */ long UserBits) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE HostMotorAddress( + /* [in] */ LONG Motor_Index, + /* [in] */ LONG Motor_Address) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetHostType( + /* [in] */ LONG TypeCode) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EndHostModeStep( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WritePositionAndBits( + /* [in] */ LONG Motor, + /* [in] */ LONG Pos, + /* [in] */ LONG UserBits) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteSegmentTime( + /* [in] */ LONG Motor, + /* [in] */ LONG SegmentTime) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SyncMotorClocks( + /* [in] */ LONG Motor, + /* [in] */ ULONG MasterClock) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ReadMasterClock( + /* [in] */ LONG Motor, + /* [retval][out] */ ULONG *pMasterClock) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE WriteHostConfig( + /* [in] */ LONG Motor, + /* [in] */ LONG HostConfig) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE DisablePDOs( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE EnableFollowPDOs( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StopOnOverflow( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StopOnOverflow( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StopOnUnderflow( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StopOnUnderflow( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE TrapSlaveClock( + /* [in] */ LONG Motor) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_IsRunning( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMICMotionVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMICMotion * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMICMotion * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMICMotion * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMICMotion * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMICMotion * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMICMotion * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMICMotion * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Initialize )( + ISMICMotion * This, + /* [in] */ long NoOfMotors); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WritePosition )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long Pos); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteClock )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long Clock); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SlotsNeeded )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_CurrentClock )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ ULONG *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CheckStatus )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ long *FreeSlots); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TrajectorySlots )( + ISMICMotion * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TrajectorySlots )( + ISMICMotion * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Buffered )( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Buffered )( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SampleRate )( + ISMICMotion * This, + /* [in] */ long nMotor, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_PIDFactor )( + ISMICMotion * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_PIDFactor )( + ISMICMotion * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndHostMode )( + ISMICMotion * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Run )( + ISMICMotion * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SyncMotors )( + ISMICMotion * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MotorSlots )( + ISMICMotion * This, + /* [retval][out] */ LONG *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *PauseHostMode )( + ISMICMotion * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_AtPausePoint )( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteUserBits )( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long UserBits); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *HostMotorAddress )( + ISMICMotion * This, + /* [in] */ LONG Motor_Index, + /* [in] */ LONG Motor_Address); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetHostType )( + ISMICMotion * This, + /* [in] */ LONG TypeCode); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndHostModeStep )( + ISMICMotion * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WritePositionAndBits )( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG Pos, + /* [in] */ LONG UserBits); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteSegmentTime )( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG SegmentTime); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SyncMotorClocks )( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ ULONG MasterClock); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ReadMasterClock )( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [retval][out] */ ULONG *pMasterClock); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *WriteHostConfig )( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG HostConfig); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *DisablePDOs )( + ISMICMotion * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EnableFollowPDOs )( + ISMICMotion * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StopOnOverflow )( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StopOnOverflow )( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StopOnUnderflow )( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StopOnUnderflow )( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *TrapSlaveClock )( + ISMICMotion * This, + /* [in] */ LONG Motor); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsRunning )( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + END_INTERFACE + } ISMICMotionVtbl; + + interface ISMICMotion + { + CONST_VTBL struct ISMICMotionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMICMotion_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMICMotion_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMICMotion_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMICMotion_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMICMotion_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMICMotion_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMICMotion_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMICMotion_Initialize(This,NoOfMotors) \ + (This)->lpVtbl -> Initialize(This,NoOfMotors) + +#define ISMICMotion_WritePosition(This,Motor,Pos) \ + (This)->lpVtbl -> WritePosition(This,Motor,Pos) + +#define ISMICMotion_WriteClock(This,Motor,Clock) \ + (This)->lpVtbl -> WriteClock(This,Motor,Clock) + +#define ISMICMotion_get_SlotsNeeded(This,Motor,pVal) \ + (This)->lpVtbl -> get_SlotsNeeded(This,Motor,pVal) + +#define ISMICMotion_get_CurrentClock(This,Motor,pVal) \ + (This)->lpVtbl -> get_CurrentClock(This,Motor,pVal) + +#define ISMICMotion_CheckStatus(This,Motor,FreeSlots) \ + (This)->lpVtbl -> CheckStatus(This,Motor,FreeSlots) + +#define ISMICMotion_get_TrajectorySlots(This,pVal) \ + (This)->lpVtbl -> get_TrajectorySlots(This,pVal) + +#define ISMICMotion_put_TrajectorySlots(This,newVal) \ + (This)->lpVtbl -> put_TrajectorySlots(This,newVal) + +#define ISMICMotion_get_Buffered(This,pVal) \ + (This)->lpVtbl -> get_Buffered(This,pVal) + +#define ISMICMotion_put_Buffered(This,newVal) \ + (This)->lpVtbl -> put_Buffered(This,newVal) + +#define ISMICMotion_get_SampleRate(This,nMotor,pVal) \ + (This)->lpVtbl -> get_SampleRate(This,nMotor,pVal) + +#define ISMICMotion_get_PIDFactor(This,pVal) \ + (This)->lpVtbl -> get_PIDFactor(This,pVal) + +#define ISMICMotion_put_PIDFactor(This,newVal) \ + (This)->lpVtbl -> put_PIDFactor(This,newVal) + +#define ISMICMotion_EndHostMode(This) \ + (This)->lpVtbl -> EndHostMode(This) + +#define ISMICMotion_Run(This) \ + (This)->lpVtbl -> Run(This) + +#define ISMICMotion_SyncMotors(This) \ + (This)->lpVtbl -> SyncMotors(This) + +#define ISMICMotion_get_MotorSlots(This,pVal) \ + (This)->lpVtbl -> get_MotorSlots(This,pVal) + +#define ISMICMotion_PauseHostMode(This) \ + (This)->lpVtbl -> PauseHostMode(This) + +#define ISMICMotion_get_AtPausePoint(This,pVal) \ + (This)->lpVtbl -> get_AtPausePoint(This,pVal) + +#define ISMICMotion_WriteUserBits(This,Motor,UserBits) \ + (This)->lpVtbl -> WriteUserBits(This,Motor,UserBits) + +#define ISMICMotion_HostMotorAddress(This,Motor_Index,Motor_Address) \ + (This)->lpVtbl -> HostMotorAddress(This,Motor_Index,Motor_Address) + +#define ISMICMotion_SetHostType(This,TypeCode) \ + (This)->lpVtbl -> SetHostType(This,TypeCode) + +#define ISMICMotion_EndHostModeStep(This) \ + (This)->lpVtbl -> EndHostModeStep(This) + +#define ISMICMotion_WritePositionAndBits(This,Motor,Pos,UserBits) \ + (This)->lpVtbl -> WritePositionAndBits(This,Motor,Pos,UserBits) + +#define ISMICMotion_WriteSegmentTime(This,Motor,SegmentTime) \ + (This)->lpVtbl -> WriteSegmentTime(This,Motor,SegmentTime) + +#define ISMICMotion_SyncMotorClocks(This,Motor,MasterClock) \ + (This)->lpVtbl -> SyncMotorClocks(This,Motor,MasterClock) + +#define ISMICMotion_ReadMasterClock(This,Motor,pMasterClock) \ + (This)->lpVtbl -> ReadMasterClock(This,Motor,pMasterClock) + +#define ISMICMotion_WriteHostConfig(This,Motor,HostConfig) \ + (This)->lpVtbl -> WriteHostConfig(This,Motor,HostConfig) + +#define ISMICMotion_DisablePDOs(This) \ + (This)->lpVtbl -> DisablePDOs(This) + +#define ISMICMotion_EnableFollowPDOs(This) \ + (This)->lpVtbl -> EnableFollowPDOs(This) + +#define ISMICMotion_get_StopOnOverflow(This,pVal) \ + (This)->lpVtbl -> get_StopOnOverflow(This,pVal) + +#define ISMICMotion_put_StopOnOverflow(This,newVal) \ + (This)->lpVtbl -> put_StopOnOverflow(This,newVal) + +#define ISMICMotion_get_StopOnUnderflow(This,pVal) \ + (This)->lpVtbl -> get_StopOnUnderflow(This,pVal) + +#define ISMICMotion_put_StopOnUnderflow(This,newVal) \ + (This)->lpVtbl -> put_StopOnUnderflow(This,newVal) + +#define ISMICMotion_TrapSlaveClock(This,Motor) \ + (This)->lpVtbl -> TrapSlaveClock(This,Motor) + +#define ISMICMotion_get_IsRunning(This,pVal) \ + (This)->lpVtbl -> get_IsRunning(This,pVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_Initialize_Proxy( + ISMICMotion * This, + /* [in] */ long NoOfMotors); + + +void __RPC_STUB ISMICMotion_Initialize_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WritePosition_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long Pos); + + +void __RPC_STUB ISMICMotion_WritePosition_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WriteClock_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long Clock); + + +void __RPC_STUB ISMICMotion_WriteClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_SlotsNeeded_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMICMotion_get_SlotsNeeded_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_CurrentClock_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ ULONG *pVal); + + +void __RPC_STUB ISMICMotion_get_CurrentClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_CheckStatus_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [retval][out] */ long *FreeSlots); + + +void __RPC_STUB ISMICMotion_CheckStatus_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_TrajectorySlots_Proxy( + ISMICMotion * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMICMotion_get_TrajectorySlots_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMICMotion_put_TrajectorySlots_Proxy( + ISMICMotion * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMICMotion_put_TrajectorySlots_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_Buffered_Proxy( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMICMotion_get_Buffered_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMICMotion_put_Buffered_Proxy( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMICMotion_put_Buffered_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_SampleRate_Proxy( + ISMICMotion * This, + /* [in] */ long nMotor, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMICMotion_get_SampleRate_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_PIDFactor_Proxy( + ISMICMotion * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMICMotion_get_PIDFactor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMICMotion_put_PIDFactor_Proxy( + ISMICMotion * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMICMotion_put_PIDFactor_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_EndHostMode_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_EndHostMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_Run_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_Run_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_SyncMotors_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_SyncMotors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_MotorSlots_Proxy( + ISMICMotion * This, + /* [retval][out] */ LONG *pVal); + + +void __RPC_STUB ISMICMotion_get_MotorSlots_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_PauseHostMode_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_PauseHostMode_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_AtPausePoint_Proxy( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMICMotion_get_AtPausePoint_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WriteUserBits_Proxy( + ISMICMotion * This, + /* [in] */ long Motor, + /* [in] */ long UserBits); + + +void __RPC_STUB ISMICMotion_WriteUserBits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_HostMotorAddress_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor_Index, + /* [in] */ LONG Motor_Address); + + +void __RPC_STUB ISMICMotion_HostMotorAddress_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_SetHostType_Proxy( + ISMICMotion * This, + /* [in] */ LONG TypeCode); + + +void __RPC_STUB ISMICMotion_SetHostType_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_EndHostModeStep_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_EndHostModeStep_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WritePositionAndBits_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG Pos, + /* [in] */ LONG UserBits); + + +void __RPC_STUB ISMICMotion_WritePositionAndBits_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WriteSegmentTime_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG SegmentTime); + + +void __RPC_STUB ISMICMotion_WriteSegmentTime_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_SyncMotorClocks_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ ULONG MasterClock); + + +void __RPC_STUB ISMICMotion_SyncMotorClocks_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_ReadMasterClock_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [retval][out] */ ULONG *pMasterClock); + + +void __RPC_STUB ISMICMotion_ReadMasterClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_WriteHostConfig_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor, + /* [in] */ LONG HostConfig); + + +void __RPC_STUB ISMICMotion_WriteHostConfig_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_DisablePDOs_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_DisablePDOs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_EnableFollowPDOs_Proxy( + ISMICMotion * This); + + +void __RPC_STUB ISMICMotion_EnableFollowPDOs_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_StopOnOverflow_Proxy( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMICMotion_get_StopOnOverflow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMICMotion_put_StopOnOverflow_Proxy( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMICMotion_put_StopOnOverflow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_StopOnUnderflow_Proxy( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMICMotion_get_StopOnUnderflow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMICMotion_put_StopOnUnderflow_Proxy( + ISMICMotion * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMICMotion_put_StopOnUnderflow_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMICMotion_TrapSlaveClock_Proxy( + ISMICMotion * This, + /* [in] */ LONG Motor); + + +void __RPC_STUB ISMICMotion_TrapSlaveClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMICMotion_get_IsRunning_Proxy( + ISMICMotion * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMICMotion_get_IsRunning_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMICMotion_INTERFACE_DEFINED__ */ + + +#ifndef __ISMIPath_INTERFACE_DEFINED__ +#define __ISMIPath_INTERFACE_DEFINED__ + +/* interface ISMIPath */ +/* [helpcontext][unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMIPath; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("B998E60D-DB45-4b64-A149-CC7BD21311DE") + ISMIPath : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_EndSpeed( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_EndSpeed( + /* [in] */ double newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Acceleration( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Acceleration( + /* [in] */ double newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StartPoint( + /* [in] */ int Axis, + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StartPoint( + /* [in] */ int Axis, + /* [in] */ double newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StartClock( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StartClock( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_SlowToEndSpeed( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_SlowToEndSpeed( + /* [in] */ VARIANT_BOOL newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetupTimeDelta( + /* [in] */ long AveTimeDelta, + /* [defaultvalue][in] */ long MinTimeDelta = -1, + /* [defaultvalue][in] */ long AllowedCount = -1, + /* [defaultvalue][in] */ long PrecedeCount = -1) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GeneratePath( + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GenerateLinePath( + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GenerateArcPath( + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_StartSpeed( + /* [retval][out] */ double *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_StartSpeed( + /* [in] */ double newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_TimeDelta( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_TimeDelta( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Plane( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Plane( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreatePath( + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateLinePath( + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE CreateArcPath( + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMIPathVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMIPath * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMIPath * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMIPath * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMIPath * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMIPath * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMIPath * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMIPath * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_EndSpeed )( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_EndSpeed )( + ISMIPath * This, + /* [in] */ double newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Acceleration )( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Acceleration )( + ISMIPath * This, + /* [in] */ double newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StartPoint )( + ISMIPath * This, + /* [in] */ int Axis, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StartPoint )( + ISMIPath * This, + /* [in] */ int Axis, + /* [in] */ double newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StartClock )( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StartClock )( + ISMIPath * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_SlowToEndSpeed )( + ISMIPath * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_SlowToEndSpeed )( + ISMIPath * This, + /* [in] */ VARIANT_BOOL newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *SetupTimeDelta )( + ISMIPath * This, + /* [in] */ long AveTimeDelta, + /* [defaultvalue][in] */ long MinTimeDelta, + /* [defaultvalue][in] */ long AllowedCount, + /* [defaultvalue][in] */ long PrecedeCount); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GeneratePath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GenerateLinePath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GenerateArcPath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_StartSpeed )( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_StartSpeed )( + ISMIPath * This, + /* [in] */ double newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_TimeDelta )( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_TimeDelta )( + ISMIPath * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Plane )( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Plane )( + ISMIPath * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreatePath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateLinePath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *CreateArcPath )( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs); + + END_INTERFACE + } ISMIPathVtbl; + + interface ISMIPath + { + CONST_VTBL struct ISMIPathVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMIPath_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMIPath_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMIPath_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMIPath_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMIPath_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMIPath_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMIPath_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMIPath_get_EndSpeed(This,pVal) \ + (This)->lpVtbl -> get_EndSpeed(This,pVal) + +#define ISMIPath_put_EndSpeed(This,newVal) \ + (This)->lpVtbl -> put_EndSpeed(This,newVal) + +#define ISMIPath_get_Acceleration(This,pVal) \ + (This)->lpVtbl -> get_Acceleration(This,pVal) + +#define ISMIPath_put_Acceleration(This,newVal) \ + (This)->lpVtbl -> put_Acceleration(This,newVal) + +#define ISMIPath_get_StartPoint(This,Axis,pVal) \ + (This)->lpVtbl -> get_StartPoint(This,Axis,pVal) + +#define ISMIPath_put_StartPoint(This,Axis,newVal) \ + (This)->lpVtbl -> put_StartPoint(This,Axis,newVal) + +#define ISMIPath_get_StartClock(This,pVal) \ + (This)->lpVtbl -> get_StartClock(This,pVal) + +#define ISMIPath_put_StartClock(This,newVal) \ + (This)->lpVtbl -> put_StartClock(This,newVal) + +#define ISMIPath_get_SlowToEndSpeed(This,pVal) \ + (This)->lpVtbl -> get_SlowToEndSpeed(This,pVal) + +#define ISMIPath_put_SlowToEndSpeed(This,newVal) \ + (This)->lpVtbl -> put_SlowToEndSpeed(This,newVal) + +#define ISMIPath_SetupTimeDelta(This,AveTimeDelta,MinTimeDelta,AllowedCount,PrecedeCount) \ + (This)->lpVtbl -> SetupTimeDelta(This,AveTimeDelta,MinTimeDelta,AllowedCount,PrecedeCount) + +#define ISMIPath_GeneratePath(This,MaxSpeed,TotalLength,DataPairs) \ + (This)->lpVtbl -> GeneratePath(This,MaxSpeed,TotalLength,DataPairs) + +#define ISMIPath_GenerateLinePath(This,MaxSpeed,Endpoint,DataPairs) \ + (This)->lpVtbl -> GenerateLinePath(This,MaxSpeed,Endpoint,DataPairs) + +#define ISMIPath_GenerateArcPath(This,MaxSpeed,Endpoint,Center,ArcDirection,DataPairs) \ + (This)->lpVtbl -> GenerateArcPath(This,MaxSpeed,Endpoint,Center,ArcDirection,DataPairs) + +#define ISMIPath_get_StartSpeed(This,pVal) \ + (This)->lpVtbl -> get_StartSpeed(This,pVal) + +#define ISMIPath_put_StartSpeed(This,newVal) \ + (This)->lpVtbl -> put_StartSpeed(This,newVal) + +#define ISMIPath_get_TimeDelta(This,pVal) \ + (This)->lpVtbl -> get_TimeDelta(This,pVal) + +#define ISMIPath_put_TimeDelta(This,newVal) \ + (This)->lpVtbl -> put_TimeDelta(This,newVal) + +#define ISMIPath_get_Plane(This,pVal) \ + (This)->lpVtbl -> get_Plane(This,pVal) + +#define ISMIPath_put_Plane(This,newVal) \ + (This)->lpVtbl -> put_Plane(This,newVal) + +#define ISMIPath_CreatePath(This,MaxSpeed,TotalLength,DataPairs) \ + (This)->lpVtbl -> CreatePath(This,MaxSpeed,TotalLength,DataPairs) + +#define ISMIPath_CreateLinePath(This,MaxSpeed,Endpoint,DataPairs) \ + (This)->lpVtbl -> CreateLinePath(This,MaxSpeed,Endpoint,DataPairs) + +#define ISMIPath_CreateArcPath(This,MaxSpeed,Endpoint,Center,ArcDirection,DataPairs) \ + (This)->lpVtbl -> CreateArcPath(This,MaxSpeed,Endpoint,Center,ArcDirection,DataPairs) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_EndSpeed_Proxy( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMIPath_get_EndSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_EndSpeed_Proxy( + ISMIPath * This, + /* [in] */ double newVal); + + +void __RPC_STUB ISMIPath_put_EndSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_Acceleration_Proxy( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMIPath_get_Acceleration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_Acceleration_Proxy( + ISMIPath * This, + /* [in] */ double newVal); + + +void __RPC_STUB ISMIPath_put_Acceleration_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_StartPoint_Proxy( + ISMIPath * This, + /* [in] */ int Axis, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMIPath_get_StartPoint_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_StartPoint_Proxy( + ISMIPath * This, + /* [in] */ int Axis, + /* [in] */ double newVal); + + +void __RPC_STUB ISMIPath_put_StartPoint_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_StartClock_Proxy( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIPath_get_StartClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_StartClock_Proxy( + ISMIPath * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIPath_put_StartClock_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_SlowToEndSpeed_Proxy( + ISMIPath * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIPath_get_SlowToEndSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_SlowToEndSpeed_Proxy( + ISMIPath * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMIPath_put_SlowToEndSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_SetupTimeDelta_Proxy( + ISMIPath * This, + /* [in] */ long AveTimeDelta, + /* [defaultvalue][in] */ long MinTimeDelta, + /* [defaultvalue][in] */ long AllowedCount, + /* [defaultvalue][in] */ long PrecedeCount); + + +void __RPC_STUB ISMIPath_SetupTimeDelta_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_GeneratePath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_GeneratePath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_GenerateLinePath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_GenerateLinePath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_GenerateArcPath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_GenerateArcPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_StartSpeed_Proxy( + ISMIPath * This, + /* [retval][out] */ double *pVal); + + +void __RPC_STUB ISMIPath_get_StartSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_StartSpeed_Proxy( + ISMIPath * This, + /* [in] */ double newVal); + + +void __RPC_STUB ISMIPath_put_StartSpeed_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_TimeDelta_Proxy( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIPath_get_TimeDelta_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_TimeDelta_Proxy( + ISMIPath * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIPath_put_TimeDelta_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIPath_get_Plane_Proxy( + ISMIPath * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIPath_get_Plane_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIPath_put_Plane_Proxy( + ISMIPath * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIPath_put_Plane_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_CreatePath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ double TotalLength, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_CreatePath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_CreateLinePath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_CreateLinePath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIPath_CreateArcPath_Proxy( + ISMIPath * This, + /* [in] */ double MaxSpeed, + /* [in] */ VARIANT Endpoint, + /* [in] */ VARIANT Center, + /* [in] */ enum_arcdirection ArcDirection, + /* [retval][out] */ VARIANT *DataPairs); + + +void __RPC_STUB ISMIPath_CreateArcPath_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMIPath_INTERFACE_DEFINED__ */ + + +#ifndef __ISMIScan_INTERFACE_DEFINED__ +#define __ISMIScan_INTERFACE_DEFINED__ + +/* interface ISMIScan */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMIScan; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("124D89B8-26B4-42A9-B988-C2A38D57CAED") + ISMIScan : public IDispatch + { + public: + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Scan( + /* [in] */ BSTR Program) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ScanFile( + /* [in] */ BSTR FileName) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MakeSMX( + /* [in] */ BSTR FileName, + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MakeSMX2( + /* [in] */ BSTR FileName, + /* [in] */ BSTR SMXFileName, + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_LanguageFile( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_LanguageFile( + /* [in] */ BSTR newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Errors2Warnings( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_Errors2Warnings( + /* [in] */ VARIANT_BOOL newVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMIScanVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMIScan * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMIScan * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMIScan * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMIScan * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMIScan * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMIScan * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMIScan * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Scan )( + ISMIScan * This, + /* [in] */ BSTR Program); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *ScanFile )( + ISMIScan * This, + /* [in] */ BSTR FileName); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *MakeSMX )( + ISMIScan * This, + /* [in] */ BSTR FileName, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *MakeSMX2 )( + ISMIScan * This, + /* [in] */ BSTR FileName, + /* [in] */ BSTR SMXFileName, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_LanguageFile )( + ISMIScan * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_LanguageFile )( + ISMIScan * This, + /* [in] */ BSTR newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Errors2Warnings )( + ISMIScan * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_Errors2Warnings )( + ISMIScan * This, + /* [in] */ VARIANT_BOOL newVal); + + END_INTERFACE + } ISMIScanVtbl; + + interface ISMIScan + { + CONST_VTBL struct ISMIScanVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMIScan_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMIScan_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMIScan_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMIScan_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMIScan_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMIScan_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMIScan_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMIScan_Scan(This,Program) \ + (This)->lpVtbl -> Scan(This,Program) + +#define ISMIScan_ScanFile(This,FileName) \ + (This)->lpVtbl -> ScanFile(This,FileName) + +#define ISMIScan_MakeSMX(This,FileName,pVal) \ + (This)->lpVtbl -> MakeSMX(This,FileName,pVal) + +#define ISMIScan_MakeSMX2(This,FileName,SMXFileName,pVal) \ + (This)->lpVtbl -> MakeSMX2(This,FileName,SMXFileName,pVal) + +#define ISMIScan_get_LanguageFile(This,pVal) \ + (This)->lpVtbl -> get_LanguageFile(This,pVal) + +#define ISMIScan_put_LanguageFile(This,newVal) \ + (This)->lpVtbl -> put_LanguageFile(This,newVal) + +#define ISMIScan_get_Errors2Warnings(This,pVal) \ + (This)->lpVtbl -> get_Errors2Warnings(This,pVal) + +#define ISMIScan_put_Errors2Warnings(This,newVal) \ + (This)->lpVtbl -> put_Errors2Warnings(This,newVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIScan_Scan_Proxy( + ISMIScan * This, + /* [in] */ BSTR Program); + + +void __RPC_STUB ISMIScan_Scan_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIScan_ScanFile_Proxy( + ISMIScan * This, + /* [in] */ BSTR FileName); + + +void __RPC_STUB ISMIScan_ScanFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIScan_MakeSMX_Proxy( + ISMIScan * This, + /* [in] */ BSTR FileName, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIScan_MakeSMX_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIScan_MakeSMX2_Proxy( + ISMIScan * This, + /* [in] */ BSTR FileName, + /* [in] */ BSTR SMXFileName, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIScan_MakeSMX2_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIScan_get_LanguageFile_Proxy( + ISMIScan * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB ISMIScan_get_LanguageFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIScan_put_LanguageFile_Proxy( + ISMIScan * This, + /* [in] */ BSTR newVal); + + +void __RPC_STUB ISMIScan_put_LanguageFile_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIScan_get_Errors2Warnings_Proxy( + ISMIScan * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIScan_get_Errors2Warnings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIScan_put_Errors2Warnings_Proxy( + ISMIScan * This, + /* [in] */ VARIANT_BOOL newVal); + + +void __RPC_STUB ISMIScan_put_Errors2Warnings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMIScan_INTERFACE_DEFINED__ */ + + +#ifndef __ISMIErrors_INTERFACE_DEFINED__ +#define __ISMIErrors_INTERFACE_DEFINED__ + +/* interface ISMIErrors */ +/* [unique][helpstring][dual][uuid][object] */ + + +EXTERN_C const IID IID_ISMIErrors; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D1B5EE00-2230-44e3-878A-55263DA82E3D") + ISMIErrors : public IDispatch + { + public: + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NoOfWarnings( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_NoOfErrors( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxErrors( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxErrors( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_MaxWarnings( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE put_MaxWarnings( + /* [in] */ long newVal) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GoFirst( void) = 0; + + virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE GoNext( void) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Description( + /* [retval][out] */ BSTR *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Code( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Line( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_Column( + /* [retval][out] */ long *pVal) = 0; + + virtual /* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE get_IsWarning( + /* [retval][out] */ VARIANT_BOOL *pVal) = 0; + + }; + +#else /* C style interface */ + + typedef struct ISMIErrorsVtbl + { + BEGIN_INTERFACE + + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ISMIErrors * This, + /* [in] */ REFIID riid, + /* [iid_is][out] */ void **ppvObject); + + ULONG ( STDMETHODCALLTYPE *AddRef )( + ISMIErrors * This); + + ULONG ( STDMETHODCALLTYPE *Release )( + ISMIErrors * This); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( + ISMIErrors * This, + /* [out] */ UINT *pctinfo); + + HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( + ISMIErrors * This, + /* [in] */ UINT iTInfo, + /* [in] */ LCID lcid, + /* [out] */ ITypeInfo **ppTInfo); + + HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( + ISMIErrors * This, + /* [in] */ REFIID riid, + /* [size_is][in] */ LPOLESTR *rgszNames, + /* [in] */ UINT cNames, + /* [in] */ LCID lcid, + /* [size_is][out] */ DISPID *rgDispId); + + /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( + ISMIErrors * This, + /* [in] */ DISPID dispIdMember, + /* [in] */ REFIID riid, + /* [in] */ LCID lcid, + /* [in] */ WORD wFlags, + /* [out][in] */ DISPPARAMS *pDispParams, + /* [out] */ VARIANT *pVarResult, + /* [out] */ EXCEPINFO *pExcepInfo, + /* [out] */ UINT *puArgErr); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NoOfWarnings )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_NoOfErrors )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxErrors )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxErrors )( + ISMIErrors * This, + /* [in] */ long newVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_MaxWarnings )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_MaxWarnings )( + ISMIErrors * This, + /* [in] */ long newVal); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GoFirst )( + ISMIErrors * This); + + /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *GoNext )( + ISMIErrors * This); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Description )( + ISMIErrors * This, + /* [retval][out] */ BSTR *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Code )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Line )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_Column )( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + /* [helpstring][id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_IsWarning )( + ISMIErrors * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + END_INTERFACE + } ISMIErrorsVtbl; + + interface ISMIErrors + { + CONST_VTBL struct ISMIErrorsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ISMIErrors_QueryInterface(This,riid,ppvObject) \ + (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) + +#define ISMIErrors_AddRef(This) \ + (This)->lpVtbl -> AddRef(This) + +#define ISMIErrors_Release(This) \ + (This)->lpVtbl -> Release(This) + + +#define ISMIErrors_GetTypeInfoCount(This,pctinfo) \ + (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) + +#define ISMIErrors_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ + (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) + +#define ISMIErrors_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ + (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) + +#define ISMIErrors_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ + (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) + + +#define ISMIErrors_get_NoOfWarnings(This,pVal) \ + (This)->lpVtbl -> get_NoOfWarnings(This,pVal) + +#define ISMIErrors_get_NoOfErrors(This,pVal) \ + (This)->lpVtbl -> get_NoOfErrors(This,pVal) + +#define ISMIErrors_get_MaxErrors(This,pVal) \ + (This)->lpVtbl -> get_MaxErrors(This,pVal) + +#define ISMIErrors_put_MaxErrors(This,newVal) \ + (This)->lpVtbl -> put_MaxErrors(This,newVal) + +#define ISMIErrors_get_MaxWarnings(This,pVal) \ + (This)->lpVtbl -> get_MaxWarnings(This,pVal) + +#define ISMIErrors_put_MaxWarnings(This,newVal) \ + (This)->lpVtbl -> put_MaxWarnings(This,newVal) + +#define ISMIErrors_GoFirst(This) \ + (This)->lpVtbl -> GoFirst(This) + +#define ISMIErrors_GoNext(This) \ + (This)->lpVtbl -> GoNext(This) + +#define ISMIErrors_get_Description(This,pVal) \ + (This)->lpVtbl -> get_Description(This,pVal) + +#define ISMIErrors_get_Code(This,pVal) \ + (This)->lpVtbl -> get_Code(This,pVal) + +#define ISMIErrors_get_Line(This,pVal) \ + (This)->lpVtbl -> get_Line(This,pVal) + +#define ISMIErrors_get_Column(This,pVal) \ + (This)->lpVtbl -> get_Column(This,pVal) + +#define ISMIErrors_get_IsWarning(This,pVal) \ + (This)->lpVtbl -> get_IsWarning(This,pVal) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_NoOfWarnings_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_NoOfWarnings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_NoOfErrors_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_NoOfErrors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_MaxErrors_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_MaxErrors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIErrors_put_MaxErrors_Proxy( + ISMIErrors * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIErrors_put_MaxErrors_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_MaxWarnings_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_MaxWarnings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propput] */ HRESULT STDMETHODCALLTYPE ISMIErrors_put_MaxWarnings_Proxy( + ISMIErrors * This, + /* [in] */ long newVal); + + +void __RPC_STUB ISMIErrors_put_MaxWarnings_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIErrors_GoFirst_Proxy( + ISMIErrors * This); + + +void __RPC_STUB ISMIErrors_GoFirst_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id] */ HRESULT STDMETHODCALLTYPE ISMIErrors_GoNext_Proxy( + ISMIErrors * This); + + +void __RPC_STUB ISMIErrors_GoNext_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_Description_Proxy( + ISMIErrors * This, + /* [retval][out] */ BSTR *pVal); + + +void __RPC_STUB ISMIErrors_get_Description_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_Code_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_Code_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_Line_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_Line_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_Column_Proxy( + ISMIErrors * This, + /* [retval][out] */ long *pVal); + + +void __RPC_STUB ISMIErrors_get_Column_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + +/* [helpstring][id][propget] */ HRESULT STDMETHODCALLTYPE ISMIErrors_get_IsWarning_Proxy( + ISMIErrors * This, + /* [retval][out] */ VARIANT_BOOL *pVal); + + +void __RPC_STUB ISMIErrors_get_IsWarning_Stub( + IRpcStubBuffer *This, + IRpcChannelBuffer *_pRpcChannelBuffer, + PRPC_MESSAGE _pRpcMessage, + DWORD *_pdwStubPhase); + + + +#endif /* __ISMIErrors_INTERFACE_DEFINED__ */ + + + +#ifndef __INTEGMOTORINTERFACELib_LIBRARY_DEFINED__ +#define __INTEGMOTORINTERFACELib_LIBRARY_DEFINED__ + +/* library INTEGMOTORINTERFACELib */ +/* [helpstring][version][uuid] */ + + +EXTERN_C const IID LIBID_INTEGMOTORINTERFACELib; + +EXTERN_C const CLSID CLSID_SMIHost; + +#ifdef __cplusplus + +class DECLSPEC_UUID("BC26FBBA-00E1-11D4-B5D0-00600831E1F3") +SMIHost; +#endif + +EXTERN_C const CLSID CLSID_SMIMotor; + +#ifdef __cplusplus + +class DECLSPEC_UUID("D3A8EE8B-CAEF-40B6-8FD1-D43D498FE3A0") +SMIMotor; +#endif + +EXTERN_C const CLSID CLSID_SMIScan; + +#ifdef __cplusplus + +class DECLSPEC_UUID("86DF7FB1-BE6A-40DB-85CC-DF71511EC21A") +SMIScan; +#endif +#endif /* __INTEGMOTORINTERFACELib_LIBRARY_DEFINED__ */ + +/* Additional Prototypes for ALL interfaces */ + +unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * ); +unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * ); +unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * ); +void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * ); + +unsigned long __RPC_USER VARIANT_UserSize( unsigned long *, unsigned long , VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserMarshal( unsigned long *, unsigned char *, VARIANT * ); +unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT * ); +void __RPC_USER VARIANT_UserFree( unsigned long *, VARIANT * ); + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.tlb b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.tlb new file mode 100644 index 0000000..8c5fad0 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/IntegMotorInterface.tlb differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Animatics/SMIDefs.h b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/SMIDefs.h new file mode 100644 index 0000000..2a87c1f --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Animatics/SMIDefs.h @@ -0,0 +1,289 @@ +// ************************************************************************************************ +// * File : SMIDefs.h +// * Project : IntegMotorInterface +// * Version : 2.201 +// * Last Update : 12/16/2009 +// * Copyright ?2000-2009 Animatics Corp. +// * Author : +// ************************************************************************************************ +#ifndef __SMIDEFS_H_ +#define __SMIDEFS_H_ + +#define MAX_STRLEN 256 +#define MAX_HOST_AXIS 6 +#define PI ((double)3.14159265358979323846) +#define EPSILON 0.0000000001 + +#define MAX_PRG_LENGTH 0x00007FFF +#define MAX_PRG_LENGTH9 0x0000FFFE +#define MAX_PRG_LENGTH6 0x0000FA96 + + +// ************************************************************************************************ +// *** CommError and Motor Detection Return Values: +// ************************************************************************************************ +#define CER_SUCCESS 0x00000001 // Motors Found (=CER_MOTORSFOUND) +#define CER_MOTORSFOUND 0x00000001 // Motors Found (=CER_SUCCESS) +#define CER_SOMEADDRESSED 0x00000002 // Some Motors are addressed +#define CER_BIGADDRESS 0x00000004 // The address of some motors is bigger than the specified MaxAddress +#define CER_DUPLICATEADDR 0x00000008 // Duplicate address +#define CER_NOTADDRESSED 0x00000010 // No motor is addressed +#define CER_COMMERROR 0x00000020 // Other communication problem +#define CER_NOMOTOR 0x00000040 // Failed to find motors +#define CER_NETERROR 0x00000080 // Network error +#define CER_USBERROR 0x00000100 // USB error +#define CER_CANOPENERROR 0x00000200 // CANOpen error +#define CER_TRYHIGHBAUD 0x00000400 // no motors found at lower baud rates try higher rates + +#define CER_PORTNOTOPEN 0x00010000 // Port Not Open +#define CER_CANCELED 0x00040000 // Canceled + +// CommError and Motor Detection Actions +#define CMA_THROWX 0x00100000 // Throw exception if an error occurs +#define CMA_READDRESS232 0x00400000 // Re-address RS232 chain if they are not addressed +#define CMA_USECURRENTBAUD 0x00800000 // only try at current baud rate +#define CMA_NOENDPRG 0x04000000 // Do not Stop the user program before addressing/detecting motors +#define CMA_NOESTABLISH 0x08000000 // Do try to establish the communication (it is already established) + + +//#define CER_CHANGED 0x00010000 // The pointers have been changed. +//#define CER_CONTINUE 0x00020000 // The caller can continue +//#define CER_CANCELED 0x00040000 // Canceled + + +// ************************************************************************************************ +// *** Planes +// ************************************************************************************************ +#define PLN_XY 0 +#define PLN_XZ 1 +#define PLN_YZ 2 + +// ************************************************************************************************ +// *** LogFlags +// ************************************************************************************************ +#define LOG_COMM 0x00000001 +#define LOG_CMOTION 0x00000002 +#define LOG_PATH 0x00000004 +#define LOG_SCAN 0x00000008 +#define LOG_MOTOR 0x00000010 +#define LOG_ALL 0x0000001F +#define LOG_APPEND 0x00010000 +#define LOG_NEW 0x00020000 // Do not set this flag. It is used internally + +// ************************************************************************************************ +// *** Notification Codes: +// ************************************************************************************************ +#define SMNOT_STARTDOWNLOAD 0x00000001 +#define SMNOT_PROGRESS 0x00000002 +#define SMNOT_END 0x00000003 +#define SMNOT_STARTUPLOAD 0x00000004 +#define SMNOT_STARTADDRESS 0x00000005 +#define SMNOT_STARTDETECT 0x00000006 +#define SMNOT_STARTCOLISION 0x00000007 +#define SMNOT_STARTGETINFO 0x00000008 + +// ************************************************************************************************ +// *** Motor Download Flags: +// ************************************************************************************************ +#define MDF_TURNOFF 0x00000001 // Turn it off if it is on +#define MDF_BLIND 0x00000010 // Blind Download +#define MDF_CAL 0x00000080 // Download Calibration Program +#define MDF_FORCEDOWNLOAD 0x00000100 // Download even if motor has no EEPROM + +#define MDF_SKIPPRGINFO 0x00000200 + +// ************************************************************************************************ +// *** Error Codes for IntegMotorInterface exceptions match resourec numbers for SMI and IntegMotorInterface +// ************************************************************************************************ +#define EID_NOERROR 4000 +#define EID_CX 4001 +#define EID_OPEN 4002 +#define EID_SETTIMEOUT 4003 +#define EID_CONNECTION 4004 +#define EID_TIMEOUT 4005 +#define EID_ECHOTIMEOUT 4006 +#define EID_BADECHO 4007 +#define EID_PORTNOTOPEN 4008 +#define EID_OVERRUN 4009 +#define EID_RXOVER 4010 +#define EID_RXPARITY 4011 +#define EID_FRAME 4012 +#define EID_BREAK 4013 +#define EID_IOE 4014 +#define EID_TXFULL 4015 +#define EID_COMMUNKNOWN 4016 +#define EID_READ 4017 +#define EID_WRITE 4018 +#define EID_INVALIDDATA 4019 +#define EID_INVALIDTIME 4020 +#define EID_INVALIDTIMEDELTA 4021 +#define EID_INVALIDPOSDELTA 4022 +#define EID_INTDATASPACE 4023 +#define EID_BUFFOVERFLOW 4024 +#define EID_BUFFUNDERFLOW 4025 +#define EID_HMFAILED 4026 +#define EID_GETSTATUS 4027 +#define EID_SAMPLERATES 4028 +#define EID_NOTSUPPORTED 4029 +#define EID_NOTINIT 4030 +#define EID_NOMEM 4031 +#define EID_GETALL 4032 +#define EID_NOMORE 4033 +#define EID_OPENFILE 4034 +#define EID_OPENFILEWRITE 4035 +#define EID_NOEEPROM 4036 +#define EID_INVALIDMODE 4037 +#define EID_RS485 4038 +#define EID_FILETOOLONG 4039 +#define EID_CORRUPTEEPROM 4040 +#define EID_DOWNLOADON 4041 +#define EID_VERSIONMISMATCH 4042 +#define EID_SOCKET 4043 +#define EID_DOWNLOADRCKS 4044 +#define EID_NETERROR 4045 +#define EID_USBERROR 4046 +#define EID_BIGADDRESS 4047 +#define EID_CALWARNING 4048 +#define EID_CANCELED 4049 +#define EID_SOMEADDRESSED 4050 +#define EID_COMMUNICATION 4051 +#define EID_DUPLICATEADDR 4052 +#define EID_COMMRESET 4053 +#define EID_STOP 4054 +#define EID_NOTFOUND 4055 +#define EID_LANGFILE 4056 +#define EID_INVALID_PROJ 4057 +#define EID_READFILE 4058 +#define EID_CHANGEBAUD 4059 +#define EID_CANERROR 4060 +#define EID_NOCANDWLD 4061 +#define EID_NOLEGOACK 4062 +#define EID_NOMODBUSDWLD 4063 +#define EID_INCORRECTMICRO 4064 +#define EID_FILEFORMAT 4065 +#define EID_DLD_BUFFEREXCEED 4066 +#define EID_DLD_HEXCHKSUM 4067 +#define EID_DLD_HEXADDRESS 4068 +#define EID_HEXTYPE 4069 +#define EID_DATAINSERT 4070 +#define EID_CMDNOSUPPORT 4071 +#define EID_NOTIMEDELTA 4072 +#define EID_CANINVTIMEDELTA 4073 +#define EID_CANVOLTAGEFAULT 4074 +#define EID_CANEXCESSTEMP 4075 +#define EID_CANEXCESSPOS 4076 +#define EID_CANVELOCITYLIMIT 4077 +#define EID_CANDEDTLIMIT 4078 +#define EID_CANHWPOSHWLIMIT 4079 +#define EID_CANHWNEGHWLIMIT 4080 +#define EID_CANSWPOSLIMIT 4081 +#define EID_CANSWNEGLIMIT 4082 +#define EID_FIRMVERMISSMATCH 4083 +#define EID_BADMODEL 4084 + +// scanner errors match the resource numbers in SMI and IntegMotorInterface +#define ER_CANNOT_OPEN 8672 +#define ER_ERROR_CLINE 8673 +#define ER_LINE_TOKENS 8674 +#define ER_NOLANGFILE 8675 +#define ER_UNKNOWNERROR 8676 + +#define ER_2DEFAULTS 8700 +#define ER_2ELSE 8701 +#define ER_2MANYINCLUDES 8702 +#define ER_ABSEXPECTED 8703 +#define ER_ASSIGNECXPTD 8704 +#define ER_BADBREAK 8705 +#define ER_CASEAFTERDEFAULT 8706 +#define ER_CASEWOSWITCH 8707 +#define ER_CASEXPTD 8708 +#define ER_CBRACKETXPTD 8709 +#define ER_CLOSEPXPTD 8710 +#define ER_CMPWOIFX 8711 +#define ER_COMMAXPTD 8712 +#define ER_DEFAULTWOSWITCH 8713 +#define ER_DESTINATION 8714 +#define ER_DIRECTIVECLOSE 8715 +#define ER_DOTEXPTD 8716 +#define ER_DUPLICATELABELS 8717 +#define ER_ELSEIFAFTERELSE 8718 +#define ER_ELSEIFWOIF 8719 +#define ER_ELSEWOIF 8720 +#define ER_ENDIFWOIF 8721 +#define ER_ENDSWOSWITCH 8722 +#define ER_ENDXPTD 8723 +#define ER_IFFWOCMP 8724 +#define ER_IFTWOCMP 8725 +#define ER_IFWOENDIF 8726 +#define ER_IFXWOCMP 8727 +#define ER_INVALIDEOP 8728 +#define ER_INVALIDEXPTERM 8729 +#define ER_INVALIDNOPARAM 8730 +#define ER_INVALIDPARAM 8731 +#define ER_LANGFILE 8732 +#define ER_LOOPWOWHILE 8733 +#define ER_LVALUE 8734 +#define ER_NEWLINESTRING 8735 +#define ER_NOTINPROGRAM 8736 +#define ER_NUMSIGNXPTD 8737 +#define ER_NUMXPTD 8738 +#define ER_OBRACKETXPTD 8739 +#define ER_OPENINCLUDE 8740 +#define ER_OPENPXPTD 8741 +#define ER_QUOTXPTD 8742 +#define ER_REDEF 8743 +#define ER_RESERVED 8744 +#define ER_SPACEXPTD 8745 +#define ER_STRXPTD 8746 +#define ER_SWITCHWOENDS 8747 +#define ER_SYNTAX 8748 +#define ER_UNDEFINED 8749 +#define ER_UPARAMXPTD 8750 +#define ER_WHILEWOLOOP 8751 +#define ER_DIVIDEBYZERO 8752 +#define ER_FLT_NOTALLOW 8753 +#define ER_NOFLOATVARMATH 8754 +#define ER_PEERTOPEERTYPE 8755 +#define ER_MISSINGSEMI 8756 +#define ER_MISSINGCOLON 8757 +#define ER_INVALIDADDRESS 8758 +#define ER_INVALIDAXIS 8759 +#define ER_REPORTNOTALLOWED 8760 + +#define WR_BAUDRATE 8800 +#define WR_DATARANGE 8801 +#define WR_DEFAULTLANGUAGE 8802 +#define WR_MISSINGPOUND 8803 +#define WR_NUMRANGE 8804 +#define WR_NUMRANGEMM 8805 +#define WR_NUMRANGEN 8806 +#define WR_NUMRANGENN 8807 +#define WR_NUMRANGENP 8808 +#define WR_NUMRANGEP 8809 +#define WR_FLTDECIMALS 8810 +#define WR_FLTRANGE 8811 +#define WR_FLTOVERFLOW 8812 +#define WR_LONGOVERFLOW 8813 +#define WR_FLTDECIMALSPT 8814 + +#define FATAL_ER_2MANYERRORS 8900 +#define FATAL_ER_2MANYWARNINGS 8901 +#define FATAL_ER_NESTING 8902 + +// warning range +#define IS_WARNING_ID(x) (((x) >= WR_BAUDRATE) && ((x) <= (WR_BAUDRATE + 99))) + +// fatal error range (stop scanning) +#define IS_FATAL_ID(x) (((x) >= FATAL_ER_2MANYERRORS) && ((x) <= (FATAL_ER_2MANYERRORS + 99))) + +// ************************************************************************************************ +// used when warnings replaces errors for keywords (no strings associated) only used for ER_UNDEFINED +#define ERRTOWARN_START (FATAL_ER_2MANYERRORS + 100) // set start area of converted errors 9000 +#define ERRTOWARN_END (ERRTOWARN_START + 99) // set start area of converted errors 9099 +#define IS_ERRTOWWARNING(x) (((x) >= ERRTOWARN_START) && ((x) <= ERRTOWARN_END)) +#define MAKEWE(x) ((Errors2Warnings)?(ERRTOWARN_START + (x) % 100):(x)) // convert error to warning if Errors2Warnings +#define WE2E(x) (IS_ERRTOWWARNING(x)?(ER_2DEFAULTS + (x % 100)):(x)) // convert error to warning back to orignal error + + +#endif //__SMIDEFS_H_ + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.cpp new file mode 100644 index 0000000..09e7efa --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.cpp @@ -0,0 +1,237 @@ +#include "StdAfx.h" +#include +#include +#include "Keyence_Laser.h" + +#define MAX_STORAGE_DATA_SIZE 65536 + +CKeyence_Laser::CKeyence_Laser() +{ + m_bIsStorage=FALSE; + m_iSetOutNo=0; + m_StoredDataNumber=0; + m_NeedStorageDataNumber=0; + m_StorageCycle=LKIF_STORAGECYCLE_100; +} + +CKeyence_Laser::~CKeyence_Laser() +{ + FreeLibrary(m_hLkif); +} +//======================================== +void CKeyence_Laser::KeyenceLaserInit(void) +{ + m_hLkif=LoadLibrary(_T("LkIF.dll")); + if(m_hLkif) + { + m_pGetCalcData=(pLKIF_GetCalcData)GetProcAddress(m_hLkif,"LKIF_GetCalcData"); + m_pDataStorageStart=(pLKIF_DataStorageStart)GetProcAddress(m_hLkif,"LKIF_DataStorageStart"); + m_pDataStorageStop=(pLKIF_DataStorageStop)GetProcAddress(m_hLkif,"LKIF_DataStorageStop"); + m_pDataStorageInit=(pLKIF_DataStorageInit)GetProcAddress(m_hLkif,"LKIF_DataStorageInit"); + m_pDataStorageGetData=(pLKIF_DataStorageGetData)GetProcAddress(m_hLkif,"LKIF_DataStorageGetData"); + m_pDataStorageGetStatus=(pLKIF_DataStorageGetStatus)GetProcAddress(m_hLkif,"LKIF_DataStorageGetStatus"); + m_pSetDataStorage=(pLKIF_SetDataStorage)GetProcAddress(m_hLkif,"LKIF_SetDataStorage"); + + } + +} +//============================================== +void CKeyence_Laser::Get_KeyenceLaserData(float *LaserValue1,float *LaserValue2) +{ + *LaserValue1=10; + *LaserValue2=10; + LKIF_FLOATVALUE GetVal1,GetVal2; + if(m_pGetCalcData(&GetVal1,&GetVal2)!=1) + { + return ; + } + switch(GetVal1.FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *LaserValue1=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *LaserValue1=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *LaserValue1=0; + break; + } + default: + { + *LaserValue1=GetVal1.Value; + break; + } + } + + switch(GetVal2.FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *LaserValue2=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *LaserValue2=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *LaserValue2=0; + break; + } + default: + { + *LaserValue2=GetVal2.Value; + break; + } + } +} + +//============================================== +BOOL CKeyence_Laser::StartStoreData(int _NeedStorageDataNumber,int _SampleTime) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (!m_bIsStorage) + { + bStatus=m_pDataStorageInit(); + if (_NeedStorageDataNumber<1) + { + _NeedStorageDataNumber=1; + } + else if (_NeedStorageDataNumber>65536) + { + _NeedStorageDataNumber=65536; + } + m_NeedStorageDataNumber=_NeedStorageDataNumber; + + if (_SampleTime<0.4) + { + m_StorageCycle=LKIF_STORAGECYCLE_1; + } + else if (_SampleTime<1) + { + m_StorageCycle=LKIF_STORAGECYCLE_2; + } + else if (_SampleTime<2) + { + m_StorageCycle=LKIF_STORAGECYCLE_5; + } + else if (_SampleTime<4) + { + m_StorageCycle=LKIF_STORAGECYCLE_10; + } + else if (_SampleTime<10) + { + m_StorageCycle=LKIF_STORAGECYCLE_20; + } + else if (_SampleTime<20) + { + m_StorageCycle=LKIF_STORAGECYCLE_50; + } + else if (_SampleTime<40) + { + m_StorageCycle=LKIF_STORAGECYCLE_100; + } + else if (_SampleTime<100) + { + m_StorageCycle=LKIF_STORAGECYCLE_200; + } + else if (_SampleTime<200) + { + m_StorageCycle=LKIF_STORAGECYCLE_500; + } + else + { + m_StorageCycle=LKIF_STORAGECYCLE_1000; + } + bStatus=m_pSetDataStorage(LKIF_TARGETOUT_OUT1,m_NeedStorageDataNumber,m_StorageCycle); + + if (bStatus) + { + bStatus=m_pDataStorageStart(); + } + } + return bStatus; +}; +//============================================== +BOOL CKeyence_Laser::StopStoreData() +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (m_bIsStorage) + { + bStatus=m_pDataStorageStop(); + } + return bStatus; +}; +//============================================== +BOOL CKeyence_Laser::PauseScanAndGetData(float *GetStorageData,int *GetStorageNumber) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (m_bIsStorage) + { + bStatus=m_pDataStorageStop(); + bStatus=GetStoredData(GetStorageData,GetStorageNumber); + bStatus=m_pDataStorageStart(); + } + else + { + bStatus=GetStoredData(GetStorageData,GetStorageNumber); + } + return bStatus; +}; +//============================================== +BOOL CKeyence_Laser::GetStoredData(float *GetStorageData,int *GetStorageNumber) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (!m_bIsStorage) + { + LKIF_FLOATVALUE GetStorageValue[MAX_STORAGE_DATA_SIZE]; + bStatus=m_pDataStorageGetData(m_iSetOutNo,m_StoredDataNumber,GetStorageValue,GetStorageNumber); + for(int i=0;i<*GetStorageNumber;i++) + { + switch(GetStorageValue[i].FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *GetStorageData++=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *GetStorageData++=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *GetStorageData++=0; + break; + } + default: + { + *GetStorageData++=GetStorageValue[i].Value; + break; + } + } + } + + } + return bStatus; +}; +//============================================== +BOOL CKeyence_Laser::GetStoreDataStatus() +{ + BOOL bStatus(FALSE); + bStatus=m_pDataStorageGetStatus(m_iSetOutNo,&m_bIsStorage,&m_StoredDataNumber); + return bStatus; +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.h b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.h new file mode 100644 index 0000000..e50922b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Laser.h @@ -0,0 +1,61 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef AFX_KEYENCE__LASER_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ +#define AFX_KEYENCE__LASER_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "LkIF.h" + +typedef BOOL (WINAPI* pLKIF_GetCalcData)(OUT LKIF_FLOATVALUE *CalcData1,OUT LKIF_FLOATVALUE *CalcData2); +// Starting the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageStart)(void); +// Stopping the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageStop)(void); +// Initializing the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageInit)(void); +// Outputting the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageGetData)(IN int OutNo,IN int NumOutBuffer,OUT LKIF_FLOATVALUE *OutBuffer,OUT int *NumReceived); +// Data Storage Accumulation Status Output +typedef BOOL (WINAPI* pLKIF_DataStorageGetStatus)(IN int OutNo,OUT BOOL *IsStorage,OUT int *NumStorageData); +// Set Data Storage +typedef BOOL (WINAPI* pLKIF_SetDataStorage)(IN LKIF_TARGETOUT TargetOut,IN int NumStorage,IN LKIF_STORAGECYCLE StorageCycle); + +//====================================================================================== +class CKeyence_Laser +{ +protected: + int m_iSetOutNo; + int m_NeedStorageDataNumber; + LKIF_STORAGECYCLE m_StorageCycle; + HINSTANCE m_hLkif; +public: + + CKeyence_Laser(); + ~CKeyence_Laser(); + + //ȡݵĺָ + pLKIF_GetCalcData m_pGetCalcData; + pLKIF_DataStorageStart m_pDataStorageStart; + pLKIF_DataStorageStop m_pDataStorageStop; + pLKIF_DataStorageInit m_pDataStorageInit; + pLKIF_DataStorageGetData m_pDataStorageGetData; + pLKIF_DataStorageGetStatus m_pDataStorageGetStatus; + pLKIF_SetDataStorage m_pSetDataStorage; + + int m_StoredDataNumber; + BOOL m_bIsStorage; + void KeyenceLaserInit(void); + void Get_KeyenceLaserData(float *LaserValue1,float *LaserValue2); + BOOL StartStoreData(int _NeedStorageDataNumber,int _SampleTime); + BOOL StopStoreData(); + BOOL GetStoreDataStatus(); + BOOL GetStoredData(float *GetStorageData,int *GetStorageNumber); + BOOL PauseScanAndGetData(float *GetStorageData,int *GetStorageNumber); +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.cpp new file mode 100644 index 0000000..4f29fed --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.cpp @@ -0,0 +1,660 @@ + + +#include "stdafx.h" +#include "Keyence_Proto.h" +#include "math.h" + + + +#define MY_CONFIG 1 +#define MAX_DEVPATH_LENGTH 256 +#define ENDPOINT_TIMEOUT 500 + +//***** Static Data ***** +struct_Keyence_ep_buff CKeyence_Proto::ep_buff[lEPSIZE]; + +//================================================================ +int CKeyence_Proto::g_hEP81_Thread_State=THREAD_PAUSED; +HANDLE CKeyence_Proto::g_hEP81_Thread_Id=NULL; + +//================================================================ +int CKeyence_Proto::g_hEP82_Thread_State=THREAD_PAUSED; +HANDLE CKeyence_Proto::g_hEP82_Thread_Id=NULL; + +//================================================================ +int CKeyence_Proto::g_hEP01_Thread_State=THREAD_PAUSED; +HANDLE CKeyence_Proto::g_hEP01_Thread_Id=NULL; +HANDLE CKeyence_Proto::g_hEP01_Serial_Mutex; + +//================================================================ +int CKeyence_Proto::g_hEP02_Thread_State=THREAD_PAUSED; +HANDLE CKeyence_Proto::g_hEP02_Thread_Id=NULL; +HANDLE CKeyence_Proto::g_hEP02_Serial_Mutex; + +//================================================================ +struct_Keyence_machine CKeyence_Proto::g_machine; +usb_dev_handle *CKeyence_Proto::g_dev=NULL; +CLogger *CKeyence_Proto::g_pLogger; +HANDLE CKeyence_Proto::g_hHomedEvent = NULL; + +//=========================================================================== +// Worker Thread to serialize EP_KEYENCE_01 commands. +//=========================================================================== +unsigned __stdcall CKeyence_Proto::g_EP01_Thread(LPVOID pThis) +{ + CKeyence_Proto* _This = (CKeyence_Proto*)pThis; + for (;;) + { + TRACE0("g_hSerialUsbThread in loop set.\n"); + if (g_hEP01_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_01_CMD_IDX]._event,INFINITE); + TRACE0("g_hSerialUsbThread obtained event.\n"); + switch (g_hEP01_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hSerialUsbThread processing _send_usb_data();\n"); + _This->_send_usb_data(EP_01_CMD_IDX); + TRACE0("g_hSerialUsbThread return from _send_usb_data();\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP01_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//=========================================================================== +// Worker Thread to serialize EP_KEYENCE_02 commands. +//=========================================================================== +unsigned __stdcall CKeyence_Proto::g_EP02_Thread(LPVOID pThis) +{ + CKeyence_Proto* _This = (CKeyence_Proto*)pThis; + for (;;) + { + TRACE0("g_hEP02_Thread in loop set.\n"); + if (g_hEP02_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_02_CMD_IDX]._event,INFINITE); + TRACE0("g_hEP02_Thread obtained event.\n"); + switch (g_hEP02_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hEP02_Thread calling _send_usb_data. EP_KEYENCE_02; %x\n"); + _This->_send_usb_data(EP_02_CMD_IDX); + TRACE0("g_hEP02_Thread return _send_usb_data. EP_KEYENCE_02; %x\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP02_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CKeyence_Proto::g_EP81_Thread(LPVOID pThis) +{ + CKeyence_Proto* _This = (CKeyence_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_81_DATA_IDX]._event, INFINITE); + switch (g_hEP81_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_81_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CKeyence_Proto::g_EP82_Thread(LPVOID pThis) +{ + CKeyence_Proto* _This = (CKeyence_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_82_DATA_IDX]._event, INFINITE); + switch (g_hEP82_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_82_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//=========================================================================== +void CKeyence_Proto::Trace_EP_Buff(long lIndex) +{ + UCHAR tmp[256]; + CString csTmp; + memcpy(tmp, ep_buff[lIndex]._buffer, ep_buff[lIndex]._size); + csTmp = _T("Trace_EP_Buff _59 "); + for (int ii= 0 ; ii < ep_buff[lIndex]._size ; ++ii) + { + CString csTmpHex; + csTmpHex.Format(_T("%2X"), tmp[ii] ); + csTmp += csTmpHex; + } + TRACE1("_process_KEYENCE_CMD_GET_INDEX_4E() Trace_EP_Buff %s \n", csTmp); +} + + +//****************************************************************************** +// Parse the data received based on the index (which EP are we processing). +// The CCmdObj should only have one CMD_STATUS_PROCESSING. +// Update CCmdObj _ep_01_status and _ep_81_status. +// Update _status to CMD_STATUS_COMPLETE when both _ep_01_status and _ep_81_status +// are CMD_STATUS_COMPLETE. +// +//****************************************************************************** +void CKeyence_Proto::_process_rcv_transfer_data(int iEP) +{ + static long lRcvCnt = 0; + static long lRcvCnt2 = 0; + switch (iEP) + { + case EP_01_CMD_IDX : + TRACE0("_process_rcv_transfer_data() : Update EP_01_CMD_IDX.\r\n"); + ++lRcvCnt; + break; + case EP_81_DATA_IDX : // + ++lRcvCnt; + TRACE0("_process_rcv_transfer_data() : Update EP_81_DATA_IDX status.\r\n"); + break; + case EP_02_CMD_IDX : + TRACE0("_process_rcv_transfer_data() : Update EP_02_CMD_IDX.\r\n"); + ++lRcvCnt2; + break; + case EP_82_DATA_IDX : + // parse result and put into its proper place. + _process_KEYENCE_CMD_GET_LASER_DATA(); + ++lRcvCnt2; + break; + default: + break; + }; + lRcvCnt = (lRcvCnt == 2) ? 0:lRcvCnt; + lRcvCnt2 = (lRcvCnt2 == 2) ? 0:lRcvCnt2; +}; + + +//****************************************************************************** +CKeyence_Proto::CKeyence_Proto() +{ + ep_buff[EP_01_CMD_IDX]._ep = EP_KEYENCE_01; + ep_buff[EP_81_DATA_IDX]._ep = EP_KEYENCE_81; + ep_buff[EP_02_CMD_IDX]._ep = EP_KEYENCE_02; + ep_buff[EP_82_DATA_IDX]._ep = EP_KEYENCE_82; + + for (int i=0;inext) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == KEYENCE_VID && dev->descriptor.idProduct == KEYENCE_PID) + { + return usb_open(dev); + } + } + } + return NULL; +} + +//****************************************************************************** +SSI_STATUS_MOTION CKeyence_Proto::_usb_reset(void) +{ + if (g_dev) + { + usb_reset(g_dev); + g_dev = NULL; + } + else + { + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_TIMEOUT; +} + + + +//****************************************************************************** +// Send is direct and async. +// The receive thread will receive data and interpret it. +//****************************************************************************** +SSI_STATUS_MOTION CKeyence_Proto::Init_MvUsb() +{ + // Set initial state of the machine + g_machine.s_status._machine_running = false; + + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + UNREFERENCED_PARAMETER(Status); + /*if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Enter Initialize Mv Usb\n")); +*/ + int usb_status = NULL; + usb_init(); // initialize the library + usb_status = usb_find_busses(); // find all busses + usb_status = usb_find_devices(); // find all connected devices + g_dev = _open_usb_dev(); + if (!g_dev) + { + MessageBox(NULL, _T("Unable to open device"), _T("Message"), MB_OK); + g_pLogger->SendAndFlushPerMode(_T("Unable to open device %s"), usb_strerror()); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_set_configuration(g_dev, MY_CONFIG) < 0) + { + MessageBox(NULL, _T("Unable to SET CONFIGURATION"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_claim_interface(g_dev, 0) < 0) + { + usb_close(g_dev); + MessageBox(NULL, _T("Unable to CLAIM DEVICE"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_01_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP01_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP01_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Thread_State = THREAD_RUNNING; + + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_02_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP02_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP02_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Thread_State = THREAD_RUNNING; + + // ******************************************************************** + // Prepare and start EP_KEYENCE_81 Thread - Use async commit. + // + ep_buff[EP_81_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP81_Thread_State = THREAD_PAUSED; + g_hEP81_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP81_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + // ******************************************************************** + // Prepare and start EP_KEYENCE_82 Thread - Use async commit. + // + ep_buff[EP_82_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP82_Thread_State = THREAD_PAUSED; + g_hEP82_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP82_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + + // ********************************************************************* + g_hHomedEvent = CreateEvent(NULL, // default security attributes + TRUE, // manual reset event object + FALSE, // initial state is signaled + NULL); // unamed object + + //if (g_pLogger->m_lLogMask & LOGACTIONS) + // g_pLogger->SendAndFlushPerMode(_T("Exit Initialize Usb\n")); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +SSI_STATUS_MOTION CKeyence_Proto::Exit_MvUsb() +{ + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + //if (g_pLogger->m_lLogMask & LOGACTIONS) + // g_pLogger->SendAndFlushPerMode(_T("Enter Exit_MvUsb\n")); + + g_hEP81_Thread_State = THREAD_EXIT; + g_hEP82_Thread_State = THREAD_EXIT; + g_hEP01_Thread_State = THREAD_EXIT; + g_hEP02_Thread_State = THREAD_EXIT; + + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + if (g_hEP81_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP81_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + if (g_hEP82_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP82_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + if (g_hEP01_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP01_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + if (g_hEP02_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP02_Thread_Id,&dwCode); + Sleep(1); + } + } + + if (g_dev) + { + usb_release_interface(g_dev,0); + usb_close(g_dev); + g_dev = NULL; + } + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + CloseHandle(ep_buff[EP_81_DATA_IDX]._event); + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + CloseHandle(ep_buff[EP_82_DATA_IDX]._event); + g_hEP01_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + CloseHandle(ep_buff[EP_01_CMD_IDX]._event); + g_hEP02_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + CloseHandle(ep_buff[EP_02_CMD_IDX]._event); + ReleaseMutex(g_hEP01_Serial_Mutex); + CloseHandle(g_hEP01_Serial_Mutex); + ReleaseMutex(g_hEP02_Serial_Mutex); + CloseHandle(g_hEP02_Serial_Mutex); + + //if (g_pLogger->m_lLogMask & LOGACTIONS) + // g_pLogger->SendAndFlushPerMode(_T("Exit Exit_MvUsb\n")); + return Status; +} + + +//****************************************************************************** +// Kick the g_hEP01_Thread_Event to get the g_EP01_Thread going. +// iEP = EP_KEYENCE_01 or EP_KEYENCE_02 = 0x01 or 0x02 +//****************************************************************************** +SSI_STATUS_MOTION CKeyence_Proto::_do_single_threaded_usb_comm(int iEP_Base) +{ + TRACE1("=====_do_single_threaded_usb_comm(iEP) g_hEP01_Thread_Event. %x\n", iEP_Base); + while ((ep_buff[iEP_Base]._hProtoPending == TRUE) || (ep_buff[iEP_Base+1]._hProtoPending == TRUE)) + { + ASSERT(0); + Sleep(3); + } + ep_buff[iEP_Base]._hProtoPending = ep_buff[iEP_Base+1]._hProtoPending = TRUE; + TRACE1("=====_do_single_threaded_usb_comm(iEP_Base) SetEvent(g_hEP01_Thread_Event): %X \r\n", ep_buff[iEP_Base]._save_send_cmd); + SetEvent(ep_buff[iEP_Base]._event); + while ((ep_buff[iEP_Base]._hProtoPending == TRUE) || (ep_buff[iEP_Base+1]._hProtoPending == TRUE)) + { + Sleep(3); + } + TRACE1("=====_do_single_threaded_usb_comm(iEP) g_hProtoDoneEvents. %x\n", iEP_Base); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +// This startup just kicks off the EP_KEYENCE_81 worker thread. +//****************************************************************************** +SSI_STATUS_MOTION CKeyence_Proto::_start_machine() +{ + g_hEP81_Thread_State = THREAD_RUNNING; + g_hEP82_Thread_State = THREAD_RUNNING; + g_machine.s_status._machine_running = true; + return SSI_STATUS_MOTION_NORMAL; +}; + +//=============================================================================== +SSI_STATUS_MOTION CKeyence_Proto::_shutdown_machine() +{ + g_machine.s_status._machine_running = false; + return SSI_STATUS_MOTION_NORMAL; +}; + +//=============================================================================== +// iEP = EP_KEYENCE_01 or EP_KEYENCE_02 +//=============================================================================== +SSI_STATUS_MOTION CKeyence_Proto::_submit_async_8x(int iEP_Base) +{ + int _ret; + _ret = usb_bulk_setup_async(g_dev, &(ep_buff[iEP_Base]._async_context), (unsigned char)ep_buff[iEP_Base]._ep); + if (_ret < 0) + { + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + _ret = usb_submit_async(ep_buff[iEP_Base]._async_context, ep_buff[iEP_Base]._buffer, ep_buff[iEP_Base]._size); + if (_ret < 0) + { + printf("error usb_submit_async_ep_xx:\n%s\n", usb_strerror()); + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + return SSI_STATUS_MOTION_NORMAL; +} + +//=============================================================================== +// iEP_Base : EP_81_DATA_IDX/EP_82_DATA_IDX +// +//=============================================================================== +SSI_STATUS_MOTION CKeyence_Proto::_reap_async_8x(int iEP_Base) +{ + int _ret; + _ret = usb_reap_async(ep_buff[iEP_Base]._async_context, 1000); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_NORMAL; +} + +//=============================================================================== +// _send_usb_data(iEP) sends data to the corresponding iEP channel. +// iEP = EP_KEYENCE_01 / EP_KEYENCE_02 EP_KEYENCE_01 = 0x01; EP_KEYENCE_02 = 0x02; +//=============================================================================== +SSI_STATUS_MOTION CKeyence_Proto::_send_usb_data(int iEP_Base) +{ + int _ret; + ep_buff[iEP_Base]._save_send_cmd = ep_buff[iEP_Base]._buffer[0]; + ep_buff[iEP_Base]._save_send_cmd0 = ep_buff[iEP_Base]._buffer[1]; + ep_buff[iEP_Base]._save_send_cmd1 = ep_buff[iEP_Base]._buffer[2]; + + TRACE3("_send_usb_data() iEP : %X - ep_buff[iEP]._save_send_cmd : %X ._buffer[0] : %X\r\n", iEP_Base, ep_buff[EP_01_CMD_IDX]._save_send_cmd, ep_buff[EP_81_DATA_IDX]._buffer[0]); + _ret = usb_bulk_setup_async(g_dev, &(ep_buff[iEP_Base]._async_context), (unsigned char)ep_buff[iEP_Base]._ep); + if (_ret < 0) + { + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + _ret = usb_submit_async(ep_buff[iEP_Base]._async_context, ep_buff[iEP_Base]._buffer, ep_buff[iEP_Base]._size);//send data + if (_ret < 0) + { + printf("error usb_submit_async_ep_xx:\n%s\n", usb_strerror()); + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + TRACE1("_submit_async_8x(EP:%X)\r\n", iEP_Base); + // + ep_buff[iEP_Base+1]._save_send_cmd = ep_buff[iEP_Base+1]._buffer[0]; + ep_buff[iEP_Base+1]._save_send_cmd0 = ep_buff[iEP_Base+1]._buffer[1]; + ep_buff[iEP_Base+1]._save_send_cmd1 = ep_buff[iEP_Base+1]._buffer[2]; + // + _submit_async_8x(iEP_Base+1); // Send EP_KEYENCE_81/EP_KEYENCE_82 + // Get ready to receive on EP_KEYENCE_81 or EP_KEYENCE_82 + SetEvent(ep_buff[iEP_Base+1]._event); + // Get ready to receive on EP_KEYENCE_01 or EP_KEYENCE_02 + _ret = usb_reap_async(ep_buff[iEP_Base]._async_context, 10000); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== + SSI_STATUS_MOTION CKeyence_Proto::_send_cmd_KEYENCE_CMD_GET_LASER_DATA() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + ep_buff[EP_01_CMD_IDX]._buffer[0] = 0x00; + ep_buff[EP_01_CMD_IDX]._buffer[1] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[2] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[3] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[4] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[5] = 0x01; + + + ep_buff[EP_01_CMD_IDX]._size = 0x0C; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + + +//============================================================== +SSI_STATUS_MOTION CKeyence_Proto::_process_KEYENCE_CMD_GET_LASER_DATA() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.h b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.h new file mode 100644 index 0000000..51230a8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/Keyence_Proto.h @@ -0,0 +1,180 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef AFX_KEYENCE_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + #define AFX_KEYENCE_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#define KEYENCE_TRACE if ( g_pLogger && g_pLogger->m_lLogMask & LOGACTIONS ) g_pLogger->SendAndFlushPerMode + +#if _MSC_VER > 1000 + #pragma once +#endif // _MSC_VER > 1000 + +#include "..\Tools\UsbUtility\logger.h" +#include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h" +#include "..\MicroVu\SsiStatus.h" + +#define MAX_BUFF_SIZE 0x200 + +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +#define USB_DEVICE_DESCRIPTOR_TYPE 1 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 2 + +#define THREAD_RUNNING 0 +#define THREAD_PAUSED 1 +#define THREAD_EXIT -1 + +// Device configuration and interface id. +#define KEYENCE_USB_CONFIG 1 +#define KEYENCE_USB_INTF 0 + + +#define EP_KEYENCE_01 0x01 +#define EP_KEYENCE_02 0x02 +#define EP_KEYENCE_03 0x03 +#define EP_KEYENCE_81 0x82 +#define EP_KEYENCE_82 0x81 +#define EP_KEYENCE_84 0x84 + +#define EP_01_CMD_IDX 0 // index to usb buffers +#define EP_81_DATA_IDX 1 // +#define EP_02_CMD_IDX 2 // +#define EP_82_DATA_IDX 3 // +#define EP_03_CMD_IDX 4 // +#define EP_84_DATA_IDX 5 // + +#define lEPSIZE 6 +#define MAXRINGS 5 // for MicroVu Vertex 220 +#define MAXSEGS 8 + + +#pragma pack(push) +#pragma pack(1) +//**************************************************************************************************** +// Set the _status to Idle after reply data has been received. +// How to recover? In order to send data, _status must be Idle. If the system is not available +// for 1 second, assume something wrong and treat it as "TimeOut". +// Another way to do this is to lock this structure is to use a mutex to ensure single-threaded +// access. +//**************************************************************************************************** +//==================================================================================================== +struct struct_Keyence_machine +{ // g_machine structure + struct s_status + { + bool _machine_running; + } s_status; + +}; + + +#define KEYENCE_VID 0x0720 +#define KEYENCE_PID 0x000A + +//**************************************************************************************************** +// Binary SevenOcean command structure, out going +// +//**************************************************************************************************** +#define pKEYENCE_CMD_01 ((s_KEYENCE_CMD_BUFF_01 *) ep_buff[EP_01_CMD_IDX]._buffer) + +struct s_KEYENCE_CMD_BUFF_01 +{ + UCHAR uCmdByte; + //---------------------------------------------------------------------- + // [endpoint 0x00000001] 00000060 : 530001010100fffe1d89ffff4d37fffebeee000000000000c34e0000021a0000003200000000000f423b000029fb0000138800000000003d08ee00030d4000030d40000000000000000000000000000000000000000000000000000000000000 + // *Command : 53 Move To -- X Y Z ZM Scale-0123511 -0045769 -0082194 00000000 + // *Speed : 00049998 00000538 00000050 00000000 + // *Unk1 : 00999995 00010747 00005000 00000000 + // *Unk2 : 03999982 00200000 00200000 00000000 + union + { + struct + { + BYTE uSubCmdByte; + char data[9]; + }S_KEYENCE_CMD_MOVE_XYZ; + + }; +}; + +//====================== +struct struct_Keyence_ep_buff +{ + int _ep; + BYTE _save_send_cmd; + BYTE _save_send_cmd0; + BYTE _save_send_cmd1; + char *_buffer; // MAX_BUFF_SIZE + int _size; + void *_async_context; + BOOL _hProtoPending; + HANDLE _event; +}; + + +//====================================================================================== +class CKeyence_Proto +{ +public: + // EP 01/81 channel threads. + static int g_hEP81_Thread_State; + static unsigned __stdcall g_EP81_Thread(LPVOID pThis); + static HANDLE g_hEP81_Thread_Id; + + // EP 02/82 channel threads. + static int g_hEP82_Thread_State; + static unsigned __stdcall g_EP82_Thread(LPVOID pThis); + static HANDLE g_hEP82_Thread_Id; + // + // g_hEP01_Thread_Event is used to kick a command + // + static int g_hEP01_Thread_State; + static unsigned __stdcall g_EP01_Thread(LPVOID pThis); + static HANDLE g_hEP01_Thread_Id; + static HANDLE g_hEP01_Serial_Mutex; // EP01 + // + static int g_hEP02_Thread_State; + static unsigned __stdcall g_EP02_Thread(LPVOID pThis); + static HANDLE g_hEP02_Thread_Id; + static HANDLE g_hEP02_Serial_Mutex; // EP02 + + static HANDLE g_hHomedEvent; + + // + CKeyence_Proto(); + virtual ~CKeyence_Proto(); + + // Global Structures + static struct_Keyence_ep_buff ep_buff[lEPSIZE]; + static struct_Keyence_machine g_machine; + + static CLogger* g_pLogger; + static usb_dev_handle *g_dev; + + SSI_STATUS_MOTION Init_MvUsb(); + SSI_STATUS_MOTION Exit_MvUsb(); + static void Trace_EP_Buff(long lIndex); + static void _process_rcv_transfer_data(int iEP); + usb_dev_handle* _open_usb_dev(void); + SSI_STATUS_MOTION _usb_reset(void); + + SSI_STATUS_MOTION _start_machine(); + SSI_STATUS_MOTION _shutdown_machine(); + SSI_STATUS_MOTION _do_single_threaded_usb_comm(int iEP); + SSI_STATUS_MOTION _submit_async_8x(int iEP_Base); + SSI_STATUS_MOTION _reap_async_8x(int iEP_Base); + SSI_STATUS_MOTION _send_usb_data(int iEP_Base); + + SSI_STATUS_MOTION _send_cmd_KEYENCE_CMD_GET_LASER_DATA(); + static SSI_STATUS_MOTION _process_KEYENCE_CMD_GET_LASER_DATA(); + + + + +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Keyence/LkIF.h b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/LkIF.h new file mode 100644 index 0000000..b1290d7 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Keyence/LkIF.h @@ -0,0 +1,320 @@ +#ifndef LKIF_INCLUDED +#define LKIF_INCLUDED + +#ifdef I_AM_LKIF +#define EXP __declspec(dllexport) +#else +#define EXP __declspec(dllimport) +#endif + +extern "C" +{ +// Measurement value structures +typedef enum { + LKIF_FLOATRESULT_VALID, // valid data + LKIF_FLOATRESULT_RANGEOVER_P, // over range at positive (+) side + LKIF_FLOATRESULT_RANGEOVER_N, // over range at negative (-) side + LKIF_FLOATRESULT_WAITING, // comparator result +} LKIF_FLOATRESULT; + +typedef struct { + LKIF_FLOATRESULT FloatResult; // valid or invalid data + float Value; // measurement value during LKIF_FLOATRESULT_VALID. + // Any other times will return an invalid value +} LKIF_FLOATVALUE; +/////////////////////////////////////////////// +// Measurement Control Command +// +// Measurement Value Output +EXP BOOL WINAPI LKIF_GetCalcData(OUT LKIF_FLOATVALUE *CalcData1,OUT LKIF_FLOATVALUE *CalcData2); +// Timing ON/OFF +EXP BOOL WINAPI LKIF_SetTiming(IN int OutNo,IN BOOL IsOn); +// Auto-zero ON/OFF +EXP BOOL WINAPI LKIF_SetZero(IN int OutNo,IN BOOL IsOn); +// Reset +EXP BOOL WINAPI LKIF_SetReset(IN int OutNo); +// Panel Lock +EXP BOOL WINAPI LKIF_SetPanelLock(IN BOOL IsLock); +// Program Change +EXP BOOL WINAPI LKIF_SetProgramNo(IN int ProgramNo); +// Program Check +EXP BOOL WINAPI LKIF_GetProgramNo(OUT int *ProgramNo); +// Statistical Results Output +typedef struct { + LKIF_FLOATVALUE ToleUpper; // tolerance upper limit + LKIF_FLOATVALUE ToleLower; // tolerance lower limit + LKIF_FLOATVALUE AverageValue; // average value + LKIF_FLOATVALUE MaxValue; // maximum value + LKIF_FLOATVALUE MinValue; // minimum value + LKIF_FLOATVALUE DifValue; // maximum value - minimum value + LKIF_FLOATVALUE SdValue; // standard deviation + LONG DataCnt; // number of all data + LONG HighDataCnt; // number of tolerance High data + LONG GoDataCnt; // number of tolerance Go data + LONG LowDataCnt; // number of tolerance Low data +} LKIF_FIGUREDATA; +EXP BOOL WINAPI LKIF_GetFigureData(IN int OutNo,OUT LKIF_FIGUREDATA *FigureData); +// Clearing Statistics +EXP BOOL WINAPI LKIF_ClearFigureData(void); +// Starting the Data Storage +EXP BOOL WINAPI LKIF_DataStorageStart(void); +// Stopping the Data Storage +EXP BOOL WINAPI LKIF_DataStorageStop(void); +// Initializing the Data Storage +EXP BOOL WINAPI LKIF_DataStorageInit(void); +// Outputting the Data Storage +EXP BOOL WINAPI LKIF_DataStorageGetData(IN int OutNo,IN int NumOutBuffer,OUT LKIF_FLOATVALUE *OutBuffer,OUT int *NumReceived); +// Data Storage Accumulation Status Output +EXP BOOL WINAPI LKIF_DataStorageGetStatus(IN int OutNo,OUT BOOL *IsStorage,OUT int *NumStorageData); +// Receive Light Waveform +EXP BOOL WINAPI LKIF_GetLight(IN int HeadNo,IN int PeekNo,OUT int *MeasurePosition,OUT int *NumReaded,OUT BYTE *Value); + +/////////////////////////////////////////////// +// Change Parameter Command +// +// Display Panel Switch +EXP BOOL WINAPI LKIF_SetPanel(IN int OutNo); +// Set Tolerance +EXP BOOL WINAPI LKIF_SetTolerance(IN int OutNo,IN int UpperLimit,IN int LowerLimit,IN int Hysteresis); +// Set ABLE +typedef enum { + LKIF_ABLEMODE_AUTO, // automatic + LKIF_ABLEMODE_MANUAL, // manual +} LKIF_ABLEMODE; +EXP BOOL WINAPI LKIF_SetAbleMode(IN int HeadNo,IN LKIF_ABLEMODE AbleMode); +// Set ABLE Control Range +EXP BOOL WINAPI LKIF_SetAbleMinMax(IN int HeadNo,IN int Min,IN int Max); +// Set Measurement Mode +typedef enum { + LKIF_MEASUREMODE_NORMAL, // normal + LKIF_MEASUREMODE_HALF_T, // translucent object + LKIF_MEASUREMDOE_TRAN_1, // transparent object + LKIF_MEASUREMODE_TRAN_2, // transparent object 2 + LKIF_MEASUREMODE_MRS, // multireflective object +} LKIF_MEASUREMODE; +EXP BOOL WINAPI LKIF_SetMeasureMode(IN int HeadNo,IN LKIF_MEASUREMODE MeasureMode); +// Set Number of Times of Alarm Processing +EXP BOOL WINAPI LKIF_SetNumAlarm(IN int HeadNo,IN int NumAlarm); +// Set Alarm Level +EXP BOOL WINAPI LKIF_SetAlarmLevel(IN int HeadNo,IN int AlarmLevel); +// Starting the ABLE Calibration +EXP BOOL WINAPI LKIF_AbleStart(IN int HeadNo); +// Finishing the ABLE Calibration +EXP BOOL WINAPI LKIF_AbleStop(void); +// Stopping the ABLE Calibration +EXP BOOL WINAPI LKIF_AbleCancel(void); +// Set Mounting Mode +typedef enum { + LKIF_REFLECTIONMODE_DIFFUSION, // diffuse reflection + LKIF_REFLECTIONMODE_MIRROR, // specular reflection +} LKIF_REFLECTIONMODE; +EXP BOOL WINAPI LKIF_SetReflectionMode(IN int HeadNo,IN LKIF_REFLECTIONMODE ReflectionMode); +// Set Calculation Method +typedef enum { + LKIF_CALCMETHOD_HEADA, // head A + LKIF_CALCMETHOD_HEADB, // head B + LKIF_CALCMETHOD_HEAD_HEADA_PLUS_HEADB, // head A+head B + LKIF_CALCMETHOD_HEAD_HEADA_MINUS_HEADB, // head A-head B + LKIF_CALCMETHOD_HEAD_HEADA_TRANSPARENT, // head A transparent object + LKIF_CALCMETHOD_HEAD_HEADB_TRANSPARENT, // head B transparent object +} LKIF_CALCMETHOD; +// Measurement target +typedef enum { + LKIF_CALCTARGET_PEAK_1, // peak 1 + LKIF_CALCTARGET_PEAK_2, // peak 2 + LKIF_CALCTARGET_PEAK_3, // peak 3 + LKIF_CALCTARGET_PEAK_4, // peak 4 + LKIF_CALCTARGET_PEAK_1_2, // peak 1-peak 2 + LKIF_CALCTARGET_PEAK_1_3, // peak 1-peak 3 + LKIF_CALCTARGET_PEAK_1_4, // peak 1-peak 4 + LKIF_CALCTARGET_PEAK_2_3, // peak 2-peak 3 + LKIF_CALCTARGET_PEAK_2_4, // peak 2-peak 4 + LKIF_CALCTARGET_PEAK_3_4, // peak 3-peak 4 +} LKIF_CALCTARGET; +EXP BOOL WINAPI LKIF_SetCalcMethod(IN int OutNo,IN LKIF_CALCMETHOD CalcMethod,LKIF_CALCTARGET CalcTarget); +// Set Scaling +EXP BOOL WINAPI LKIF_SetScaling(IN int OutNo,IN int HeadNo,IN int InputValue1,IN int OutputValue1,IN int InputValue2,IN int OutputValue2); +// Set Filter Mode +typedef enum { + LKIF_FILTERMODE_MOVING_AVERAGE, // moving average + LKIF_FILTERMODE_LOWPASS, // low pass filter + LKIF_FILTERMODE_HIGHPASS, // high pass filter +} LKIF_FILTERMODE; +EXP BOOL WINAPI LKIF_SetFilterMode(IN int OutNo,OUT LKIF_FILTERMODE FilterMode); +// Set Number of Times for Averaging +typedef enum { + LKIF_AVERAGE_1, // 1 time + LKIF_AVERAGE_4, // + LKIF_AVERAGE_16, // + LKIF_AVERAGE_64, // + LKIF_AVERAGE_256, // + LKIF_AVERAGE_1024, // + LKIF_AVERAGE_4096, // + LKIF_AVERAGE_16384, // + LKIF_AVERAGE_65536, // + LKIF_AVERAGE_262144, // 262144 times +} LKIF_AVERAGE; +EXP BOOL WINAPI LKIF_SetAverage(IN int OutNo,IN LKIF_AVERAGE Average); +// Set Cutoff Frequency +typedef enum { + LKIF_CUTOFFFREQUENCY_1000, // 1000Hz + LKIF_CUTOFFFREQUENCY_300, // 300Hz + LKIF_CUTOFFFREQUENCY_100, // 100Hz + LKIF_CUTOFFFREQUENCY_30, // 30Hz + LKIF_CUTOFFFREQUENCY_10, // 10Hz + LKIF_CUTOFFFREQUENCY_3, // 3Hz + LKIF_CUTOFFFREQUENCY_1, // 1Hz + LKIF_CUTOFFFREQUENCY_0_3, // 0.3Hz + LKIF_CUTOFFFREQUENCY_0_1, // 0.1Hz +} LKIF_CUTOFFFREQUENCY; +EXP BOOL WINAPI LKIF_SetCutOffFrequency(IN int OutNo,IN LKIF_CUTOFFFREQUENCY CutOffFrequency); +// Set Trigger Mode +typedef enum { + LKIF_TRIGGERMODE_EXT1, // external trigger 1 + LKIF_TRIGGERMODE_EXT2, // external trigger 2 +} LKIF_TRIGGERMODE; +EXP BOOL WINAPI LKIF_SetTriggerMode(IN int OutNo,IN LKIF_TRIGGERMODE TriggerMode); +// Set Offset +EXP BOOL WINAPI LKIF_SetOffset(IN int OutNo,IN int Offset); +// Set Analog Output Scaling +EXP BOOL WINAPI LKIF_SetAnalogScaling(IN int OutNo,IN int InputValue1,IN int OutputVoltage1,IN int InputValue2,IN int OutputVoltage2); +// Set Calculation Mode +typedef enum { + LKIF_CALCMODE_NORMAL, // normal + LKIF_CALCMODE_PEAKHOLD, // peak hold + LKIF_CALCMODE_BOTTOMHOLD, // bottom hold + LKIF_CALCMODE_PEAKTOPEAKHOLD, // peak-to-peak hold + LKIF_CALCMODE_SAMPLEHOLD, // sample hold + LKIF_CALCMODE_AVERAGEHOLD, // average hold +} LKIF_CALCMODE; +EXP BOOL WINAPI LKIF_SetCalcMode(IN int OutNo,IN LKIF_CALCMODE CalcMode); +// Set Minimum Display Unit +typedef enum { + LKIF_DISPLAYUNIT_0000_01MM, // 0.01mm + LKIF_DISPLAYUNIT_000_001MM, // 0.001mm + LKIF_DISPLAYUNIT_00_0001MM, // 0.0001mm + LKIF_DISPLAYUNIT_0_00001MM, // 0.00001mm + LKIF_DISPLAYUNIT_00000_1UM, // 0.1um + LKIF_DISPLAYUNIT_0000_01UM, // 0.01um +} LKIF_DISPLAYUNIT; +EXP BOOL WINAPI LKIF_SetDisplayUnit(IN int OutNo,IN LKIF_DISPLAYUNIT DisplayUnit); +// Set Analog-Through +EXP BOOL WINAPI LKIF_SetAnalogThrough(IN int OutNo,IN BOOL IsOn); +// Set Data Storage +typedef enum { + LKIF_TARGETOUT_NONE, // no target OUT + LKIF_TARGETOUT_OUT1, // OUT1 + LKIF_TARGETOUT_OUT2, // OUT2 + LKIF_TARGETOUT_BOTH, // OUT1 and OUT2 +} LKIF_TARGETOUT; +typedef enum { + LKIF_STORAGECYCLE_1, // sampling rate x 1 + LKIF_STORAGECYCLE_2, // sampling rate x 2 + LKIF_STORAGECYCLE_5, // sampling rate x 5 + LKIF_STORAGECYCLE_10, // sampling rate x 10 + LKIF_STORAGECYCLE_20, // sampling rate x 20 + LKIF_STORAGECYCLE_50, // sampling rate x 50 + LKIF_STORAGECYCLE_100, // sampling rate x 100 + LKIF_STORAGECYCLE_200, // sampling rate x 200 + LKIF_STORAGECYCLE_500, // sampling rate x 500 + LKIF_STORAGECYCLE_1000, // sampling rate x 1000 +} LKIF_STORAGECYCLE; +EXP BOOL WINAPI LKIF_SetDataStorage(IN LKIF_TARGETOUT TargetOut,IN int NumStorage,IN LKIF_STORAGECYCLE StorageCycle); +// Set Sampling Rate +typedef enum { + LKIF_SAMPLINGCYCLE_20USEC, // 20us + LKIF_SAMPLINGCYCLE_50USEC, // 50us + LKIF_SAMPLINGCYCLE_100USEC, // 100us + LKIF_SAMPLINGCYCLE_200USEC, // 200us + LKIF_SAMPLINGCYCLE_500USEC, // 500us + LKIF_SAMPLINGCYCLE_1MSEC, // 1ms +} LKIF_SAMPLINGCYCLE; +EXP BOOL WINAPI LKIF_SetSamplingCycle(IN LKIF_SAMPLINGCYCLE SamplingCycle); +// Set Mutual Interference Prevention +EXP BOOL WINAPI LKIF_SetMutualInterferencePrevention(IN BOOL IsOn); +// Set Timing Synchronization +typedef enum { + LKIF_SYNCHRONIZATION_ASYNCHRONOUS, // asynchronous + LKIF_SYNCHRONIZATION_SYNCHRONIZED, // synchronous +} LKIF_SYNCHRONIZATION; +EXP BOOL WINAPI LKIF_SetTimingSynchronization(IN LKIF_SYNCHRONIZATION Synchronization); +// Set Comparator Output Format +typedef enum { + LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT_NORMAL, // normal + LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT_HOLD, // hold + LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT_OFF_DELAY, // off-delay +} LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT; +EXP BOOL WINAPI LKIF_SetToleranceComparatorOutputFormat(IN LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT ToleranceComparatorOutputFormat); +// Set Strobe Time +typedef enum { + LKIF_STOROBETIME_2MS, // 2ms + LKIF_STOROBETIME_5MS, // 5ms + LKIF_STOROBETIME_10MS, // 10ms + LKIF_STOROBETIME_20MS, // 20ms +} LKIF_STOROBETIME; +EXP BOOL WINAPI LKIF_SetStorobeTime(IN LKIF_STOROBETIME StorobeTime); +/////////////////////////////////////////////// +// Check Parameter Command +// +// Display Panel Check +EXP BOOL WINAPI LKIF_GetPanel(OUT int *OutNo); +// Get Tolerance +EXP BOOL WINAPI LKIF_GetTolerance(IN int OutNo,OUT int *UpperLimit,OUT int *LowerLimit,OUT int *Hysteresis); +// Get ABLE +EXP BOOL WINAPI LKIF_GetAbleMode(IN int HeadNo,OUT LKIF_ABLEMODE *AbleMode); +// ABLE Control Range +EXP BOOL WINAPI LKIF_GetAbleMinMax(IN int HeadNo,OUT int *Min,OUT int *Max); +// Get Measurement Mode +EXP BOOL WINAPI LKIF_GetMeasureMode(IN int HeadNo,OUT LKIF_MEASUREMODE *MeasureMode); +// Get Number of Times of Alarm Processing +EXP BOOL WINAPI LKIF_GetNumAlarm(IN int HeadNo,OUT int *NumAlarm); +// Get Alarm Level +EXP BOOL WINAPI LKIF_GetAlarmLevel(IN int HeadNo,OUT int *AlarmLevel); +// Get Mounting Mode +EXP BOOL WINAPI LKIF_GetReflectionMode(IN int HeadNo,OUT LKIF_REFLECTIONMODE *ReflectionMode); +// Get Calculation Method +EXP BOOL WINAPI LKIF_GetCalcMethod(IN int OutNo,OUT LKIF_CALCMETHOD *CalcMethod,LKIF_CALCTARGET *CalcTarget); +// Get Scaling +EXP BOOL WINAPI LKIF_GetScaling(IN int OutNo,IN int HeadNo,OUT int *InputValue1,OUT int *OutputValue1,OUT int *InputValue2,OUT int *OutputValue2); +// Get Filter Mode +EXP BOOL WINAPI LKIF_GetFilterMode(IN int OutNo,OUT LKIF_FILTERMODE *FilterMode); +// Get Number of Times for Averaging +EXP BOOL WINAPI LKIF_GetAverage(IN int OutNo,OUT LKIF_AVERAGE *Average); +// Get Cutoff Frequency +EXP BOOL WINAPI LKIF_GetCutOffFrequency(IN int OutNo,OUT LKIF_CUTOFFFREQUENCY *CutOffFrequency); +// Get Trigger Mode +EXP BOOL WINAPI LKIF_GetTriggerMode(IN int OutNo,OUT LKIF_TRIGGERMODE *TriggerMode); +// Get Offset +EXP BOOL WINAPI LKIF_GetOffset(IN int OutNo,IN int *Offset); +// Get Analog Output Scaling +EXP BOOL WINAPI LKIF_GetAnalogScaling(IN int OutNo,OUT int *InputValue1,OUT int *OutputVoltage1,OUT int *InputValue2,OUT int *OutputVoltage2); +// Get Calculation Mode +EXP BOOL WINAPI LKIF_GetCalcMode(IN int OutNo,OUT LKIF_CALCMODE *CalcMode); +// Get Minimum Display Unit +EXP BOOL WINAPI LKIF_GetDisplayUnit(IN int OutNo,OUT LKIF_DISPLAYUNIT *DisplayUnit); +// Analog-Through +EXP BOOL WINAPI LKIF_GetAnalogThrough(IN int OutNo,OUT BOOL *IsOn); +// Get Data Storage +EXP BOOL WINAPI LKIF_GetDataStorage(IN LKIF_TARGETOUT *TargetOut,OUT int *NumStorage,OUT LKIF_STORAGECYCLE *StorageCycle); +// Get Sampling Rate +EXP BOOL WINAPI LKIF_GetSamplingCycle(OUT LKIF_SAMPLINGCYCLE *SamplingCycle); +// Get Mutual Interference Prevention +EXP BOOL WINAPI LKIF_GetMutualInterferencePrevention(OUT BOOL *IsOn); +// Get Timing Synchronization +EXP BOOL WINAPI LKIF_GetTimingSynchronization(OUT LKIF_SYNCHRONIZATION *Synchronization); +// Get Comparator Output Format +EXP BOOL WINAPI LKIF_GetToleranceComparatorOutputFormat(OUT LKIF_TOLERANCE_COMPARATOR_OUTPUT_FORMAT *ToleranceComparatorOutputFormat); +// Get Strobe Time +EXP BOOL WINAPI LKIF_GetStorobeTime(OUT LKIF_STOROBETIME *StorobeTime); +/////////////////////////////////////////////// +// Mode Change Command +// +// Mode Switch +typedef enum { + LKIF_MODE_NORMAL, // normal mode + LKIF_MODE_COMMUNICATION, // setting mode +} LKIF_MODE; +EXP BOOL WINAPI LKIF_SetMode(IN LKIF_MODE Mode); +} // extern "C" + +#endif // LKIF_INCLUDED \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_EVENTHANDLER.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_EVENTHANDLER.H new file mode 100644 index 0000000..f8e79cb --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_EVENTHANDLER.H @@ -0,0 +1,35 @@ +#pragma once +// List of events which the driver can notify user code for +enum AxisBoardEvent +{ + AXBD_PROBED_POINT = 0, + AXBD_PROBE_TIP_CHANGE, + AXBD_INPUT_LINE, + AXBD_OPTICAL_EDGE, + AXBD_LOG_DOUBLES, // Debug message sent from DSP + AXBD_FOLLOWING_ERROR, + AXBD_CONTINUATION_ZONE, + AXBD_ZOOM_MOVE_COMPLETED, + AXBD_REF_MARK, + AXBD_NULL_EVENT, + AXBD_LOG_UNSIGNED_SHORTS, // Debug message sent from DSP + AXBD_LAF_EDGE, + AXBD_DSP_STARTED, // For internal use only - signals DSP code fully loaded + AXBD_SOFTWARE_FENCE_HIT, + AXBD_AUTO_TUNE_DATA, + AXBD_AUTO_TUNE_RESULTS, + AXBD_AUTO_TUNE_MOVING, +}; + +////////////////////////////////////////////////////////////////////// +// +// HAL_EventHandler.h : interface for the event handler function +// +////////////////////////////////////////////////////////////////////// + +//void ZoomEvent(bool bIn, bool bFineMode); +//bool IsInputActive(int Input, unsigned short *Data); +//bool IsInputLevelHigh(int Input, unsigned short *Data); +//void EventHandler(AxisBoardEvent Event, unsigned long UserData, unsigned short *Data, int DataNum); +//HAL_STATUS HAL_WaitMoveComplete(DWORD WaitTimeout, bool WaitOptics); +//HAL_STATUS HAL_SetOutput(HAL_OUTPUT Output, bool State); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.CPP new file mode 100644 index 0000000..fc03698 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.CPP @@ -0,0 +1,16 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_Fixture.cpp : interface for the Fixture related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" +#include "HAL.h" +#include "HSI.h" + +HAL_STATUS HAL_Fixture_IsSupported(UINT &Type) +{ + Type = 0; + HAL_SendDebug(_T("HAL_Fixture_IsSupported %X\n"), Type); + return HAL_STATUS_NOT_SUPPORTED; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.H new file mode 100644 index 0000000..be06920 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_FIXTURE.H @@ -0,0 +1,9 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_Fixture.h : interface for the Fixture related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_Fixture_IsSupported(UINT &Type); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.CPP new file mode 100644 index 0000000..f48c8fb --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.CPP @@ -0,0 +1,602 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_Illumination.cpp : interface for the Illumination related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "..\include\resource.h" + +#include "HAL.h" +#include "HSI.h" + +double Intensity[HAL_ILLUMINATION_MAX_LAMPS][HAL_ILLUMINATION_MAX_BULBS]; +bool State[HAL_ILLUMINATION_MAX_LAMPS][HAL_ILLUMINATION_MAX_BULBS]; +//unsigned short LastLevelSent[HAL_ILLUMINATION_MAX_LAMPS][HAL_ILLUMINATION_MAX_BULBS]; + +extern CHAL *g_pHSI; +extern CHALMicroVuExt g_HSIExt; +extern CMv_Proto *g_pMv_Proto; + + +////////////////////////////////////////////////////////////////////// +bool IsTopLight(int nLamp) +{ + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_EXCEL: + case HAL_MACHINE_TYPE_VECTRA: + default: + if(nLamp == 0) + return true; + else + return false; + break; + } +} + + +////////////////////////////////////////////////////////////////////// +bool IsBottomLight(int nLamp) +{ + UNREFERENCED_PARAMETER(nLamp); + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_VECTRA: + case HAL_MACHINE_TYPE_EXCEL: + default: + if(nLamp == 1) + return true; + else + return false; + break; + } + return false; +} + + +////////////////////////////////////////////////////////////////////// +bool IsRingLight(int nLamp) +{ + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_VECTRA: + case HAL_MACHINE_TYPE_EXCEL: + default: + if(nLamp == 2) + return true; + else + return false; + break; + } +} +// Map a lamp from the PCDMIS ring light to the MicroVu ring light +// MV start with the inner ring. The first or zero lamp is at 12 oclock and goes CCW +// PCD starts with the outer ring. The first or zero lamp is at 12 oclock and goes CW +////////////////////////////////////////////////////////////////////// +int PCDRingBulbToMicroVu_8x5(int Lamp) +{ + switch(Lamp) + { + case 0: + return 32; + case 1: + return 39; + case 2: + return 38; + case 3: + return 37; + case 4: + return 36; + case 5: + return 35; + case 6: + return 34; + case 7: + return 33; + + case 8: + return 24; + case 9: + return 31; + case 10: + return 30; + case 11: + return 29; + case 12: + return 28; + case 13: + return 27; + case 14: + return 26; + case 15: + return 25; + + case 16: + return 16; + case 17: + return 23; + case 18: + return 22; + case 19: + return 21; + case 20: + return 20; + case 21: + return 19; + case 22: + return 18; + case 23: + return 17; + + case 24: + return 8; + case 25: + return 15; + case 26: + return 14; + case 27: + return 13; + case 28: + return 12; + case 29: + return 11; + case 30: + return 10; + case 31: + return 9; + + case 32: + return 0; + case 33: + return 7; + case 34: + return 6; + case 35: + return 5; + case 36: + return 4; + case 37: + return 3; + case 38: + return 2; + case 39: + return 1; + } + ASSERT(0); + return 0; +} + +// Map a lamp from the PCDMIS ring light to the MicroVu ring light +// MV start with the inner ring. The first or zero lamp is at 12 oclock and goes CCW +// PCD starts with the outer ring. The first or zero lamp is at 12 oclock and goes CW +////////////////////////////////////////////////////////////////////// +int PCDRingBulbToMicroVu_8x2(int Lamp) +{ + switch(Lamp) + { + case 0: + return 8; + case 1: + return 9; + case 2: + return 10; + case 3: + return 11; + case 4: + return 12; + case 5: + return 13; + case 6: + return 14; + case 7: + return 15; + case 8: + return 0; + case 9: + return 1; + case 10: + return 2; + case 11: + return 3; + case 12: + return 4; + case 13: + return 5; + case 14: + return 6; + case 15: + return 7; + } + ASSERT(0); + return 0; +} + +// Map a lamp from the PCDMIS ring light to the MicroVu ring light +// MV start with the inner ring. The first or zero lamp is at 12 oclock and goes CCW +// PCD starts with the outer ring. The first or zero lamp is at 12 oclock and goes CW +////////////////////////////////////////////////////////////////////// +int PCDRingBulbToMicroVu(int Lamp) +{ + if ((g_HSIExt.m_NumRings == 2) && (g_HSIExt.m_NumSegs == 8)) + { + PCDRingBulbToMicroVu_8x2(Lamp); + } + else + if ((g_HSIExt.m_NumRings == 3) && (g_HSIExt.m_NumSegs == 8)) + { + PCDRingBulbToMicroVu_8x5(Lamp); + } + else + { + PCDRingBulbToMicroVu_8x5(Lamp); + }; + return 0; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_IsSupported(UINT &Type) +{ + Type = HAL_ILLUMINATION_SUPPORTS_DCC_CONTROL; + + HAL_SendDebug(_T("HAL_Illumination_IsSupported %X\n"), Type); + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_Startup( ) +{ + memset(Intensity, 0, sizeof(Intensity)); + memset(State, 1, sizeof(State)); + + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_EXCEL: + case HAL_MACHINE_TYPE_VECTRA: + g_pMv_Proto->mv_light_set_light_off(); + break; + } + + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_GetLampCount( int &nLamps ) +{ + UINT NumLamps = 0; + + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_EXCEL: + case HAL_MACHINE_TYPE_VECTRA: + NumLamps = 4; + break; + } + + ASSERT(NumLamps <= HAL_ILLUMINATION_MAX_LAMPS); + + nLamps = NumLamps; + + HAL_SendDebug(_T("HAL_Illumination_GetLampCount %d\n"), NumLamps); + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_GetLampInfo( int nLamp, TCHAR LampName[HAL_MaxLampNameLength+1], TCHAR LampDescription[HAL_MaxLampDescriptionLength+1], + enum HAL_ILLUMINATION_LAMP_LOCATION_TYPE &LocationType, int &LocationAngle, + enum HAL_ILLUMINATION_BULB_TYPE &BulbType, + enum HAL_ILLUMINATION_BULB_CONTROL_TYPE &BulbControlType, + enum HAL_ILLUMINATION_INTENSITY_CONTROL_TYPE &IntensityControlType, + int &NumColors, COLORREF *Colors, + int &NumRings, int *NumSectors, + double &MinAngle, double &MaxAngle, + bool &bCanBeCalibrated) +{ + if(IsTopLight(nLamp)) + { + LocationType = HAL_ILLUMINATION_LAMP_LOCATION_TOP_ON_AXIS; + BulbType = HAL_ILLUMINATION_BULB_ROUND; + BulbControlType = HAL_ILLUMINATION_BULB_CONTROL_BY_LAMP; + IntensityControlType = HAL_ILLUMINATION_INTENSITY_CONTROL_BY_LAMP; + CString LampNameStr; + LampNameStr.LoadString(IDS_ILLUMINATION_TOP); + wcsncpy_s(LampName, HAL_MaxLampNameLength+1, LampNameStr, HAL_MaxLampNameLength); + wcsncpy_s(LampDescription, HAL_MaxLampDescriptionLength+1, _T("MicroVu Coaxial Light"), HAL_MaxLampDescriptionLength); + NumColors = 1; + Colors[0] = RGB(255, 255, 255); + NumRings = 0; + NumSectors = 0; + LocationAngle = 0; + MinAngle = 0.0; + MaxAngle = 0.0; + bCanBeCalibrated = true; + } + + if(IsBottomLight(nLamp)) + { + LocationType = HAL_ILLUMINATION_LAMP_LOCATION_BOTTOM; + BulbType = HAL_ILLUMINATION_BULB_ROUND; + BulbControlType = HAL_ILLUMINATION_BULB_CONTROL_BY_LAMP; + IntensityControlType = HAL_ILLUMINATION_INTENSITY_CONTROL_BY_LAMP; + CString LampNameStr; + LampNameStr.LoadString(IDS_ILLUMINATION_BTM); + wcsncpy_s(LampName,HAL_MaxLampNameLength+1,LampNameStr,HAL_MaxLampNameLength); + wcsncpy_s(LampDescription,HAL_MaxLampDescriptionLength+1,_T("MicroVu Backlight (Green)"),HAL_MaxLampDescriptionLength); + NumColors = 1; + Colors[0] = RGB(255, 255, 255); + NumRings = 0; + NumSectors = 0; + LocationAngle = 0; + MinAngle = 0.0; + MaxAngle = 0.0; + bCanBeCalibrated = true; + } + + if(IsRingLight(nLamp)) + { + LocationType = HAL_ILLUMINATION_LAMP_LOCATION_TOP_ANGLED; + BulbType = HAL_ILLUMINATION_BULB_RING; + BulbControlType = HAL_ILLUMINATION_BULB_CONTROL_BY_BULB; + IntensityControlType = HAL_ILLUMINATION_INTENSITY_CONTROL_BY_BULB; + + CString LampNameStr; + LampNameStr.LoadString(IDS_ILLUMINATION_RNG); + wcsncpy_s(LampName, HAL_MaxLampNameLength+1, LampNameStr, HAL_MaxLampNameLength); + wcsncpy_s(LampDescription, HAL_MaxLampDescriptionLength+1, _T("MicroVu Ringlight"), HAL_MaxLampDescriptionLength); + NumColors = 1; + Colors[0] = RGB(255, 255, 255); + + NumRings = g_HSIExt.m_NumRings; + for(int i = 0 ; i < NumRings ; i++) + NumSectors[i] = g_HSIExt.m_NumSegs; + + LocationAngle = 0; + + MinAngle = 0.0; + MaxAngle = 0.0; + + bCanBeCalibrated = true; + } + + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +int GetLampNumberFromLocation(const enum HAL_ILLUMINATION_LAMP_LOCATION_TYPE SearchLocationType) +{ + for(int nLamp=0;nLampmv_set_ringlight_data(TWO_RINGS * EIGHT_SEGS, g_HSIExt.m_LampOutputLevelForMVRing_2x8); + + double dBottomIntensity = (g_HSIExt.m_LampOutputState_2x8[1][0])?g_HSIExt.m_LampOutputLevel_2x8[1][0]:0.0; + double dTopIntensity = (g_HSIExt.m_LampOutputState_2x8[0][0])?g_HSIExt.m_LampOutputLevel_2x8[0][0]:0.0; + g_pMv_Proto->mv_light_set_lamp_state(dBottomIntensity,dTopIntensity); + g_pMv_Proto->mv_light_set_light(); + +#pragma message("We need to determine a good value for the wait") + Sleep(60); + + // Only wait if we've been asked to wait, and one of the lamps has changed in this set of changes, + // and this is the last lamp + if(bWait) + { +#pragma message("Testing needs to be done to find a good lighting delay, if any") + int Time=(int)(g_HSIExt.m_IllumSettleTime * 1000.0); + CString TimeStr; + TimeStr.Format(_T("HAL_Illumination_SetLampState MaxLevelChange %d so sleeping for %fs\n"),MaxLevelChange,(double)Time/1000.0); + HAL_SendDebug(TimeStr); + Sleep(Time); // A totally off to totally on switch would give max of 500ms + MaxLevelChange=0; + } + + return HAL_STATUS_NORMAL; +}; + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_SetLampState_5x8( int nLamp, bool *bBulbStates, double *Intensities, + int /*Color*/, double /*Angle*/, bool bWait ) +{ + static unsigned short MaxLevelChange = 0; + + if(IsTopLight(nLamp)) + { + g_HSIExt.m_LampOutputState_5x8[nLamp][0] = bBulbStates[0]; + g_HSIExt.m_LampOutputLevel_5x8[nLamp][0] = Intensities[0]; + } + + if(IsBottomLight(nLamp)) + { + g_HSIExt.m_LampOutputState_5x8[nLamp][0] = bBulbStates[0]; + g_HSIExt.m_LampOutputLevel_5x8[nLamp][0] = Intensities[0]; + } + + if(IsRingLight(nLamp)) + { + for(int Bulb = 0 ; Bulb < TWO_RINGS*EIGHT_SEGS ; Bulb++) + { + g_HSIExt.m_LampOutputState_5x8[nLamp][Bulb] = bBulbStates[Bulb]; + g_HSIExt.m_LampOutputLevel_5x8[nLamp][Bulb] = Intensities[Bulb]; + g_HSIExt.m_LampOutputLevelForMVRing_5x8[PCDRingBulbToMicroVu(Bulb)] = bBulbStates[Bulb]?Intensities[Bulb]:0.0; + } + } + g_pMv_Proto->mv_set_ringlight_data(FIVE_RINGS * EIGHT_SEGS, g_HSIExt.m_LampOutputLevelForMVRing_5x8); + + double dBottomIntensity = (g_HSIExt.m_LampOutputState_5x8[1][0])?g_HSIExt.m_LampOutputLevel_5x8[1][0]:0.0; + double dTopIntensity = (g_HSIExt.m_LampOutputState_5x8[0][0])?g_HSIExt.m_LampOutputLevel_5x8[0][0]:0.0; + g_pMv_Proto->mv_light_set_lamp_state(dBottomIntensity,dTopIntensity); + g_pMv_Proto->mv_light_set_light(); + +#pragma message("We need to determine a good value for the wait") + Sleep(60); + + // Only wait if we've been asked to wait, and one of the lamps has changed in this set of changes, + // and this is the last lamp + if(bWait) + { +#pragma message("Testing needs to be done to find a good lighting delay, if any") + int Time=(int)(g_HSIExt.m_IllumSettleTime * 1000.0); + CString TimeStr; + TimeStr.Format(_T("HAL_Illumination_SetLampState MaxLevelChange %d so sleeping for %fs\n"),MaxLevelChange,(double)Time/1000.0); + HAL_SendDebug(TimeStr); + Sleep(Time); // A totally off to totally on switch would give max of 500ms + MaxLevelChange=0; + } + + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Illumination_SetLampState( int nLamp, bool *bBulbStates, double *Intensities, + int /*Color*/, double /*Angle*/, bool bWait ) +{ + if ((g_HSIExt.m_NumRings == 2) && (g_HSIExt.m_NumSegs == 8)) + { + HAL_Illumination_SetLampState_2x8(nLamp, bBulbStates, Intensities, 0, 0.0, bWait); + } + else + if ((g_HSIExt.m_NumRings == 5) && (g_HSIExt.m_NumSegs == 8)) + { + HAL_Illumination_SetLampState_5x8(nLamp, bBulbStates, Intensities, 0, 0.0, bWait); + } + else + { + HAL_Illumination_SetLampState_5x8(nLamp, bBulbStates, Intensities, 0, 0.0, bWait); + }; + return HAL_STATUS_NORMAL; +} + +HAL_STATUS HAL_Illumination_Shutdown( ) +{ + g_pMv_Proto->mv_light_set_light_off(); + return HAL_STATUS_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.H new file mode 100644 index 0000000..fa72b17 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_ILLUMINATION.H @@ -0,0 +1,41 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_Illumination.h : interface for the Illumination related functions +// +////////////////////////////////////////////////////////////////////// + +bool IsTopLight(int nLamp); +bool IsBottomLight(int nLamp); +bool IsRingLight(int nLamp); +int PCDRingBulbToMicroVu(int Lamp); +int PCDRingBulbToMicroVu_8x2(int Lamp); +int PCDRingBulbToMicroVu_8x5(int Lamp); +HAL_STATUS HAL_Illumination_IsSupported(UINT &Type); +HAL_STATUS HAL_Illumination_Startup(void); +HAL_STATUS HAL_Illumination_GetLampCount(int &nLamps); +HAL_STATUS HAL_Illumination_GetLampInfo(int nLamp, TCHAR LampName[HAL_MaxLampNameLength+1], + TCHAR LampDescription[HAL_MaxLampDescriptionLength+1], + enum HAL_ILLUMINATION_LAMP_LOCATION_TYPE &LocationType, + int &LocationAngle, + enum HAL_ILLUMINATION_BULB_TYPE &BulbType, + enum HAL_ILLUMINATION_BULB_CONTROL_TYPE &BulbControlType, + enum HAL_ILLUMINATION_INTENSITY_CONTROL_TYPE &IntensityControlType, + int &NumColors, COLORREF *Colors, + int &NumRings, int *NumSectors, + double &MinAngle, double &MaxAngle, + bool &bCanBeCalibrated); +HAL_STATUS HAL_Illumination_GetLampState(int nLamp, bool *bBulbStates, double *Intensities, + int & Color, double & Angle); +HAL_STATUS HAL_Illumination_GetLampState_2x8(int nLamp, bool *bBulbStates, double *Intensities, + int & Color, double & Angle); +HAL_STATUS HAL_Illumination_GetLampState_5x8(int nLamp, bool *bBulbStates, double *Intensities, + int & Color, double & Angle); +HAL_STATUS HAL_Illumination_SetLampState(int nLamp, bool *bBulbStates, double *Intensities, + int Color, double Angle, bool bWait); +HAL_STATUS HAL_Illumination_SetLampState_2x8(int nLamp, bool *bBulbStates, double *Intensities, + int Color, double Angle, bool bWait); +HAL_STATUS HAL_Illumination_SetLampState_5x8(int nLamp, bool *bBulbStates, double *Intensities, + int Color, double Angle, bool bWait); +HAL_STATUS HAL_Illumination_Shutdown(void); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.CPP new file mode 100644 index 0000000..7411fce --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.CPP @@ -0,0 +1,195 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_LaserProbe.cpp : interface for the Laser Probe related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "HAL.h" +#include "HSI.h" +#include "HAL_Motion.h" +#include "HAL_Pendant.h" +#include "HAL_LaserProbe.h" + +extern CHAL *g_pHSI; +extern CHALMicroVuExt g_HSIExt; + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_IsSupported(UINT &Type) +{ + switch(g_HSIExt.m_ActiveMachineType) + { + case HAL_MACHINE_TYPE_EXCEL: + case HAL_MACHINE_TYPE_VECTRA: + default: + Type = HAL_LP_SUPPORTS_NONE; + break; + } + + HAL_SendDebug(_T("HAL_LP_IsSupported %X\n"), Type); + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_Startup() +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + UINT Supports = 0; + HAL_LP_IsSupported(Supports); + return Status; +} + +HAL_STATUS HAL_LP_Enable(bool bEnable) +{ + UNREFERENCED_PARAMETER(bEnable); + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_IsEnabled(bool &bEnabled) +{ + UNREFERENCED_PARAMETER(bEnabled); + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +////////////////////////////////////////////////////////////////////// +void HAL_LP_SendQualityFeedback(int SignalQuality) +{ + UINT eventCallbackID=0; + TCHAR EventData[HAL_MaxStringLength+1]; + CString Quality; + Quality.Format(_T("%d"), SignalQuality); + wcsncpy_s(EventData, _countof(EventData), Quality, HAL_MaxStringLength); + + g_pHSI->Event(HAL_EVENT_FUNCTION, HAL_EVENT_LP_QUALITY, EventData, eventCallbackID); +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_GetActiveProbe(int & /*nProbe*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_SetActiveProbe(int nProbe) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + switch(nProbe) + { + case -1: + Status = HAL_LP_Enable(false); + break; + + default: + if(g_HSIExt.m_OptimetInit) + { + g_HSIExt.m_ActiveProbe = APT_LASER; + SetupPendantSpeeds(); + + HAL_LP_LoadLens(); + } + break; + } + + return Status; +} + +////////////////////////////////////////////////////////////////////// +void HAL_LP_LoadLens() +{ +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_SetupMeasurePoint(CHALLPMeasurePoint *pParams) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(IsBoardPresent()) + { + if(pParams) + { + // Probe position + g_HSIExt.m_ProbeMeasPointStart[0] = pParams->m_MeasPoint.m_X; + g_HSIExt.m_ProbeMeasPointStart[1] = pParams->m_MeasPoint.m_Y; + g_HSIExt.m_ProbeMeasPointStart[2] = pParams->m_MeasPoint.m_Z; + + g_HSIExt.m_OptimetGain = pParams->m_Gain; + g_HSIExt.m_OptimetFreq = pParams->m_Frequency; + g_HSIExt.m_OptimetQualityThreshold = pParams->m_QualityThreshold; + + if(g_HSIExt.m_OptimetMag != pParams->m_AuxLens) + { + g_HSIExt.m_OptimetMag = pParams->m_AuxLens; + HAL_LP_LoadLens(); + } + } + } + else + Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_DoMeasure(bool /*bWait*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + // Move to probe position + Status = HAL_Motion_SetPositionXYZ(HAL_MOTION_AXIS_X|HAL_MOTION_AXIS_Y|HAL_MOTION_AXIS_Z, + g_HSIExt.m_ProbeMeasPointStart[0], + g_HSIExt.m_ProbeMeasPointStart[1], + g_HSIExt.m_ProbeMeasPointStart[2], + HAL_MOTION_MOVE_WAIT, 0.0); + + if(g_HSIExt.m_OptimetInit && Status == HAL_STATUS_NORMAL) + { + // Make sure laser is enabled + bool LaserEnabled; + Status = HAL_LP_IsEnabled(LaserEnabled); + if(!LaserEnabled) + Status = HAL_LP_Enable(true); + } + // Measure single point +// /*BOOL result = */FifoReadMeasurement(&g_HSIExt.m_OptimetMeasPt); + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_GetMeasureData(CHALMeasPoint &LPData) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + // Return probed point +// LPData.m_X = g_HSIExt.m_LaserMeasPoint.m_data[HAL_AXIS_X]; +// LPData.m_Y = g_HSIExt.m_LaserMeasPoint.m_data[HAL_AXIS_Y]; +// LPData.m_Z = g_HSIExt.m_LaserMeasPoint.m_data[HAL_AXIS_Z]; + LPData.m_I = 0; + LPData.m_J = 0; + LPData.m_K = 1; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_LP_Shutdown() +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(g_HSIExt.m_OptimetInit) + { + if(IsBoardPresent() && *g_pHSI->Ctrl[Ctrl_LaserProbe]) + HAL_LP_Enable(false); + +// FifoTerminate(); + } + return Status; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.H new file mode 100644 index 0000000..1f5a52e --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_LASERPROBE.H @@ -0,0 +1,20 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_LaserProbe.h : interface for the Laser Probe related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_LP_IsSupported(UINT &Type); +HAL_STATUS HAL_LP_Startup(void); +HAL_STATUS HAL_LP_Enable(bool bEnable); +HAL_STATUS HAL_LP_IsEnabled(bool &bEnabled); +void HAL_LP_SendQualityFeedback(int SignalQuality); +HAL_STATUS HAL_LP_GetActiveProbe(int &nProbe); +HAL_STATUS HAL_LP_SetActiveProbe(int nProbe); +void HAL_LP_LoadLens(void); +HAL_STATUS HAL_LP_SetupMeasurePoint(CHALLPMeasurePoint *pParams); +HAL_STATUS HAL_LP_DoMeasure(bool bWait); +HAL_STATUS HAL_LP_GetMeasureData(CHALMeasPoint &LPData); +HAL_STATUS HAL_LP_Shutdown(void); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.CPP new file mode 100644 index 0000000..2286baf --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.CPP @@ -0,0 +1,213 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_Motion.cpp : interface for the Motion related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "HAL.h" +#include "HSI.h" + +extern CHAL *g_pHSI; +extern CLogger *g_pLogger; +extern CHALMicroVuExt g_HSIExt; +extern CMv_Proto *g_pMv_Proto; +//extern HANDLE hEventEStop; + +extern double TimeInMsecs(void); + +//extern HANDLE hMotionInitDoneEvent; +static double PositionSampleTime = 3.0; + +//=========================================================================================================== +void HAL_Motion_HomeStatus(bool &bHomed) +{ + bHomed = g_pMv_Proto->mv_motion_is_homed(); + return; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_IsSupported(UINT &Type) +{ + static int isDCC = -1; + Type = HAL_MOTION_SUPPORTS_MANUAL_CONTROL|HAL_MOTION_SUPPORTS_HOMING | HAL_MOTION_SUPPORTS_DCC_CONTROL; + return HAL_STATUS_NORMAL; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_Startup( bool /*bHome*/ ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + // g_HSIExt.m_ActiveMachineType = HAL_MACHINE_TYPE_EXCEL; + // If the machine type hasn't been selected then exit the initialisation +#pragma message("what is the correct return status if no machine type selected") + if(g_HSIExt.m_ActiveMachineType == -1) + return Status; + return Status; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetAxisCount( enum HAL_MOTION_AXIS_TYPE AxisType, int &nAxis ) +{ + switch(AxisType) + { + case HAL_MOTION_AXIS_X: + case HAL_MOTION_AXIS_Y: + case HAL_MOTION_AXIS_Z: + nAxis = 1; + break; + case HAL_MOTION_AXIS_R: + default: + nAxis = 0; + break; + } + HAL_SendDebug(_T("HAL_Motion_GetAxisCount %d\n"), nAxis); + return HAL_STATUS_NORMAL; +} + + +//=========================================================================================================== +HAL_STATUS HAL_Motion_SetSpeedXYZ( double dSpeed ) +{ + g_pMv_Proto->mv_motion_set_speed_xyz(dSpeed); + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetSpeedXYZ( double &dSpeed ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + g_pMv_Proto->mv_motion_get_speed_xyz(dSpeed); + return Status; +} + +////=========================================================================================================== +//HAL_STATUS HAL_Motion_SetSpeedXYZ1( double SpeedX, double SpeedY, double SpeedZ ) +//{ +// HAL_STATUS Status = HAL_STATUS_NORMAL; +// long lSpeedX = (long) SpeedX; +// long lSpeedY = (long) SpeedY; +// long lSpeedZ = (long) SpeedZ; +// g_pMv_Proto->mv_motion_set_speed_xyz(lSpeedX, lSpeedY, lSpeedZ); +// return Status; +//} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetSpeedR( double & /*Speed*/ ) +{ + return HAL_STATUS_NOT_SUPPORTED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_SetSpeedR( double /*Speed*/ ) +{ + HAL_STATUS Status = HAL_STATUS_NOT_SUPPORTED; + return Status; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetAccelerationXYZ( double &AccelX, double &AccelY, double &AccelZ ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_SetAccelerationXYZ( double AccelX, double AccelY, double AccelZ ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetAccelerationR( double & /*AccelR*/ ) +{ + return HAL_STATUS_NOT_SUPPORTED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_SetAccelerationR( double /*AccelQ*/ ) +{ + return HAL_STATUS_NOT_SUPPORTED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetPositionXYZ( UINT /*GetAxisTypes*/, double &PositionX, double &PositionY, double &PositionZ, double &Time) +{ + SSI_STATUS Status = g_pMv_Proto->mv_motion_get_position_xyz(PositionX, PositionY, PositionZ); + Time = TimeInMsecs(); + return (Status == SSI_STATUS_NORMAL)?HAL_STATUS_NORMAL:HAL_STATUS_FAILED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_SetPositionXYZ( UINT /*SetAxisType*/, double PositionX, double PositionY, double PositionZ, enum HAL_MOTION_MOVE_TYPE eType, double /*flyRadius*/) +{ + bool bWait = (eType == HAL_MOTION_MOVE_WAIT)?true:false; + SSI_STATUS Status = g_pMv_Proto->mv_motion_set_position_xyz(PositionX, PositionY, PositionZ, bWait); + return (Status == SSI_STATUS_NORMAL)?HAL_STATUS_NORMAL:HAL_STATUS_FAILED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetPositionR( UINT /*GetAxisTypes*/, double & /*PositionR*/, double & /*Time*/ ) +{ + g_pMv_Proto->mv_motion_get_position_r(); + return HAL_STATUS_NOT_SUPPORTED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetSettleTime( double &SettleTime ) +{ + SettleTime=g_HSIExt.m_StageSettleTime; + return HAL_STATUS_NORMAL; +} + +////=========================================================================================================== +HAL_STATUS HAL_Motion_GetDeadband( double &DeadbandX, double &DeadbandY, double &DeadbandZ, double &DeadbandR ) +{ + HAL_STATUS retVal=HAL_STATUS_NOT_SUPPORTED; + return retVal; +} + +////=========================================================================================================== +HAL_STATUS HAL_Motion_GetRefreshDeadband( double &Deadband ) +{ // not used because the controller will set this automatically + HAL_STATUS retVal=HAL_STATUS_NOT_SUPPORTED; + return retVal; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_IsHomed( bool &bHomed ) +{ + bHomed = g_pMv_Proto->mv_motion_is_homed(); + return HAL_STATUS_NORMAL; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetStageLimits(double *StageLimitsMax, double *StageLimitsMin) +{ +// StageLimitsMax[HAL_AXIS_X] = +// StageLimitsMin[HAL_AXIS_X] = +// StageLimitsMax[HAL_AXIS_Y] = g_pMv_Proto +// StageLimitsMin[HAL_AXIS_Y] = +// StageLimitsMax[HAL_AXIS_Z] = +// StageLimitsMin[HAL_AXIS_Z] = + return HAL_STATUS_NORMAL; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_GetMaxSpeed(double *MaxSpeed) +{ + SSI_STATUS Status = SSI_STATUS_ERROR; + if (MaxSpeed) + Status = g_pMv_Proto->mv_motion_get_3D_max_speed(*MaxSpeed); + return (Status == SSI_STATUS_NORMAL) ? HAL_STATUS_NORMAL : HAL_STATUS_FAILED; +} + +//=========================================================================================================== +HAL_STATUS HAL_Motion_Shutdown( ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.H new file mode 100644 index 0000000..8f04f82 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MOTION.H @@ -0,0 +1,38 @@ +#pragma once +#include "Hal.h" + +////////////////////////////////////////////////////////////////////// +// +// HAL_Motion.h : interface for the Motion related functions +// +////////////////////////////////////////////////////////////////////// + +void HAL_Motion_HomeStatus(bool &); +HAL_STATUS HAL_Motion_IsSupported(UINT &Type); +HAL_STATUS HAL_Motion_Startup(bool bHome); +HAL_STATUS HAL_Motion_GetAxisCount(enum HAL_MOTION_AXIS_TYPE AxisType, int &nAxis); +HAL_STATUS HAL_Motion_GetSpeedXYZ(double &Speed); +HAL_STATUS HAL_Motion_SetSpeedXYZ(double Speed); +//HAL_STATUS HAL_Motion_GetSpeedXYZ1(double &SpeedX,double &SpeedY,double &SpeedZ); +//HAL_STATUS HAL_Motion_SetSpeedXYZ1(double SpeedX, double SpeedY, double SpeedZ); +HAL_STATUS HAL_Motion_GetSpeedR(double &Speed); +HAL_STATUS HAL_Motion_SetSpeedR(double Speed); +HAL_STATUS HAL_Motion_GetAccelerationXYZ(double &AccelX, double &AccelY, double &AccelZ); +HAL_STATUS HAL_Motion_SetAccelerationXYZ(double AccelX, double AccelY, double AccelZ); +HAL_STATUS HAL_Motion_GetAccelerationR(double &AccelR); +HAL_STATUS HAL_Motion_SetAccelerationR(double AccelQ); +HAL_STATUS HAL_Motion_GetPositionXYZ(UINT GetAxisTypes, double &PositionX, double &PositionY, + double &PositionZ, double &Time); +HAL_STATUS HAL_Motion_SetPositionXYZ(UINT SetAxisType, double PositionX, double PositionY, + double PositionZ, enum HAL_MOTION_MOVE_TYPE eType, double flyRadius); +HAL_STATUS HAL_Motion_GetPositionR(UINT GetAxisTypes, double &PositionR, double &Time); +HAL_STATUS HAL_Motion_SetPositionR(UINT SetAxisTypes, double PositionR, +// enum HAL_MOTION_AXIS_R_MOVE_TYPE DirectionType, bool bWait); +HAL_STATUS HAL_Motion_GetSettleTime(double &SettleTime); +HAL_STATUS HAL_Motion_GetDeadband(double &DeadbandX, double &DeadbandY, double &DeadbandZ, double &DeadbandR); +HAL_STATUS HAL_Motion_GetRefreshDeadband(double &Deadband); +HAL_STATUS HAL_Motion_IsHomed(bool &bHomed); +HAL_STATUS HAL_Motion_GetStageLimits(double *StageLimitsMax, double *StageLimitsMin); +HAL_STATUS HAL_Motion_SetStageLimits(bool bStageLimitsEnabled, double *StageLimitsMax, double *StageLimitsMin); +HAL_STATUS HAL_Motion_GetMaxSpeed(double *MaxSpeed); +HAL_STATUS HAL_Motion_Shutdown(void); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.CPP new file mode 100644 index 0000000..c35325b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.CPP @@ -0,0 +1,262 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// HAL_MicroVu.cpp +// +// Copyrights 2004, Wilcox Associates, Inc. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "settings.h" + +#include "HAL.h" +#include "HSI.h" + +extern CHAL *g_pHSI; +extern CHALMicroVuExt g_HSIExt; +extern bool g_bOfflineOnly; + +////////////////////////////////////////////////////////////////////////////// +// Registry entry definitions +// + +#define SECTION_HEADER _T("MicroVu") +TCHAR SectionHeader[] = SECTION_HEADER; + +INI_INTERFACE_INFO ini_vertex_dcc[] = +{ + // Settle times +#pragma message("these settle times are not supported in code") + {_T("Illumination_SettleTime"), INI_DOUBLE, &g_HSIExt.m_IllumSettleTime, _T("0.05"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("Stage_SettleTime"), INI_DOUBLE, &g_HSIExt.m_StageSettleTime, _T("0.1"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("Zoom_SettleTime"), INI_DOUBLE, &g_HSIExt.m_ZoomSettleTime, _T("0.1"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("ScaleResolutionX"), INI_DOUBLE, &g_HSIExt.m_ScaleResolutionX, _T("0.0005"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("ScaleResolutionY"), INI_DOUBLE, &g_HSIExt.m_ScaleResolutionY, _T("0.0005"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("ScaleResolutionZ"), INI_DOUBLE, &g_HSIExt.m_ScaleResolutionZ, _T("0.0005"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + + // Probe +// {_T("Probe_DebounceTime"), INI_DOUBLE, &g_HSIExt.m_ProbeDebounceTime, _T("0.05"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, +// {_T("Probe_DirectionThreshold"), INI_DOUBLE, &g_HSIExt.m_ProbeDirectionThreshold, _T("0.01"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + {_T("Probe_DisableIfNotActive"), INI_BOOL, &g_HSIExt.m_ProbeDisableIfNotActive, _T("TRUE"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, +// {_T("Probe_UsePI200"), INI_BOOL, &g_HSIExt.m_ProbeUsePI200, _T("FALSE"), NOFUNCTION, ADMINISTRATOR, ENABLED, ENABLED }, + + {NULL, INI_END, NULL, NULL} +}; + + + + +////////////////////////////////////////////////////////////////////////////// +// +CHALMicroVuExt::CHALMicroVuExt() +{ + unsigned short Axis = 0; + + m_bIsInitialised = false; + m_bIsHomingRequired = true; + m_bExtBoardPresent = false; + + g_bOfflineOnly = false; + + m_HomingAxis = HAL_AXIS_NONE; + + m_FineSpeedMode = false; + m_ControlMode = HAL_CTRL_MODE_CNC; + + m_ActiveMachineType = HAL_MACHINE_TYPE_UNSELECTED; + + m_IsCalibrated = false; + m_InhibitActiveHigh = false; + + m_ActiveProbe = APT_VISION; + + m_HomeManual = false; + m_HomeToLimitSwitch = false; + m_HomeToResetLine = false; + m_HomeSpeedRestrict = true; + + m_DSPLoopTime = 0; + + m_CurrentSpeedXYZ = 0.0; + m_CurrentSpeedR = 0.0; + + m_DCCMoveInProgress = false; + m_InitInProgress = false; + + m_IllumSettleTime = 0.0; + m_StageSettleTime = 0.0; + m_ZoomSettleTime = 0.0; + + m_LaserPositionalActiveHigh = true; + m_LaserState = false; + m_LaserPositionalOutput = HAL_OUTPUT_NONE; + + m_OptimetInit = false; + m_OptimetZFollow = false; + m_OptimetNomDist = 0.0; + m_OptimetScanDensity = 0.0; + m_OptimetGain = 20; + m_OptimetFreq = 800; + m_OptimetQualityThreshold = 70; + m_OptimetScanQuality = 0; + m_OptimetMag = HAL_LP_AUX_LENS_1_0x; + + m_OpticsGridActiveHigh = true; + m_OpticsGridState = false; + m_OpticsGridOutput = HAL_OUTPUT_NONE; + + for(Axis = HAL_AXIS_X ; Axis <= HAL_AXIS_Q ; Axis++) + { + m_ProbePoint[Axis] = 0; + m_ProbeDiff[Axis] = 0.0; + } + + m_ProbeDCCRetractDist = 0.0; + m_ProbeManRetractDist = 0.0; + m_ProbeHitExpected = false; + m_ProbeDisableIfNotActive = true; + m_ProbeEnabled = false; + m_ProbeLoading = false; + + m_LampUsePrototypeRing = false; + + memset(m_LampOutputState_5x8, 0, sizeof(m_LampOutputState_5x8)); + memset(m_LampOutputState_2x8, 0, sizeof(m_LampOutputState_2x8)); + memset(m_LampOutputLevel_5x8, 0, sizeof(m_LampOutputLevel_5x8)); + memset(m_LampOutputLevel_2x8, 0, sizeof(m_LampOutputLevel_2x8)); + + for(Axis = HAL_AXIS_X ; Axis <= HAL_AXIS_ZOOM ; Axis++) + { + m_AxisEnabled[Axis] = false; + m_AxisVelocity[Axis] = 0.0; + m_AxisAcceleration[Axis] = 0.0; + m_AxisResolution[Axis] = 0.001; + } + + m_Pendant_IsInitialised = false; + m_Pendant_EStopInhibitsAmp = true; + m_Pendant_FineSpeedFactor = 1.0; + + m_Pendant_Input_EStop = -1; + m_Pendant_Status_FineMode = HAL_OUTPUT_NONE; + m_Pendant_Status_CtrlDCC = HAL_OUTPUT_NONE; + m_Pendant_Status_CtrlTopLight = HAL_OUTPUT_NONE; + m_Pendant_Status_CtrlRngLight = HAL_OUTPUT_NONE; + m_Pendant_Status_CtrlBtmLight = HAL_OUTPUT_NONE; + + for(Axis = HAL_AXIS_X ; Axis <= HAL_AXIS_Q ; Axis++) + { + m_Pendant_Enabled[Axis] = false; + } + + g_lpfnWAIOpticsStartup = NULL; + g_lpfnWALOpticsShutdown = NULL; +} +////////////////////////////////////////////////////////////////////// +CHALMicroVuExt::~CHALMicroVuExt() +{} + +////////////////////////////////////////////////////////////////////////////// +// +HAL_STATUS CHALMicroVuExt::InitialiseMachineType(HAL_MACHINE_TYPE Type) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + // Set the active machine type and extra machine specific data + m_ActiveMachineType=Type; + + switch(Type) + { + case HAL_MACHINE_TYPE_EXCEL: + m_AxisEnabled[HAL_AXIS_X] = true; + m_AxisResolution[HAL_AXIS_X] = -0.00005; + m_AxisEnabled[HAL_AXIS_Y] = true; + m_AxisResolution[HAL_AXIS_Y] = 0.00005; + m_AxisEnabled[HAL_AXIS_Z] = true; + m_AxisResolution[HAL_AXIS_Z] = -0.00005; + + // Q axis settings + m_AxisEnabled[HAL_AXIS_Q] = false; + + // Zoom axis settings + m_AxisEnabled[HAL_AXIS_ZOOM] = true; + m_AxisVelocity[HAL_AXIS_ZOOM] = 6.0; + m_AxisAcceleration[HAL_AXIS_ZOOM] = 45.0; + m_AxisResolution[HAL_AXIS_ZOOM] = -0.001; + break; + + case HAL_MACHINE_TYPE_VECTRA: + // Read machine data from CNC.INI + if(Status != HAL_STATUS_NORMAL) + { + if(!g_bOfflineOnly) + return Status; + else + return HAL_STATUS_NORMAL; + } + + // Global settings + m_InhibitActiveHigh = true; + + // Homing settings + m_HomeManual = false; + m_HomeToLimitSwitch = false; + m_HomeToResetLine = true; + + // Positional laser settings + m_LaserPositionalActiveHigh = true; + m_LaserPositionalOutput = HAL_OUTPUT_EXTIO_2; + + // X axis settings + m_AxisEnabled[HAL_AXIS_X] = true; + + // Y axis settings + m_AxisEnabled[HAL_AXIS_Y] = true; + + // Z axis settings + m_AxisEnabled[HAL_AXIS_Z] = true; + + // Q axis settings + m_AxisEnabled[HAL_AXIS_Q] = m_Pendant_Enabled[HAL_AXIS_Q]; + + // Zoom axis settings + m_AxisEnabled[HAL_AXIS_ZOOM] = true; + m_Pendant_Input_EStop = 3; + +#pragma message("removed for lining ease") + + // Check the pendant fine speed factor is valid + if(m_Pendant_FineSpeedFactor < 0.01 || m_Pendant_FineSpeedFactor > 1.0) + m_Pendant_FineSpeedFactor = 1.0; + break; + + case HAL_MACHINE_TYPE_CUSTOM: + if(Status != HAL_STATUS_NORMAL) + { + if(!g_bOfflineOnly) + return Status; + else + return HAL_STATUS_NORMAL; + } + + // Check the pendant fine speed factor is valid + if(m_Pendant_FineSpeedFactor < 0.01 || m_Pendant_FineSpeedFactor > 1.0) + m_Pendant_FineSpeedFactor = 1.0; + + break; + + case HAL_MACHINE_TYPE_UNSELECTED: + default: + // Machine type has not been selected + break; + + } + + return Status; +} + +HAL_STATUS CHALMicroVuExt::ReadConfigFile() +{ + return HAL_STATUS_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.H new file mode 100644 index 0000000..1549771 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_MicroVu.H @@ -0,0 +1,293 @@ +#pragma once +/////////////////////////////////////////////////////////////////////////////// +// +// HAL_MicroVu.h +// +// Copyrights 2010, Wilcox Associates, Inc. +// +/////////////////////////////////////////////////////////////////////////////// + +#include "Mv_Proto.h" + +#define _MAX_MV_CMD_STRING 256 + +/////////////////////////////////////////////////////////////////////////////// +// HALMicroVuExt +class CHALMicroVuExt; + +// Default timeout for moves - 60 seconds +const int MOTION_TIMEOUT = 60000; + +// Default timeout for moves - 10 minutes +const int MANUAL_HOME_TIMEOUT = 600000; + +enum HAL_MACHINE_TYPE +{ + HAL_MACHINE_TYPE_UNSELECTED = -1, + HAL_MACHINE_TYPE_CUSTOM, + HAL_MACHINE_TYPE_EXCEL, + HAL_MACHINE_TYPE_VECTRA, + HAL_NUM_MACHINE_TYPES +}; + +enum HAL_AXIS +{ + HAL_AXIS_NONE = -1, + HAL_AXIS_X = 0, + HAL_AXIS_Y = 1, + HAL_AXIS_Z = 2, + HAL_AXIS_Q = 3, + HAL_AXIS_ZOOM = 4, + HAL_AXIS_ALL = 5 +}; + +enum HAL_OUTPUT +{ + HAL_OUTPUT_NONE = -1, + HAL_OUTPUT_EXTIO_2, + HAL_OUTPUT_EXTIO_3, + HAL_OUTPUT_EXTIO_4, + HAL_OUTPUT_EXTIO_5, + HAL_OUTPUT_EXTIO_6, + HAL_OUTPUT_EXTIO_7, + HAL_OUTPUT_EXTIO_8, + HAL_OUTPUT_EXTIO_9, + HAL_OUTPUT_PCIZOOM_0, + HAL_OUTPUT_PCIZOOM_1, + HAL_OUTPUT_PCIZOOM_2, + HAL_OUTPUT_PCIZOOM_3, + HAL_OUTPUT_PCIZOOM_4, + HAL_OUTPUT_PCIZOOM_5, + HAL_OUTPUT_PCIZOOM_6, + HAL_OUTPUT_PCIZOOM_7, + HAL_OUTPUT_EXPBOARD_0, + HAL_OUTPUT_EXPBOARD_1, + HAL_OUTPUT_EXPBOARD_2, + HAL_OUTPUT_EXPBOARD_3 +}; + +enum HAL_CTRL_MODE +{ + HAL_CTRL_MODE_CNC = 0, + HAL_CTRL_MODE_TOPLIGHT = 1, + HAL_CTRL_MODE_RNGLIGHT = 2, + HAL_CTRL_MODE_BTMLIGHT = 3 +}; + +enum HAL_HOME_STATUS +{ + HAL_HOME_NOT_FOUND = 0, + HAL_HOME_FOUND = 1, + HAL_HOME_FOUND_WRONG_DIR = 2, + HAL_HOME_TOO_FAST = 3 +}; + +enum HAL_HOME_DIRECTION +{ + HAL_HOME_DIR_EITHER = 0, + HAL_HOME_DIR_NEG = 1, + HAL_HOME_DIR_POS = 2 +}; + +enum HAL_DISPLAY_HOME_MESSAGE_TYPE +{ + HAL_DISPLAY_HOME_MESSAGE_REFMARK = 1, + HAL_DISPLAY_HOME_MESSAGE_LIMIT = 2 +}; + +enum ACTIVE_PROBE_TYPE +{ + APT_VISION = 0, + APT_CONTACT = 1, + APT_LASER = 2 +}; + +const int HAL_OPTICS_HOME_OFFSET = 500; + +bool IsBoardPresent(void); +bool IsControllerPresent(void); + +/////////////////////////////////////////////////////////////////////////////// +// HALMicroVuExt Class + +class CHALMicroVuExt +{ +public: + + CHALMicroVuExt(); + virtual ~CHALMicroVuExt(); + + HAL_STATUS InitialiseMachineType(HAL_MACHINE_TYPE Type = HAL_MACHINE_TYPE_EXCEL); + HAL_STATUS ReadConfigFile(void); + +public: + + bool m_bIsInitialised; + bool m_bIsHomingRequired; + bool m_bExtBoardPresent; + bool g_bOfflineOnly; + + int m_HomingAxis; + + bool m_FineSpeedMode; + enum HAL_CTRL_MODE m_ControlMode; + + // Global flags + HAL_MACHINE_TYPE m_ActiveMachineType; + bool m_IsCalibrated; + bool m_InhibitActiveHigh; + bool m_HomeManual; + bool m_HomeToLimitSwitch; + bool m_HomeToResetLine; + bool m_HomeSpeedRestrict; + bool m_DCCMoveInProgress; + bool m_InitInProgress; + unsigned short m_DSPLoopTime; + unsigned short m_ErrorState; + double m_CurrentSpeedXYZ; + double m_CurrentSpeedR; + double m_StageSettleTime; + double m_ZoomSettleTime; + double m_IllumSettleTime; + unsigned short m_NumSegs; + unsigned short m_NumRings; + double m_ScaleResolutionX; + double m_ScaleResolutionY; + double m_ScaleResolutionZ; + + // Project Grid + bool m_OpticsGridActiveHigh; + bool m_OpticsGridState; + HAL_OUTPUT m_OpticsGridOutput; + + // LaserProbe + bool m_LaserPositionalActiveHigh; + bool m_LaserState; + HAL_OUTPUT m_LaserPositionalOutput; + + bool m_OptimetInit; + bool m_OptimetZFollow; +// TMeasurement m_OptimetMeasPt; + double m_OptimetNomDist; + double m_OptimetScanDensity; + int m_OptimetGain; + int m_OptimetFreq; + int m_OptimetMag; + int m_OptimetQualityThreshold; + int m_OptimetScanQuality; + int m_OptimetScanQualityPts; + unsigned long m_OptimetNumPts; + unsigned long m_OptimetLaserMissedPts; + unsigned long m_OptimetAxisMissedPts; + + // TouchProbe + bool m_ProbeEnabled; + bool m_ProbeLoading; + bool m_ProbeDisableIfNotActive; + bool m_ProbeHitExpected; +// bool m_ProbeUsePI200; + long m_ProbePoint[4]; + double m_ProbeDiff[4]; + double m_ProbeDCCRetractDist; + double m_ProbeManRetractDist; + double m_ProbeMeasPointTSpeed; + double m_ProbeMeasPointSSpeed; +// double m_ProbeDebounceTime; +// double m_ProbeDirectionThreshold; + double m_ProbeMeasPointStart[3]; + double m_ProbeMeasPointEnd[3]; + + // Lamps + bool m_LampUsePrototypeRing; + bool m_LampOutputState_2x8[6][TWO_RINGS * EIGHT_SEGS]; + double m_LampOutputLevel_2x8[6][TWO_RINGS * EIGHT_SEGS]; + double m_LampOutputLevelForMVRing_2x8[TWO_RINGS * EIGHT_SEGS]; + bool m_LampOutputState_5x8[6][FIVE_RINGS * EIGHT_SEGS]; + double m_LampOutputLevel_5x8[6][FIVE_RINGS * EIGHT_SEGS]; + double m_LampOutputLevelForMVRing_5x8[FIVE_RINGS * EIGHT_SEGS]; + + // Axis + bool m_AxisEnabled[5]; +// bool m_AxisStepper[5]; +// bool m_AxisTTLscale[5]; +// bool m_AxisReversed[5]; +// bool m_AxisDigitalPositioner[5]; +// bool m_AxisLimitActiveHigh[5]; +// bool m_AxisHomeEnabled[5]; +// bool m_AxisHomeActiveHigh[5]; +// bool m_AxisHomeTTL[5]; +// HAL_HOME_STATUS m_AxisHomeStatus[5]; +// bool m_AxisSWFenceActive[5]; +// long m_AxisHomeDirection[5]; +// long m_AxisRefMarkOffset[5]; + double m_AxisVelocity[5]; + double m_AxisAcceleration[5]; +// double m_AxisJerk[5]; +// double m_AxisPFactor[5]; +// double m_AxisDFactor[5]; +// double m_AxisIFactor[5]; +// double m_AxisILimit[5]; +/// double m_AxisContThreshold[5]; +// long m_AxisMaxCount[5]; +// long m_AxisMinCount[5]; +// unsigned short m_AxisGain0[5]; +// unsigned short m_AxisGain90[5]; +// unsigned short m_AxisOffset0[5]; +// unsigned short m_AxisOffset90[5]; +// unsigned short m_AxisImpedance[5]; +// unsigned short m_AxisInterpolation[5]; + double m_AxisResolution[5]; +// double m_AxisFollowingLimit[5]; +// double m_AxisDriftVoltage[5]; +// double m_AxisSWFenceMax[5]; +// double m_AxisSWFenceMin[5]; +// int m_AxisBacklashCorrection[5]; +// double m_AxisHomeVelocity[5]; +// double m_AxisHomeVelocityFactor[5]; +// double m_AxisHomeFollowingLimit[5]; +// double m_AxisHomeFollowingLimitFactor[5]; +// double m_AxisNearPFactor[5]; +// double m_AxisNearDFactor[5]; +// double m_AxisNearIFactor[5]; +// double m_AxisNearILimit[5]; +// double m_AxisNearDistance[5]; + + ACTIVE_PROBE_TYPE m_ActiveProbe; + + // Pendant + bool m_Pendant_IsInitialised; + bool m_Pendant_EStopInhibitsAmp; + int m_Pendant_Input_EStop; +// int m_Pendant_Input_MovePt; +// int m_Pendant_Input_ErasePt; +// int m_Pendant_Input_Done; +// int m_Pendant_Input_CtrlMode; +// int m_Pendant_Input_FineMode; +// int m_Pendant_Input_ZoomMin; +// int m_Pendant_Input_ZoomMax; + HAL_OUTPUT m_Pendant_Status_FineMode; + HAL_OUTPUT m_Pendant_Status_CtrlDCC; + HAL_OUTPUT m_Pendant_Status_CtrlTopLight; + HAL_OUTPUT m_Pendant_Status_CtrlRngLight; + HAL_OUTPUT m_Pendant_Status_CtrlBtmLight; + double m_Pendant_FineSpeedFactor; + + bool m_Pendant_Enabled[4]; +// bool m_Pendant_Reversed[4]; +// long m_Pendant_Mirror[4]; +// long m_Pendant_Centre[4]; +// long m_Pendant_Max[4]; +// long m_Pendant_Min[4]; +// double m_Pendant_Deadband[4]; +// double m_Pendant_Speed[4]; +// double m_Pendant_FineSpeed[4][3]; +// double m_Pendant_Exponential[4]; +// double m_Pendant_PFactor[4]; +// double m_Pendant_DFactor[4]; +// double m_Pendant_IFactor[4]; +// double m_Pendant_ILimit[4]; + + HAL_OPTICS_STARTUP g_lpfnWAIOpticsStartup; + HAL_OPTICS_SHUTDOWN g_lpfnWALOpticsShutdown; +}; + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.CPP new file mode 100644 index 0000000..4e9198c --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.CPP @@ -0,0 +1,118 @@ +#include "stdafx.h" + +#include "Hal.h" +#include "HSI.h" + +extern CMv_Proto *g_pMv_Proto; +extern CHALMicroVuExt g_HSIExt; // basic configuration data + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#define new DEBUG_NEW +#endif + +extern CHAL *g_pHSI; + +bool IsZoomCell(void) +{ + return ((g_pHSI->Optics.GetSupported() & HAL_OPTICS_SUPPORTS_FIXED_LENS)==0); +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_Startup ( COpticalCalibrationData *OptCalData) +{ + HAL_STATUS retVal=HAL_STATUS_NORMAL; + + //call startup in WAI_OPTICS.DLL + if(g_HSIExt.g_lpfnWAIOpticsStartup) + retVal=g_HSIExt.g_lpfnWAIOpticsStartup(OptCalData); + + return retVal; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_Shutdown ( ) +{ + HAL_STATUS retVal=HAL_STATUS_NORMAL; + + //call shutdown in WAI_OPTICS.DLL + if(g_HSIExt.g_lpfnWALOpticsShutdown) + retVal=g_HSIExt.g_lpfnWALOpticsShutdown(); + + return retVal; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_IsLaserEnabled(bool &) +{ + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_EnableLaser(bool) +{ + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_IsGridEnabled(bool &) +{ + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_EnableGrid(bool) +{ + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_SetScalePosition(long lScale, bool bWait) +{ + UNREFERENCED_PARAMETER(bWait); + + g_pMv_Proto->mv_optics_set_scale_position(lScale); + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_GetScalePosition(long &lScale) +{ + g_pMv_Proto->mv_optics_get_scale_position(lScale); + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_GetScaleRange(long &lMaxMagScale,long &lMinMagScale) +{ + g_pMv_Proto->mv_optics_get_scale_range(lMaxMagScale, lMinMagScale); + return HAL_STATUS_NORMAL; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Optics_IsSupported(unsigned int &IsSupported) +{ + IsSupported = true; + return HAL_STATUS_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.H new file mode 100644 index 0000000..a57bbd6 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_OPTICS.H @@ -0,0 +1,18 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_Optics.h : interface for the Optics related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_Optics_IsSupported(UINT &Type); +HAL_STATUS HAL_Optics_Startup( COpticalCalibrationData *OptCalData); +HAL_STATUS HAL_Optics_GetScalePosition(long &Actual); +HAL_STATUS HAL_Optics_SetScalePosition(long TargetScalePosition, bool bWait); +HAL_STATUS HAL_Optics_GetScaleRange(long &ScaleMin, long &ScaleMax); +HAL_STATUS HAL_Optics_EnableGrid(bool bEnable); +HAL_STATUS HAL_Optics_IsGridEnabled(bool &bEnabled); +HAL_STATUS HAL_Optics_EnableLaser(bool bEnable); +HAL_STATUS HAL_Optics_IsLaserEnabled(bool &bEnabled); +HAL_STATUS HAL_Optics_Shutdown(void); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.CPP new file mode 100644 index 0000000..a3efd48 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.CPP @@ -0,0 +1,84 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_Pendant.cpp : interface for the Pendant related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include + +#include "HAL.h" +#include "HSI.h" + +extern CHAL *g_pHSI; +extern CHALMicroVuExt g_HSIExt; + +extern int GetLampNumberFromLocation(const enum HAL_ILLUMINATION_LAMP_LOCATION_TYPE SearchLocationType); + + +HAL_STATUS HAL_Pendant_IsSupported(UINT &Type) +{ + Type = HAL_PENDANT_SUPPORTS_JOYSTICK; + HAL_SendDebug(_T("HAL_Pendant_IsSupported %X\n"), Type); + return HAL_STATUS_NORMAL; +} + +void SetupPendantSpeeds() +{ + if(g_HSIExt.m_ActiveProbe==APT_VISION) + { + // Now we've changed mag, update the pendant settings so our fine speed is good for current optics + double PixelX=-1.0,PixelY=-1.0; + if(g_HSIExt.m_IsCalibrated && g_pHSI->Optics.GetMagnification(PixelX,PixelY)==HAL_STATUS_NORMAL) + { + // Optics calibrated so base XYZ fine speed on pixel/fov size + int FOVSizeX, FOVSizeY; + g_pHSI->FrameGrabber.GetImageSize(FOVSizeX, FOVSizeY); + +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_X][APT_VISION] = fabs((PixelX * FOVSizeX) / g_HSIExt.m_AxisVelocity[HAL_AXIS_X]) * g_HSIExt.m_Pendant_FineSpeedFactor; +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Y][APT_VISION] = fabs((PixelX * FOVSizeX) / g_HSIExt.m_AxisVelocity[HAL_AXIS_Y]) * g_HSIExt.m_Pendant_FineSpeedFactor; +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Z][APT_VISION] = fabs((PixelX * FOVSizeX/2) / g_HSIExt.m_AxisVelocity[HAL_AXIS_Z]) * g_HSIExt.m_Pendant_FineSpeedFactor; + } + else + { + // Optics not calibrated so use default XYZ fine speed +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_X][APT_VISION] = g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_X][APT_CONTACT] * g_HSIExt.m_Pendant_FineSpeedFactor; +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Y][APT_VISION] = g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Y][APT_CONTACT] * g_HSIExt.m_Pendant_FineSpeedFactor; +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Z][APT_VISION] = g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Z][APT_CONTACT] * g_HSIExt.m_Pendant_FineSpeedFactor; + } + + // Use default Q fine speed +// g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Q][APT_VISION] = g_HSIExt.m_Pendant_FineSpeed[HAL_AXIS_Q][APT_CONTACT]; + } +} + +HAL_STATUS SetPendantControlMode(enum HAL_CTRL_MODE /*ControlMode*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +HAL_STATUS CheckPendantLightControl() +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +HAL_STATUS HAL_Pendant_Startup( ) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +HAL_STATUS HAL_Pendant_Enable( bool bEnable ) +{ + UNREFERENCED_PARAMETER(bEnable); + HAL_STATUS Status = HAL_STATUS_NORMAL; + return Status; +} + +HAL_STATUS HAL_Pendant_Shutdown( ) +{ + return HAL_STATUS_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.H new file mode 100644 index 0000000..2132c14 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_PENDANT.H @@ -0,0 +1,15 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_Pendant.h : interface for the Pendant related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_Pendant_IsSupported(UINT &Type); +HAL_STATUS HAL_Pendant_Startup(void); +HAL_STATUS HAL_Pendant_Enable(bool bEnable); +HAL_STATUS HAL_Pendant_Shutdown(void); +HAL_STATUS SetPendantControlMode(enum HAL_CTRL_MODE ControlMode); +HAL_STATUS CheckPendantLightControl(void); +void SetupPendantSpeeds(void); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.CPP new file mode 100644 index 0000000..af29d05 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.CPP @@ -0,0 +1,18 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_ToolChanger.cpp : interface for the Tool Changer related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "HAL.h" +#include "HSI.h" + +HAL_STATUS HAL_TC_IsSupported(UINT &Type) +{ + Type = 0; + + HAL_SendDebug(_T("HAL_TC_IsSupported %X\n"), Type); + return HAL_STATUS_NOT_SUPPORTED; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.H new file mode 100644 index 0000000..7991558 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOOLCHANGER.H @@ -0,0 +1,9 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_ToolChanger.h : interface for the Tool Changer related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_TC_IsSupported(UINT &Type); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.CPP new file mode 100644 index 0000000..35451f8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.CPP @@ -0,0 +1,257 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_TouchProbe.h : interface for the Touch Probe related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include + +#include "HAL.h" +#include "HSI.h" +#include "HAL_Motion.h" +#include "HAL_Pendant.h" + +extern CHAL *g_pHSI; +extern CHALMicroVuExt g_HSIExt; + + +HAL_STATUS HAL_TP_IsSupported(UINT &Type) +{ + Type = HAL_TP_SUPPORTS_TOUCH_TRIGGER; + + HAL_SendDebug(_T("HAL_TP_IsSupported %X\n"), Type); + return HAL_STATUS_NORMAL; +} + +HAL_STATUS HAL_TP_Enable(bool bProbeEnable) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(IsBoardPresent()) + { + switch(bProbeEnable) + { + case true: + { + // Sometimes we get false hits when enabling, this flag will cause us to ignore them + g_HSIExt.m_ProbeLoading = true; + + g_HSIExt.m_ProbeEnabled = true; + + // Sleeping for the debounce time will ensure any false hits are caught before we leave here + //Sleep(DWORD(2*g_HSIExt.m_ProbeDebounceTime*1000)); + + // Reset the hit expectecd flag + g_HSIExt.m_ProbeLoading = false; + } + break; + + case false: + { + g_HSIExt.m_ProbeEnabled = false; + } + break; + } + } + else + Status = HAL_STATUS_NOT_SUPPORTED; + + + return Status; +} + +HAL_STATUS HAL_TP_Startup() +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(IsBoardPresent()) + { + Status = HAL_TP_Enable(true); + } + else + Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +HAL_STATUS HAL_TP_GetActiveProbe(int & /*nProbe*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +HAL_STATUS HAL_TP_SetActiveProbe(int nProbe) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + switch(nProbe) + { + case -1: + if(g_HSIExt.m_ProbeDisableIfNotActive && g_HSIExt.m_ProbeEnabled) + Status = HAL_TP_Enable(false); + break; + + default: + g_HSIExt.m_ActiveProbe = APT_CONTACT; + SetupPendantSpeeds(); + + if(!g_HSIExt.m_ProbeEnabled) + Status = HAL_TP_Enable(true); + break; + } + + return Status; +} + +HAL_STATUS HAL_TP_SetManualTouchData(CHALTPManualConfig *pParams) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + // Store manual touch probe data + if(pParams) + g_HSIExt.m_ProbeManRetractDist = pParams->m_Retract; + + // MicroVu only accepts 1 retract distance for all axes and this is in encoder counts + // Basing this value on the X axis resolution but this could be better + double RetractDist = fabs(g_HSIExt.m_ProbeManRetractDist / g_HSIExt.m_AxisResolution[HAL_AXIS_X]); + UNREFERENCED_PARAMETER(RetractDist); + + return Status; +} + +HAL_STATUS HAL_TP_SetTipOffset(double /*OffsetX*/, double /*OffsetY*/, double /*OffsetZ*/) +{ + HAL_STATUS Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +HAL_STATUS HAL_TP_GetTipOffset(double & /*OffsetX*/, double & /*OffsetY*/, double & /*OffsetZ*/) +{ + HAL_STATUS Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +HAL_STATUS HAL_TP_SetupMeasurePoint(CHALTPMeasurePoint *pParams) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(IsBoardPresent()) + { + if(pParams) + { + // Probe seek start position + g_HSIExt.m_ProbeMeasPointStart[0] = pParams->m_MeasPoint.m_X+pParams->m_MeasPoint.m_I*pParams->m_Approach; + g_HSIExt.m_ProbeMeasPointStart[1] = pParams->m_MeasPoint.m_Y+pParams->m_MeasPoint.m_J*pParams->m_Approach; + g_HSIExt.m_ProbeMeasPointStart[2] = pParams->m_MeasPoint.m_Z+pParams->m_MeasPoint.m_K*pParams->m_Approach; + + // Probe seek end position + g_HSIExt.m_ProbeMeasPointEnd[0] = pParams->m_MeasPoint.m_X-pParams->m_MeasPoint.m_I*pParams->m_Overshoot; + g_HSIExt.m_ProbeMeasPointEnd[1] = pParams->m_MeasPoint.m_Y-pParams->m_MeasPoint.m_J*pParams->m_Overshoot; + g_HSIExt.m_ProbeMeasPointEnd[2] = pParams->m_MeasPoint.m_Z-pParams->m_MeasPoint.m_K*pParams->m_Overshoot; + + // Probe travel speed + g_HSIExt.m_ProbeMeasPointTSpeed = pParams->m_TravelSpeed; + + // Probe seek speed + g_HSIExt.m_ProbeMeasPointSSpeed = pParams->m_SeekSpeed; + + // Retract distance + g_HSIExt.m_ProbeDCCRetractDist = pParams->m_Retract; + } + } + else + Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +HAL_STATUS HAL_TP_DoMeasure(bool /*bWait*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + // Set the probe travel speed + HAL_Motion_SetSpeedXYZ(g_HSIExt.m_ProbeMeasPointTSpeed); + + // Set the retract distance + double RetractDist = fabs(g_HSIExt.m_ProbeDCCRetractDist / g_HSIExt.m_AxisResolution[HAL_AXIS_X]); + UNREFERENCED_PARAMETER(RetractDist); + + // Move to start position + Status = HAL_Motion_SetPositionXYZ(HAL_MOTION_AXIS_X|HAL_MOTION_AXIS_Y|HAL_MOTION_AXIS_Z, + g_HSIExt.m_ProbeMeasPointStart[0], + g_HSIExt.m_ProbeMeasPointStart[1], + g_HSIExt.m_ProbeMeasPointStart[2], + HAL_MOTION_MOVE_WAIT, 0.0); + + if(Status == HAL_STATUS_NORMAL) + { + // Set the probe seek speed + HAL_Motion_SetSpeedXYZ(g_HSIExt.m_ProbeMeasPointSSpeed); + + // Flag we are expecting a DCC probe hit + g_HSIExt.m_ProbeHitExpected = true; + + // Seek move + Status = HAL_Motion_SetPositionXYZ(HAL_MOTION_AXIS_X|HAL_MOTION_AXIS_Y|HAL_MOTION_AXIS_Z, + g_HSIExt.m_ProbeMeasPointEnd[0], + g_HSIExt.m_ProbeMeasPointEnd[1], + g_HSIExt.m_ProbeMeasPointEnd[2], + HAL_MOTION_MOVE_WAIT, 0.0); + + // Flag we are no longer expecting a DCC probe hit + g_HSIExt.m_ProbeHitExpected = false; + } + + // Reset to the manual retract distance + RetractDist = fabs(g_HSIExt.m_ProbeManRetractDist / g_HSIExt.m_AxisResolution[HAL_AXIS_X]); + UNREFERENCED_PARAMETER(RetractDist); + + // Reset the original speed + HAL_Motion_SetSpeedXYZ(0.0); + + return Status; +} + +HAL_STATUS HAL_TP_IsMeasuring(bool & /*bMeasuring*/) +{ + HAL_STATUS Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} + +HAL_STATUS HAL_TP_GetMeasureData(CHALMeasPoint &TPData) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + double Position[] = {0.0, 0.0, 0.0}; + double Vector[] = {0.0, 0.0, 0.0}; + + // Return probed point + TPData.m_X = Position[0]; + TPData.m_Y = Position[1]; + TPData.m_Z = Position[2]; + TPData.m_I = Vector[0]; + TPData.m_J = Vector[1]; + TPData.m_K = Vector[2]; + + return Status; +} + +HAL_STATUS HAL_TP_Shutdown() +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(IsBoardPresent()) + { + // Unregister event callbacks + } + else + Status = HAL_STATUS_NOT_SUPPORTED; + + return Status; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.H new file mode 100644 index 0000000..ab663f2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_TOUCHPROBE.H @@ -0,0 +1,21 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_TouchProbe.h : interface for the Touch Probe related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_TP_IsSupported(UINT &Type); +HAL_STATUS HAL_TP_Enable(bool bProbeEnable); +HAL_STATUS HAL_TP_Startup(void); +HAL_STATUS HAL_TP_GetActiveProbe(int &nProbe); +HAL_STATUS HAL_TP_SetActiveProbe(int nProbe); +HAL_STATUS HAL_TP_SetManualTouchData(CHALTPManualConfig *pParams); +HAL_STATUS HAL_TP_SetTipOffset(double OffsetX, double OffsetY, double OffsetZ); +HAL_STATUS HAL_TP_GetTipOffset(double &OffsetX, double &OffsetY, double &OffsetZ); +HAL_STATUS HAL_TP_SetupMeasurePoint(CHALTPMeasurePoint *pParams); +HAL_STATUS HAL_TP_DoMeasure(bool bWait); +HAL_STATUS HAL_TP_IsMeasuring(bool &bMeasuring); +HAL_STATUS HAL_TP_GetMeasureData(CHALMeasPoint &TPData); +HAL_STATUS HAL_TP_Shutdown(void); \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.CPP new file mode 100644 index 0000000..7372687 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.CPP @@ -0,0 +1,39 @@ +////////////////////////////////////////////////////////////////////// +// +// HAL_VideoProbe.cpp : interface for the Video Probe related functions +// +////////////////////////////////////////////////////////////////////// + +#include "StdAfx.h" + +#include "HAL.h" +#include "HSI.h" +#include "HAL_Pendant.h" + +extern CHALMicroVuExt g_HSIExt; + + +HAL_STATUS HAL_VP_GetActiveProbe(int &/*nProbe*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +HAL_STATUS HAL_VP_SetActiveProbe(int nProbe) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + switch(nProbe) + { + case -1: + break; + + default: + g_HSIExt.m_ActiveProbe = APT_VISION; + SetupPendantSpeeds(); + break; + } + + return Status; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.H new file mode 100644 index 0000000..84afcce --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HAL_VIDEOPROBE.H @@ -0,0 +1,10 @@ +#pragma once + +////////////////////////////////////////////////////////////////////// +// +// HAL_VideoProbe.h : interface for the Video Probe related functions +// +////////////////////////////////////////////////////////////////////// + +HAL_STATUS HAL_VP_GetActiveProbe(int &nProbe); +HAL_STATUS HAL_VP_SetActiveProbe(int nProbe); diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.CPP new file mode 100644 index 0000000..6c072f2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.CPP @@ -0,0 +1,764 @@ +////////////////////////////////////////////////////////////////////// +// +// HSI.cpp : Implementation of the MicroVu HSI supporting: +// - MicroVu based systems +// +////////////////////////////////////////////////////////////////////// +#include "StdAfx.h" + +#include "..\include\resource.h" + +#include "HAL.h" +#include "HSI.h" + +#include "FGLoad.h" + +#include "HAL_EventHandler.H" +#include "HAL_Fixture.H" +#include "HAL_Illumination.H" +#include "HAL_LaserProbe.H" +#include "HAL_Motion.H" +#include "HAL_Optics.H" +#include "HAL_Pendant.H" +#include "HAL_ToolChanger.H" +#include "HAL_TouchProbe.H" +#include "HAL_VideoProbe.H" + +#include "Logger.h" + +// #define _TEST_MOTION_ONLY + +#ifdef _MERGE_PROXYSTUB +extern "C" HINSTANCE hProxyDll; +#endif + +extern TCHAR SectionHeader[]; + +//extern CMachineInterface *m_pMachine; +//HANDLE hEventEStop = NULL; + +////////////////////////////////////////////////////////////////////////////// +// Interface version used in GetVersion() +// +#define VERSION _T("1.0") +//CMachineInterface *m_pMachine = NULL; +//CPCDpart_program *m_pPartProgram = NULL; +CWnd *pMessageBox; +CHAL *g_pHSI = NULL; +HINSTANCE VPlib = NULL; +HINSTANCE FGlib = NULL; +CHALMicroVuExt g_HSIExt; // basic configuration data +CMv_Proto *g_pMv_Proto = NULL; +CLogger *pLogger; + +long g_lFramegrabberType = -1l; + +////////////////////////////////////////////////////////////////////////////// + +#define MACHINE_ID_STRING (m_pMachine ? m_pMachine->m_id : _T("")) +static AFX_EXTENSION_MODULE HSIDLL = { NULL, NULL }; + +////////////////////////////////////////////////////////////////////// +extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) +{ + if (dwReason == DLL_PROCESS_ATTACH) + { + TRACE0("Hsi_MicroVu.DLL Initializing!\n"); + + // Extension DLL one-time initialization + AfxInitExtensionModule(HSIDLL, hInstance); + + // Insert this DLL into the resource chain + new CDynLinkLibrary(HSIDLL); + } + else if (dwReason == DLL_PROCESS_DETACH) + { + TRACE0("Hsi_MicroVu.DLL Terminating!\n"); + } + return 1; +} + +////////////////////////////////////////////////////////////////////////// +// All required hardware objects +extern "C" __declspec(dllexport) HAL_STATUS HAL_GetVersion(TCHAR *Version) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + CString VersionStr; +#ifdef _DEBUG + + VersionStr= _T("HSI_MicroVu.dll ") _T(__DATE__) _T(" debug version ") VERSION; +#else + VersionStr= _T("HSI_MicroVu.dll ") _T(__DATE__) _T(" release version ") VERSION; +#endif + + wcsncpy_s(Version, HAL_MaxStringLength+1, VersionStr, HAL_MaxStringLength); + HAL_SendDebug(_T("HAL_GetVersion %s\n"), VersionStr); + return Status; +} + +////////////////////////////////////////////////////////////////////// +//extern "C" __declspec(dllexport) HSI_STATUS HAL_Shutdown() +HAL_STATUS HAL_Shutdown() +{ + if (g_pMv_Proto) + { + g_pMv_Proto->Exit_MvUsb(); + delete g_pMv_Proto; + g_pMv_Proto = NULL; + }; + + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +extern "C" __declspec(dllexport) HAL_STATUS HAL_GetInterfaceVersion(long &APIVersionMajor, long &APIVersionMinor) +{ + APIVersionMajor=HAL_APIVersionMajor; + APIVersionMinor=HAL_APIVersionMinor; + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +// Start up checks if the m_TestMotion is ON. We will load the needed only. +// +extern "C" __declspec(dllexport) HAL_STATUS HAL_Startup(HWND hWnd, CHAL *pHAL, bool bOfflineOnly, long lFrameGrabberType) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + g_HSIExt.g_bOfflineOnly = bOfflineOnly; + +// m_pMachine = global_machine_active; +// m_pPartProgram = m_pMachine->m_pPartProgram; + + // If no HAL then quit + if(!pHAL) + return HAL_STATUS_FAILED; + + // Set global HAL object + g_pHSI = pHAL; + + if(!g_HSIExt.g_bOfflineOnly) + { + g_HSIExt.m_bIsInitialised = false; + + g_pMv_Proto = new CMv_Proto(); // Create the MicroVu object + SSI_STATUS Status = g_pMv_Proto->Init_MvUsb(); + if (Status != SSI_STATUS_NORMAL) + { +#pragma message("Add USB specific HAL event message here") + return HAL_STATUS_FAILED; + } + + Status = g_pMv_Proto->mv_motion_startup(g_HSIExt.m_ScaleResolutionX, g_HSIExt.m_ScaleResolutionY, g_HSIExt.m_ScaleResolutionZ); + if (Status != SSI_STATUS_NORMAL) + { +#pragma message("Add USB specific HAL event message here") + return HAL_STATUS_FAILED; + } + + g_HSIExt.m_bIsInitialised = true; + } + + // Initialise the HAL function addresses + if(g_pHSI) + { + // Set exported HAL function addresses + g_pHSI->Shutdown = (HAL_SHUTDOWN) HAL_Shutdown; + g_pHSI->GetVersion = (HAL_GET_VERSION) ((HAL_GET_VERSION) HAL_GetVersion); + g_pHSI->GetInterfaceVersion = (HAL_GET_INTERFACE_VERSION) HAL_GetInterfaceVersion; + g_pHSI->GetMachineCount = (HAL_GET_MACHINE_COUNT) HAL_GetMachineCount; + g_pHSI->GetMachineInfo = (HAL_GET_MACHINE_INFO) HAL_GetMachineInfo; + g_pHSI->SetActiveMachine = (HAL_SET_ACTIVE_MACHINE) HAL_SetActiveMachine; + g_pHSI->GetActiveMachine = (HAL_GET_ACTIVE_MACHINE) HAL_GetActiveMachine; + g_pHSI->SetLocale = (HAL_SET_LOCALE) HAL_SetLocale; + g_pHSI->SetRegistryRootKey = (HAL_SET_REGISTRY_ROOT_KEY) HAL_SetRegistryRootKey; + g_pHSI->PreSetupDialog = (HAL_PRE_SETUP_DIALOG) HAL_PreSetupDialog; + g_pHSI->PostSetupDialog = (HAL_POST_SETUP_DIALOG) HAL_PostSetupDialog; + g_pHSI->EventResponse = (HAL_EVENT_RESPONSE) HAL_EventResponse; + g_pHSI->GetCustomMessage = (HAL_GET_CUSTOM_MESSAGE) HAL_GetCustomMessage; + //g_pHSI->GetTemperatureSensor = (HAL_GET_TEMPERATURE_SENSOR) HAL_GetTemperatureSensor; + //g_pHSI->GetTemperatureSensorCount = (HAL_GET_TEMPERATURE_SENSOR_COUNT) HAL_GetTemperatureSensorCount; + + if(!g_HSIExt.g_bOfflineOnly) + { + g_pHSI->Calibrate = (HAL_CALIBRATE) HAL_Calibrate; + g_pHSI->Notify = (HAL_NOTIFY) HAL_Notify; + g_pHSI->GetCustomCalibrationTypeInfo = (HAL_GET_CUSTOM_CALIBRATION_TYPE_INFO) HAL_GetCustomCalibrationTypeInfo; + } + + // Map the supported function addresses for the MSI + HAL_MapSupportedFunctions(pHAL, hWnd, bOfflineOnly); + +// #ifndef _TEST_MOTION_ONLY + + HAL_SendDebug(_T("Load VideoProbe library\n")); + VPlib = ::AfxLoadLibrary(_T("WAI_VideoProbe.dll")); + if(VPlib) + { + g_pHSI->VideoProbe.IsSupported = (HAL_VP_IS_SUPPORTED) ::GetProcAddress(VPlib, "HAL_VP_IsSupported"); + g_pHSI->VideoProbe.IsToolSupported = (HAL_VP_IS_TOOL_SUPPORTED) ::GetProcAddress(VPlib, "HAL_VP_IsToolSupported"); + g_pHSI->VideoProbe.GetProbeCount = (HAL_VP_GET_PROBE_COUNT) ::GetProcAddress(VPlib, "HAL_VP_GetProbeCount"); + + g_pHSI->VideoProbe.GetActiveProbe = (HAL_VP_GET_ACTIVE_PROBE) HAL_VP_GetActiveProbe; + g_pHSI->VideoProbe.SetActiveProbe = (HAL_VP_SET_ACTIVE_PROBE) HAL_VP_SetActiveProbe; + + if(g_pHSI->VideoProbe.IsActive()) + { + if(!bOfflineOnly) + { + g_pHSI->VideoProbe.DoMeasure = (HAL_VP_DO_MEASURE) ::GetProcAddress(VPlib, "HAL_VP_DoMeasure"); + g_pHSI->VideoProbe.Enable = (HAL_VP_ENABLE) ::GetProcAddress(VPlib, "HAL_VP_Enable"); + g_pHSI->VideoProbe.IsEnabled = (HAL_VP_IS_ENABLED) ::GetProcAddress(VPlib, "HAL_VP_IsEnabled"); + g_pHSI->VideoProbe.GetToolCustomTypeInfo = (HAL_VP_GET_TOOL_CUSTOM_TYPE_INFO) ::GetProcAddress(VPlib, "HAL_VP_GetToolCustomTypeInfo"); + g_pHSI->VideoProbe.GetMeasureData = (HAL_VP_GET_MEASURE_DATA) ::GetProcAddress(VPlib, "HAL_VP_GetMeasureData"); + g_pHSI->VideoProbe.GetParameterCount = (HAL_VP_GET_PARAMETER_COUNT) ::GetProcAddress(VPlib, "HAL_VP_GetParameterCount"); + g_pHSI->VideoProbe.GetParameterInfo = (HAL_VP_GET_PARAMETER_INFO) ::GetProcAddress(VPlib, "HAL_VP_GetParameterInfo"); + g_pHSI->VideoProbe.GetTipOffset = (HAL_VP_GET_TIP_OFFSET) ::GetProcAddress(VPlib, "HAL_VP_GetTipOffset"); + g_pHSI->VideoProbe.IsMeasuring = (HAL_VP_IS_MEASURING) ::GetProcAddress(VPlib, "HAL_VP_IsMeasuring"); + g_pHSI->VideoProbe.SetTipOffset = (HAL_VP_SET_TIP_OFFSET) ::GetProcAddress(VPlib, "HAL_VP_SetTipOffset"); + g_pHSI->VideoProbe.SetupMeasureEdgeArc = (HAL_VP_SETUP_MEASURE_EDGE_ARC) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureEdgeArc"); + g_pHSI->VideoProbe.SetupMeasureEdgeBlob = (HAL_VP_SETUP_MEASURE_EDGE_BLOB) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureEdgeBlob"); + g_pHSI->VideoProbe.SetupMeasureEdgeLine = (HAL_VP_SETUP_MEASURE_EDGE_LINE) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureEdgeLine"); + g_pHSI->VideoProbe.SetupMeasureEdgePoint = (HAL_VP_SETUP_MEASURE_EDGE_POINT) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureEdgePoint"); + g_pHSI->VideoProbe.SetupMeasureEdgeTracer = (HAL_VP_SETUP_MEASURE_EDGE_TRACER) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureEdgeTrace"); + g_pHSI->VideoProbe.SetupMeasureSurfacePoint = (HAL_VP_SETUP_MEASURE_SURFACE_POINT) ::GetProcAddress(VPlib, "HAL_VP_SetupMeasureSurfacePoint"); + g_pHSI->VideoProbe.SetupImage = (HAL_VP_SETUP_IMAGE) ::GetProcAddress(VPlib, "HAL_VP_SetupImage"); //Task104403-- 501919 - 2 - Measure features and pass back points, putting them in the appropriate auto featureSubtask: MSI grabs the image and pass it to the videoprobe + g_pHSI->VideoProbe.Shutdown = (HAL_VP_SHUTDOWN) ::GetProcAddress(VPlib, "HAL_VP_ShutDown"); + g_pHSI->VideoProbe.Startup = (HAL_VP_STARTUP) ::GetProcAddress(VPlib, "HAL_VP_Startup"); + + //PVD-29: Remove MSIGlobal from the VideoProbe.dll. + g_pHSI->VideoProbe.HelperSetupFocusData = (HAL_VP_HELPER_SETUP_FOCUS_DATA) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetupFocusData"); + g_pHSI->VideoProbe.HelperSetupOpticsSupports = (HAL_VP_HELPER_SETUP_OPTICS_SUPPORTS) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetupOpticsSupports"); + g_pHSI->VideoProbe.HelperSetupFrameGrabberData = (HAL_VP_HELPER_SETUP_FRAME_GRABBER_DATA) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetupFrameGrabberData"); + g_pHSI->VideoProbe.HelperSetupProbeData = (HAL_VP_HELPER_SETUP_PROBE_DATA) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetupProbeData"); + g_pHSI->VideoProbe.HelperSetCameraRotationalAngle = (HAL_VP_HELPER_SET_CAMERA_ROTATIONAL_ANGLE) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetCameraRotationalAngle"); + g_pHSI->VideoProbe.HelperSetOpticalFocalCenter = (HAL_VP_HELPER_SET_OPTICAL_FOCAL_CENTER) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetOpticalFocalCenter"); + g_pHSI->VideoProbe.HelperSetOpticsCurrPixelSize = (HAL_VP_HELPER_SET_OPTICS_CURR_PIXEL_SIZE) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetOpticsCurrPixelSize"); + g_pHSI->VideoProbe.HelperSetGlobalUnitInMM = (HAL_VP_HELPER_SET_GLOBAL_UNIT_IN_MM) ::GetProcAddress(VPlib, "HAL_VP_Helper_SetGlobalUnitInMM"); + } + } + } + else + { + HAL_SendDebug(_T("Load VideoProbe library failed\n")); + CString Message; + Message.LoadString(IDS_NC_FILE_NOT_FOUND); + Message = _T("WAI_VideoProbe.dll - ") + Message; + TCHAR Msg[HAL_MaxStringLength+1]; + wcsncpy_s(Msg, HAL_MaxStringLength+1, Message, HAL_MaxStringLength); + UINT EventCallbackID = 0; + g_pHSI->Event(HAL_EVENT_ERROR, 0, Msg, EventCallbackID); + return HAL_STATUS_FILE_NOT_FOUND; + } + + // Set exported HAL FRAME GRABBER function addresses + if(g_pHSI->FrameGrabber.m_bEnabled) + { + // Load FrameGrabber library + HAL_SendDebug(_T("Load FrameGrabber library\n")); + CString DLLsFoundWithFailedLoad; + CString DefFileName; + BOOL bDefWAIFGFileFound=FALSE; + BOOL bWAIVenderFGFileFound=FALSE; + CString LoadingStatus; + bool bLoadedAndProbed = LoadFramegrabberDLL(lFrameGrabberType, FGlib, DLLsFoundWithFailedLoad, bDefWAIFGFileFound, bWAIVenderFGFileFound, LoadingStatus); + LoadingStatus += _T("\n"); +// debug.Send(LoadingStatus); + + if(bLoadedAndProbed) + { + // Get startup address and call startup routine + g_pHSI->FrameGrabber.IsSupported = (HAL_FG_IS_SUPPORTED) ::GetProcAddress(FGlib, "HAL_FG_IsSupported"); + + if (g_pHSI->FrameGrabber.IsActive()) + { + // HAL FRAMEGRABBER is supported + g_pHSI->FrameGrabber.GetCameraCount = (HAL_FG_GET_CAMERA_COUNT) ::GetProcAddress(FGlib, "HAL_FG_GetCameraCount"); + g_pHSI->FrameGrabber.GetImageSize = (HAL_FG_GET_IMAGE_SIZE) ::GetProcAddress(FGlib, "HAL_FG_GetImageSize"); + if(!g_HSIExt.g_bOfflineOnly) + { + g_pHSI->FrameGrabber.Startup = (HAL_FG_STARTUP) ::GetProcAddress(FGlib, "HAL_FG_Startup"); + g_pHSI->FrameGrabber.ProbeDevice = (HAL_FG_PROBE_DEVICE) ::GetProcAddress(FGlib, "HAL_FG_ProbeDevice"); + g_pHSI->FrameGrabber.IsCameraPresent = (HAL_FG_IS_CAMERA_PRESENT) ::GetProcAddress(FGlib, "HAL_FG_IsCameraPresent"); + g_pHSI->FrameGrabber.SetActiveCamera = (HAL_FG_SET_ACTIVE_CAMERA) ::GetProcAddress(FGlib, "HAL_FG_SetActiveCamera"); + g_pHSI->FrameGrabber.StartLiveVideo = (HAL_FG_START_LIVE_VIDEO) ::GetProcAddress(FGlib, "HAL_FG_StartLiveVideo"); + g_pHSI->FrameGrabber.StopLiveVideo = (HAL_FG_STOP_LIVE_VIDEO) ::GetProcAddress(FGlib, "HAL_FG_StopLiveVideo"); + g_pHSI->FrameGrabber.DoGreyscaleSnapshot = (HAL_FG_DO_GREYSCALE_SNAPSHOT) ::GetProcAddress(FGlib, "HAL_FG_DoGreyscaleSnapshot"); + g_pHSI->FrameGrabber.GetGreyscaleSnapshotImage = (HAL_FG_GET_GREYSCALE_SNAPSHOT_IMAGE) ::GetProcAddress(FGlib, "HAL_FG_GetGreyscaleSnapshotImage"); + g_pHSI->FrameGrabber.DoColorSnapshot = (HAL_FG_DO_COLOR_SNAPSHOT) ::GetProcAddress(FGlib, "HAL_FG_DoColorSnapshot"); + g_pHSI->FrameGrabber.GetColorSnapshotPixel = (HAL_FG_GET_COLOR_SNAPSHOT_PIXEL) ::GetProcAddress(FGlib, "HAL_FG_GetColorSnapshotPixel"); + g_pHSI->FrameGrabber.StartUpdateOverlay = (HAL_FG_START_UPDATE_OVERLAY) ::GetProcAddress(FGlib, "HAL_FG_StartUpdateOverlay"); + g_pHSI->FrameGrabber.GetOverlayDC = (HAL_FG_GET_OVERLAY_DC) ::GetProcAddress(FGlib, "HAL_FG_GetOverlayDC"); + g_pHSI->FrameGrabber.DrawOverlayDot = (HAL_FG_DRAW_OVERLAY_DOT) ::GetProcAddress(FGlib, "HAL_FG_DrawOverlayDot"); + g_pHSI->FrameGrabber.ClearOverlay = (HAL_FG_CLEAR_OVERLAY) ::GetProcAddress(FGlib, "HAL_FG_ClearOverlay"); + g_pHSI->FrameGrabber.EndUpdateOverlay = (HAL_FG_END_UPDATE_OVERLAY) ::GetProcAddress(FGlib, "HAL_FG_EndUpdateOverlay"); + g_pHSI->FrameGrabber.GetTransparentColor = (HAL_FG_GET_TRANSPARENT_COLOR) ::GetProcAddress(FGlib, "HAL_FG_GetTransparentColor"); + g_pHSI->FrameGrabber.GetFieldonetime = (HAL_FG_GET_FIELDONETIME) ::GetProcAddress(FGlib, "HAL_FG_GetFieldonetime"); + g_pHSI->FrameGrabber.GetFieldtwotime = (HAL_FG_GET_FIELDTWOTIME) ::GetProcAddress(FGlib, "HAL_FG_GetFieldtwotime"); + g_pHSI->FrameGrabber.SetGrabHook = (HAL_FG_SET_GRAB_HOOK) ::GetProcAddress(FGlib, "HAL_FG_SetGrabHook"); + g_pHSI->FrameGrabber.ClearGrabHook = (HAL_FG_CLEAR_GRAB_HOOK) ::GetProcAddress(FGlib, "HAL_FG_ClearGrabHook"); + g_pHSI->FrameGrabber.Shutdown = (HAL_FG_SHUTDOWN) ::GetProcAddress(FGlib, "HAL_FG_Shutdown"); + g_pHSI->FrameGrabber.StartOfFocus = (HAL_FG_STARTOFFOCUS) ::GetProcAddress(FGlib, "HAL_FG_StartOfFocus"); + g_pHSI->FrameGrabber.EndOfFocus = (HAL_FG_ENDOFFOCUS) ::GetProcAddress(FGlib, "HAL_FG_EndOfFocus"); + g_pHSI->FrameGrabber.GreyscaleRGB = (HAL_FG_GREYSCALE_RGB) ::GetProcAddress(FGlib, "HAL_FG_GreyscaleRGB"); + g_pHSI->FrameGrabber.IsCameraColor = (HAL_FG_IS_CAMERA_COLOR) ::GetProcAddress(FGlib, "HAL_FG_IsCameraColor"); //109287 + g_pHSI->FrameGrabber.SetTransparency = (HAL_FG_SET_TRANSPARENCY) ::GetProcAddress(FGlib, "HAL_FG_SetTransparency"); + } + } + } + else if(!bOfflineOnly) + { + CString Message; + if(bDefWAIFGFileFound == TRUE || bWAIVenderFGFileFound == TRUE) + { + Message.LoadString(IDS_FRAME_GRABBER_MISSING_DEPENDENT_DLL); + } + else + { + Message.LoadString(IDS_NC_FILE_NOT_FOUND); + } + + Message = DLLsFoundWithFailedLoad + _T(" - ") + Message; + TCHAR Msg[HAL_MaxStringLength+1]; + wcsncpy_s(Msg, HAL_MaxStringLength+1, Message, HAL_MaxStringLength); + UINT EventCallbackID = 0; + g_pHSI->Event(HAL_EVENT_FUNCTION, HAL_EVENT_DISPLAY_OK_MESSAGE, Msg, EventCallbackID); + return HAL_STATUS_FILE_NOT_FOUND; + } + } + else + { +// debug.Send(_T("Framegrabber not active - Load FrameGrabber library skipped\n")); + } + +// #endif + + } + else + return HAL_STATUS_FAILED; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_MapSupportedFunctions(CHAL *pHAL, HWND hWnd, bool bOfflineOnly) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + pHAL->Illumination.IsSupported = (HAL_ILLUMINATION_IS_SUPPORTED) HAL_Illumination_IsSupported; + if(pHAL->Illumination.IsActive(true)) + { + pHAL->Illumination.GetLampCount = (HAL_ILLUMINATION_GET_LAMP_COUNT) HAL_Illumination_GetLampCount; + pHAL->Illumination.GetLampInfo = (HAL_ILLUMINATION_GET_LAMP_INFO) HAL_Illumination_GetLampInfo; + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->Illumination.Startup = (HAL_ILLUMINATION_STARTUP) HAL_Illumination_Startup; + pHAL->Illumination.GetLampState = (HAL_ILLUMINATION_GET_LAMP_STATE) HAL_Illumination_GetLampState; + pHAL->Illumination.SetLampState = (HAL_ILLUMINATION_SET_LAMP_STATE) HAL_Illumination_SetLampState; + pHAL->Illumination.Shutdown = (HAL_ILLUMINATION_SHUTDOWN) HAL_Illumination_Shutdown; + } + } + pHAL->Motion.IsSupported = (HAL_MOTION_IS_SUPPORTED) HAL_Motion_IsSupported; + if(pHAL->Motion.IsActive(true)) + { + pHAL->Motion.GetAxisCount = (HAL_MOTION_GET_AXIS_COUNT) HAL_Motion_GetAxisCount; + pHAL->Motion.GetSpeedXYZ = (HAL_MOTION_GET_SPEED_XYZ) HAL_Motion_GetSpeedXYZ; + pHAL->Motion.GetSpeedR = (HAL_MOTION_GET_SPEED_R) HAL_Motion_GetSpeedR; + pHAL->Motion.GetSettleTime = (HAL_MOTION_GET_SETTLE_TIME) HAL_Motion_GetSettleTime; + pHAL->Motion.GetDeadband = (HAL_MOTION_GET_DEADBAND) HAL_Motion_GetDeadband; + pHAL->Motion.GetRefreshDeadband = (HAL_MOTION_GET_REFRESH_DEADBAND) HAL_Motion_GetRefreshDeadband; + pHAL->Motion.GetStageLimits = (HAL_MOTION_GET_STAGE_LIMITS) HAL_Motion_GetStageLimits; + pHAL->Motion.SetStageLimits = (HAL_MOTION_SET_STAGE_LIMITS) HAL_Motion_SetStageLimits; + pHAL->Motion.GetMaxSpeed = (HAL_MOTION_GET_MAX_SPEED) HAL_Motion_GetMaxSpeed; + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->Motion.Startup = (HAL_MOTION_STARTUP) HAL_Motion_Startup; + pHAL->Motion.SetSpeedXYZ = (HAL_MOTION_SET_SPEED_XYZ) HAL_Motion_SetSpeedXYZ; + pHAL->Motion.SetSpeedR = (HAL_MOTION_SET_SPEED_R) HAL_Motion_SetSpeedR; + pHAL->Motion.SetAccelerationXYZ = (HAL_MOTION_SET_ACCELERATION_XYZ) HAL_Motion_SetAccelerationXYZ; + pHAL->Motion.SetAccelerationR = (HAL_MOTION_SET_ACCELERATION_R) HAL_Motion_SetAccelerationR; + pHAL->Motion.GetAccelerationXYZ = (HAL_MOTION_GET_ACCELERATION_XYZ) HAL_Motion_GetAccelerationXYZ; + pHAL->Motion.GetAccelerationR = (HAL_MOTION_GET_ACCELERATION_R) HAL_Motion_GetAccelerationR; + pHAL->Motion.GetPositionXYZ = (HAL_MOTION_GET_POSITION_XYZ) HAL_Motion_GetPositionXYZ; + pHAL->Motion.SetPositionXYZ = (HAL_MOTION_SET_POSITION_XYZ) HAL_Motion_SetPositionXYZ; + pHAL->Motion.GetPositionR = (HAL_MOTION_GET_POSITION_R) HAL_Motion_GetPositionR; + pHAL->Motion.SetPositionR = (HAL_MOTION_SET_POSITION_R) HAL_Motion_SetPositionR; + pHAL->Motion.IsHomed = (HAL_MOTION_IS_HOMED) HAL_Motion_IsHomed; + pHAL->Motion.Shutdown = (HAL_MOTION_SHUTDOWN) HAL_Motion_Shutdown; + } + } + pHAL->Pendant.IsSupported = (HAL_PENDANT_IS_SUPPORTED) HAL_Pendant_IsSupported; + if(pHAL->Pendant.IsActive(true)) + { + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->Pendant.Startup = (HAL_PENDANT_STARTUP) HAL_Pendant_Startup; + pHAL->Pendant.Enable = (HAL_PENDANT_ENABLE) HAL_Pendant_Enable; + pHAL->Pendant.Shutdown = (HAL_PENDANT_SHUTDOWN) HAL_Pendant_Shutdown; + } + } + + pHAL->Optics.IsSupported = (HAL_OPTICS_IS_SUPPORTED) HAL_Optics_IsSupported; + if(pHAL->Optics.IsActive(true)) + { +// pHAL->Optics.GetMagnificationSteps = (HAL_OPTICS_GET_MAGNIFICATION_STEPS) HAL_Optics_GetMagnificationSteps; +// pHAL->Optics.GetDeadband = (HAL_OPTICS_GET_DEADBAND) HAL_Optics_GetDeadband; + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->Optics.Startup = (HAL_OPTICS_STARTUP) HAL_Optics_Startup; + pHAL->Optics.GetScaleRange = (HAL_OPTICS_GET_SCALE_RANGE) HAL_Optics_GetScaleRange; + pHAL->Optics.GetScalePosition = (HAL_OPTICS_GET_SCALE_POSITION) HAL_Optics_GetScalePosition; + pHAL->Optics.SetScalePosition = (HAL_OPTICS_SET_SCALE_POSITION) HAL_Optics_SetScalePosition; + pHAL->Optics.EnableGrid = (HAL_OPTICS_ENABLE_GRID) HAL_Optics_EnableGrid; + pHAL->Optics.IsGridEnabled = (HAL_OPTICS_IS_GRID_ENABLED) HAL_Optics_IsGridEnabled; + pHAL->Optics.EnableLaser = (HAL_OPTICS_ENABLE_LASER) HAL_Optics_EnableLaser; + pHAL->Optics.IsLaserEnabled = (HAL_OPTICS_IS_LASER_ENABLED) HAL_Optics_IsLaserEnabled; + pHAL->Optics.Shutdown = (HAL_OPTICS_SHUTDOWN) HAL_Optics_Shutdown; + + // Load HSI library + HINSTANCE OpticsLib = ::AfxLoadLibrary(_T("WAI_Optics.dll")); + if(OpticsLib) + { + //Get startup address and call startup routine + HAL_STARTUP Startup = (HAL_STARTUP) ::GetProcAddress(OpticsLib, "HAL_Startup"); + if(Startup) + { + //store these function pointers (WAI_Optics.dll will change these) + HAL_SHUTDOWN pOrginalShutdown = pHAL->Shutdown; + HAL_GET_VERSION pOrginalGetVersion = pHAL->GetVersion; + + //TKr/100924: Adaption on V1.84 (new g_lFramegrabberType) + //if(Startup(hWnd, pHAL, bOfflineOnly, g_lFramegrabberType) == HAL_STATUS_NORMAL) +#pragma message("do we need a real framegrabber type here") + if(Startup(hWnd, pHAL, bOfflineOnly, 0) == HAL_STATUS_NORMAL) + { + //restore the original function pointers + pHAL->Shutdown = pOrginalShutdown; + pHAL->GetVersion = pOrginalGetVersion; + + //store the function pointers from the WAI_Optics.dll + //(will be used in HMV-Startup and -Shutdown) + g_HSIExt.g_lpfnWAIOpticsStartup = pHAL->Optics.Startup; + g_HSIExt.g_lpfnWALOpticsShutdown = pHAL->Optics.Shutdown; + + } + else + { + Status = HAL_STATUS_FAILED; + } + } + else + { + Status = HAL_STATUS_FAILED; + } + } + else + { + AfxMessageBox(_T("Failed Startup")); + Status = HAL_STATUS_FAILED; + } + } + } + + // Set exported HAL LASERPROBE function addresses + pHAL->LaserProbe.IsSupported = (HAL_LP_IS_SUPPORTED) HAL_LP_IsSupported; + + if(pHAL->LaserProbe.IsActive(true)) + { + // HAL LASERPROBE is supported + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->LaserProbe.Startup = (HAL_LP_STARTUP) HAL_LP_Startup; + pHAL->LaserProbe.Enable = (HAL_LP_ENABLE) HAL_LP_Enable; + pHAL->LaserProbe.IsEnabled = (HAL_LP_IS_ENABLED) HAL_LP_IsEnabled; + pHAL->LaserProbe.GetActiveProbe = (HAL_LP_GET_ACTIVE_PROBE) HAL_LP_GetActiveProbe; + pHAL->LaserProbe.SetActiveProbe = (HAL_LP_SET_ACTIVE_PROBE) HAL_LP_SetActiveProbe; + pHAL->LaserProbe.SetupMeasurePoint = (HAL_LP_SETUP_MEASURE_POINT) HAL_LP_SetupMeasurePoint; + pHAL->LaserProbe.DoMeasure = (HAL_LP_DO_MEASURE) HAL_LP_DoMeasure; + pHAL->LaserProbe.GetMeasureData = (HAL_LP_GET_MEASURE_DATA) HAL_LP_GetMeasureData; + pHAL->LaserProbe.Shutdown = (HAL_LP_SHUTDOWN) HAL_LP_Shutdown; + } + } + + // Set exported HAL TOUCHPROBE function addresses + pHAL->TouchProbe.IsSupported = (HAL_TP_IS_SUPPORTED) HAL_TP_IsSupported; + + if(pHAL->TouchProbe.IsActive(true)) + { + // HAL TOUCHPROBE is supported + if(!g_HSIExt.g_bOfflineOnly) + { + pHAL->TouchProbe.Startup = (HAL_TP_STARTUP) HAL_TP_Startup; + pHAL->TouchProbe.Enable = (HAL_TP_ENABLE) HAL_TP_Enable; + pHAL->TouchProbe.GetActiveProbe = (HAL_TP_GET_ACTIVE_PROBE) HAL_TP_GetActiveProbe; + pHAL->TouchProbe.SetActiveProbe = (HAL_TP_SET_ACTIVE_PROBE) HAL_TP_SetActiveProbe; + pHAL->TouchProbe.SetManualTouchData = (HAL_TP_SET_MANUAL_TOUCH_DATA) HAL_TP_SetManualTouchData; + pHAL->TouchProbe.GetTipOffset = (HAL_TP_GET_TIP_OFFSET) HAL_TP_GetTipOffset; + pHAL->TouchProbe.SetTipOffset = (HAL_TP_SET_TIP_OFFSET) HAL_TP_SetTipOffset; + pHAL->TouchProbe.SetupMeasurePoint = (HAL_TP_SETUP_MEASURE_POINT) HAL_TP_SetupMeasurePoint; + pHAL->TouchProbe.DoMeasure = (HAL_TP_DO_MEASURE) HAL_TP_DoMeasure; + pHAL->TouchProbe.IsMeasuring = (HAL_TP_IS_MEASURING) HAL_TP_IsMeasuring; + pHAL->TouchProbe.GetMeasureData = (HAL_TP_GET_MEASURE_DATA) HAL_TP_GetMeasureData; + pHAL->TouchProbe.Shutdown = (HAL_TP_SHUTDOWN) HAL_TP_Shutdown; + } + } + + // Set exported HAL FIXTURE function addresses + pHAL->Fixture.IsSupported = (HAL_FIXTURE_IS_SUPPORTED) HAL_Fixture_IsSupported; + + if(pHAL->Fixture.IsActive(true)) + { + // HAL FIXTURE is supported + if(!g_HSIExt.g_bOfflineOnly) + { + //pHAL->Fixture.Startup = (HAL_FIXTURE_STARTUP) HAL_Fixture_Startup; + //pHAL->Fixture.Shutdown = (HAL_FIXTURE_SHUTDOWN) HAL_Fixture_Shutdown; + } + } + + // Set exported HAL TOOLCHANGER function addresses + pHAL->ToolChanger.IsSupported = (HAL_TC_IS_SUPPORTED) HAL_TC_IsSupported; + + if(pHAL->ToolChanger.IsActive(true)) + { + // HAL TOOLCHANGER is supported + if(!g_HSIExt.g_bOfflineOnly) + { + //pHAL->ToolChanger.Startup = (HAL_TC_STARTUP) HAL_TC_Startup; + //pHAL->ToolChanger.Shutdown = (HAL_TC_SHUTDOWN) HAL_TC_Shutdown; + } + } + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_GetMachineCount(int &NumMachines) +{ + NumMachines=HAL_NUM_MACHINE_TYPES; + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_GetMachineInfo(int Machine, TCHAR *MachineName, TCHAR *FirmwareVersion) +{ + switch(Machine) + { + case HAL_MACHINE_TYPE_EXCEL: + wcsncpy_s(MachineName, HAL_MaxStringLength+1, _T("MicroVu Excel"), HAL_MaxStringLength); + wcsncpy_s(FirmwareVersion, HAL_MaxStringLength+1, _T(""), HAL_MaxStringLength); + break; + + case HAL_MACHINE_TYPE_VECTRA: + wcsncpy_s(MachineName, HAL_MaxStringLength+1, _T("MicroVu Vectra"), HAL_MaxStringLength); + wcsncpy_s(FirmwareVersion, HAL_MaxStringLength+1, _T(""), HAL_MaxStringLength); + break; + + case HAL_MACHINE_TYPE_UNSELECTED: + default: + wcsncpy_s(MachineName, HAL_MaxStringLength+1, _T("Not selected"), HAL_MaxStringLength); + wcsncpy_s(FirmwareVersion, HAL_MaxStringLength+1, _T(""), HAL_MaxStringLength); + break; + } + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_GetActiveMachine(int &Machine) +{ + Machine=g_HSIExt.m_ActiveMachineType; + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_SetActiveMachine(int Machine) +{ + g_HSIExt.InitialiseMachineType((HAL_MACHINE_TYPE)Machine); + return HAL_STATUS_NORMAL; +} + + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_SetLocale(UINT /*LCID*/) +{ + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_SetRegistryRootKey(TCHAR * /*RegistryKey*/) +{ + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_PreSetupDialog(CPropertySheet * /*SetupDlg*/, bool /*bOfflineSetup*/) +{ + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_PostSetupDialog(CPropertySheet * /*SetupDlg*/) +{ + return HAL_STATUS_NORMAL; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_Calibrate(HAL_CALIBRATE_TYPE /*Type*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +//*********************************************************************************************** +// +//*********************************************************************************************** +HAL_STATUS HAL_Notify (HAL_NOTIFY_TYPE Type) +{ + HAL_STATUS retVal=HAL_STATUS_NORMAL; + + if(Type==HAL_NOTIFY_PROGRAM_EXECUTION_START) + { + TCHAR Msg[HAL_MaxStringLength+1]; + CString MsgStr; + MsgStr.LoadString(IDS_ALIGN_ROTARY); + wcsncpy_s(Msg, HAL_MaxStringLength+1, MsgStr, HAL_MaxStringLength); + + // Do the below event call ONLY if rotary table enabled. + if(g_HSIExt.m_AxisEnabled[HAL_AXIS_Q] && IsRotaryEnabled()) + { +// xxxx g_pHSI->Event(HAL_EVENT_FUNCTION, HAL_EVENT_DISPLAY_OK_MESSAGE, Msg, EventCallbackID); + + // OK - lets store the rotary offset position at this point + if(IsBoardPresent()) + { + // Read current position + //long Position[4] = {0,0,0,0}; + //long Direction[4]; +// UNREFERENCED_PARAMETER(Direction); +// bool Error[4]; +// gCncBd->getAxisInfo(Position, Direction, Error); + //g_HSIExt.m_AxisRefMarkOffset[HAL_AXIS_Q] = Position[HAL_AXIS_Q]; + } + } + } + return retVal; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_GetCustomCalibrationTypeInfo(HAL_CALIBRATE_TYPE /*Type*/, TCHAR * /*Name*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_EventResponse(UINT /*EventCallbackID*/, HAL_EVENT_RESPONSE_TYPE /*ResponseType*/) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + return Status; +} + +////////////////////////////////////////////////////////////////////// +HAL_STATUS HAL_GetCustomMessage(HAL_CUSTOM_MESSAGE_TYPE Msg,TCHAR *Message) +{ + HAL_STATUS Status = HAL_STATUS_NORMAL; + + if(g_HSIExt.m_HomeManual) + { + CString MessageStr; + switch(Msg) + { + case HAL_CUSTOM_MESSAGE_HOME_MACHINE: + if(g_HSIExt.m_HomeToLimitSwitch) + MessageStr.LoadString(IDS_HOME_MANUAL_MACHINE_LIMIT); + else + MessageStr.LoadString(IDS_HOME_MANUAL_MACHINE_REF); + break; + + default: + break; + } + wcsncpy_s(Message, HAL_MaxStringLength+1, MessageStr, HAL_MaxStringLength); + } + + return Status; +} + +/////////////////////////////////////////////////////////////////////////////// +// For USB, we will initialize this +// If it is not initialized, we will initialize the Mv_USB. +// If it is already initialized, we reply with true; +bool IsBoardPresent() +{ + return (g_pMv_Proto?true:false); +} + +////////////////////////////////////////////////////////////////////// +bool IsControllerPresent() +{ +// return (IsBoardPresent() && gCncBd && gCncBd->isCncAllowed()); + return true; +} + +////////////////////////////////////////////////////////////////////// +bool IsZoomMoving(void) +{ + long Zoom1=0,Zoom2=-1; + + g_pHSI->Optics.GetScalePosition(Zoom1); + Sleep(50); + g_pHSI->Optics.GetScalePosition(Zoom2); + + if(labs(Zoom1-Zoom2)>2) + return true; + else + return false; +}; + +////////////////////////////////////////////////////////////////////// +bool IsRotaryEnabled(void) +{ + ASSERT(g_pHSI->Event); + + UINT EventCallbackID; + TCHAR EventData[HAL_MaxStringLength+1]; + wcsncpy_s(EventData,HAL_MaxStringLength+1, _T(""), HAL_MaxStringLength); + HAL_EVENT_RESPONSE_TYPE EventResponse=g_pHSI->Event(HAL_EVENT_FUNCTION, HAL_EVENT_IS_ROTAB_ENABLED, EventData, EventCallbackID); + return EventResponse==HAL_EVENT_RESPONSE_YES; +}; + +/////////////////////////////////////////////////////////////////////////////// +void HAL_SendDebug(LPCTSTR format, ...) +{ + va_list list; + va_start(list, format); +// debug.SendAndFlush(format, list); +} + +/////////////////////////////////////////////////////////////////////////////// + +double TimeInMsecs(void) +{ + double Msecs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPerMsec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart / 1000.0); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Msecs = ((double)HPTicks.QuadPart / HPCounterTicksPerMsec); + } + else + { + // Use clock with less resolution. + Msecs = GetTickCount(); + } + return Msecs; +} + +/////////////////////////////////////////////////////////////////////////////// diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.H new file mode 100644 index 0000000..a888ed4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI.H @@ -0,0 +1,45 @@ +#pragma once +#include "Hal_MicroVu.h" + +////////////////////////////////////////////////////////////////////// +// +// HSI.h : Implementation of the MicroVu HSI supporting: +// - MicroVu based systems +// +////////////////////////////////////////////////////////////////////// +// Entry points declarations + +HAL_STATUS HAL_Shutdown(); +HAL_STATUS HAL_GetMachineCount(int &NumMachines); +HAL_STATUS HAL_GetMachineInfo(int Machine, TCHAR *MachineName, TCHAR *FirmareVersion); +HAL_STATUS HAL_SetActiveMachine(int Machine); +HAL_STATUS HAL_GetActiveMachine(int &Machine); +HAL_STATUS HAL_GetStageLimits(double *StageLimitMax, double *StageLimitMin); +//HAL_STATUS HAL_SetStageLimits(bool bStageLimitEnabled, double *StageLimitMax, double *StageLimitMin); +HAL_STATUS HAL_GetCustomMessage(HAL_CUSTOM_MESSAGE_TYPE Msg, TCHAR *Message); +HAL_STATUS HAL_SetLocale(UINT LCID); +HAL_STATUS HAL_SetRegistryRootKey(TCHAR *RegistryKey); +HAL_STATUS HAL_Calibrate(HAL_CALIBRATE_TYPE Type); +HAL_STATUS HAL_Notify(HAL_NOTIFY_TYPE Type); +HAL_STATUS HAL_GetCustomCalibrationTypeInfo(HAL_CALIBRATE_TYPE Type, TCHAR *Name); +HAL_STATUS HAL_EventResponse(UINT EventCallbackID, HAL_EVENT_RESPONSE_TYPE ResponseType); +HAL_STATUS HAL_PreSetupDialog(CPropertySheet *SetupDlg, bool bOfflineSetup); +HAL_STATUS HAL_PostSetupDialog(CPropertySheet *SetupDlg); +//HAL_STATUS HAL_GetTemperatureSensor(int Sensor, double &Temperature); +//HAL_STATUS HAL_GetTemperatureSensorCount(int &NumSensors); + +//void HAL_WaitMoveCompleteSetup(DWORD WaitTimeout = MOTION_TIMEOUT, bool WaitOptics = false); +//HAL_STATUS HAL_WaitMoveCompleteResult(void); +//unsigned __stdcall WatchMoveThread(LPVOID /*pThis*/); +HAL_STATUS HAL_MapSupportedFunctions(CHAL *pHAL, HWND hWnd, bool bOfflineOnly); + +bool IsRotaryEnabled(void); +//unsigned __stdcall JoystickLightingThread(LPVOID /*pThis*/); + +void HAL_SendDebug(LPCTSTR format, ...); + +const long UNINITIALIZED = 1; +const long RUNNING = 2; +const long ERRORBLOCKING = 3; +const long SHUTDOWN = 4; +const long RUNNINGPREONLINE = 5; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.DEF b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.DEF new file mode 100644 index 0000000..762ac86 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.DEF @@ -0,0 +1,7 @@ +; HSI_MicroVu.def : Declares the module parameters for the DLL. + +LIBRARY "HSI_MicroVu.DLL" +; DESCRIPTION 'HSI_MicroVu Windows Dynamic Link Library' // rk 040809 + +EXPORTS + ; Explicit exports can go here diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.RC b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.RC new file mode 100644 index 0000000..9285686 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.RC @@ -0,0 +1,150 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" +#include "VersionInfo.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION FILEVERSIONMACRO + PRODUCTVERSION PRODUCTVERSIONMACRO + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Wilcox Associates, Inc.\0" + VALUE "FileDescription", "HSI_MicroVu DLL" + VALUE "FileVersion", FILEVERSIONMACROQT + VALUE "InternalName", "HSI_MicroVu" + VALUE "LegalCopyright", LEGALCOPYRIGHTMACRO + VALUE "OriginalFilename", "HSI_MicroVu.DLL" + VALUE "ProductName", "PC-DMIS EMS\0" + VALUE "ProductVersion", PRODUCTVERSIONMACROQT + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CONFIG_DLG DIALOG 0, 0, 294, 185 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "MicroVu Configuration" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,237,7,50,14 + PUSHBUTTON "Cancel",IDCANCEL,237,24,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_PROJNAME "HSI_MicroVu" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj new file mode 100644 index 0000000..f287551 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj @@ -0,0 +1,370 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B} + HSI_MicroVu + MFCProj + + + + DynamicLibrary + Dynamic + Unicode + + + DynamicLibrary + Dynamic + Unicode + false + + + DynamicLibrary + Dynamic + Unicode + + + DynamicLibrary + Dynamic + Unicode + false + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + false + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + $(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\ + true + + + + true + Win32 + .\UnicodeRelease/HSI_MICROVU.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\..\include;..\..\WAI_Framegrabber;..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\include + NDEBUG;WIN32;_WINDOWS;CLEAN_STDAFX;_AFXEXT;INTERFACE_CPP;_MBCS;_WIN32_DCOM;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + NotUsing + + + + + true + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ..\..\..\..\PcdUtilities;..\..\..\..\ExtractedModules\PcdUtilitiesLib + + + version.lib;libusb.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\HSI_MicroVu.DEF + false + Windows + false + + + MachineX86 + ..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\lib\Msvc + + + xcopy “$(OutDir)\*.dll” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y +xcopy “$(OutDir)\*.lib” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y + + + + + true + X64 + .\UnicodeRelease/HSI_METRONICS.tlb + + + + + MaxSpeed + OnlyExplicitInline + ..\..\..\..\include;..\..\WAI_Framegrabber;..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\include + NDEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_MBCS;_WIN32_DCOM;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + NotUsing + + + + + true + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ..\..\..\..\PcdUtilities;..\..\..\..\ExtractedModules\PcdUtilitiesLib + + + version.lib;libusb.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + .\HSI_MicroVu.DEF + false + Windows + false + + + MachineX64 + ..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\lib\Msvc_x64 + + + xcopy “$(OutDir)\*.dll” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y +xcopy “$(OutDir)\*.lib” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y + + + + + true + Win32 + .\UnicodeDebug/HSI_METRONICS.tlb + + + + + Disabled + ..\..\..\..\include;..\..\WAI_Framegrabber;..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\include + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_MBCS;_WIN32_DCOM;_CRT_SECURE_NO_WARNINGS;CLEAN_STDAFX;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + NotUsing + + + true + true + Default + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ..\..\..\..\PcdUtilities;..\..\..\..\ExtractedModules\PcdUtilitiesLib + + + version.lib;libusb.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + HSI_MicroVu.DEF + NetDebug/HSI_MicroVu.pdb + NetDebug/HSI_MicroVu.map + Windows + false + + + MachineX86 + false + false + ..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\lib\Msvc + + + xcopy “$(OutDir)\*.dll” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y +xcopy “$(OutDir)\*.lib” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y + + + + + true + X64 + .\UnicodeDebug/HSI_METRONICS.tlb + + + + + Disabled + ..\..\..\..\include;..\..\WAI_Framegrabber;..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\include + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_MBCS;_WIN32_DCOM;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + NotUsing + + + true + true + Default + + + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ..\..\..\..\PcdUtilities;..\..\..\..\ExtractedModules\PcdUtilitiesLib + + + version.lib;libusb.lib;%(AdditionalDependencies) + $(OutDir)$(TargetName)$(TargetExt) + true + HSI_MicroVu.DEF + NetDebug/HSI_MicroVu.pdb + NetDebug/HSI_MicroVu.map + Windows + false + + + MachineX64 + ..\..\..\..\..\ThirdParty\SourceForge\LibUsb_Win\lib\Msvc_x64 + + + xcopy “$(OutDir)\*.dll” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y +xcopy “$(OutDir)\*.lib” ..\..\..\..\..\bin\$(PlatformName)\$(ConfigurationName)\*.* /D /F /Y + + + + + + + + + + + + + + + Disabled + %(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM;_CRT_SECURE_NO_WARNINGS + EnableFastChecks + Disabled + %(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + EnableFastChecks + MaxSpeed + %(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + MaxSpeed + %(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + + + + + Disabled + %(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + EnableFastChecks + Create + Disabled + %(AdditionalIncludeDirectories) + _DEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + EnableFastChecks + Create + MaxSpeed + %(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + Create + MaxSpeed + %(AdditionalIncludeDirectories) + NDEBUG;WIN32;_WINDOWS;_AFXEXT;INTERFACE_CPP;_WINDLL;_AFXDLL;_MBCS;_UNICODE;_WIN32_DCOM + Create + + + + + + + + + + + + + + + + + + + + + + + + + + {c570156d-3729-40f7-be6d-5bf411de128a} + false + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.filters b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.filters new file mode 100644 index 0000000..0a4af55 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.filters @@ -0,0 +1,134 @@ + + + + + {b5f61841-f52e-4495-b363-ecda19f0cb6a} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {109e2ac6-d7af-46ef-9bb8-751479f9f725} + h;hpp;hxx;hm;inl + + + {6c1f5117-7c39-468d-9f23-02f738f3d6a4} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {a15e73e5-34df-469c-83f1-70b27f888ff1} + lib + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + + + Source Files + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.user b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/HSI_MicroVu.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.sln b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.sln new file mode 100644 index 0000000..89c5ba8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.sln @@ -0,0 +1,191 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_OPTICS", "..\..\WAI_CALIBRATION\WAI_OPTICS\WAI_OPTICS.vcxproj", "{C570156D-3729-40F7-BE6D-5BF411DE128A}" + ProjectSection(ProjectDependencies) = postProject + {BA27142D-4833-49CC-9D57-5B926FCB2698} = {BA27142D-4833-49CC-9D57-5B926FCB2698} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSI", "..\..\MSI\MSI.vcxproj", "{10A99A1A-F837-4176-9803-CAD29E1626EB}" + ProjectSection(ProjectDependencies) = postProject + {BA27142D-4833-49CC-9D57-5B926FCB2698} = {BA27142D-4833-49CC-9D57-5B926FCB2698} + {C570156D-3729-40F7-BE6D-5BF411DE128A} = {C570156D-3729-40F7-BE6D-5BF411DE128A} + {4615AD84-2342-4235-B117-0EFA3367D235} = {4615AD84-2342-4235-B117-0EFA3367D235} + {4615AD84-2342-4235-B117-0EFA3367D236} = {4615AD84-2342-4235-B117-0EFA3367D236} + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D} = {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D} + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5} = {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5} + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2} = {5F821CE7-2FAA-4E64-B501-8833D19BC4E2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_VideoProbe", "..\..\WAI_VIDEOPROBE\WAI_VIDEOPROBE.vcxproj", "{BA27142D-4833-49CC-9D57-5B926FCB2698}" + ProjectSection(ProjectDependencies) = postProject + {BA27142D-4833-49CC-9D57-5B926FCB2698} = {BA27142D-4833-49CC-9D57-5B926FCB2698} + {C570156D-3729-40F7-BE6D-5BF411DE128A} = {C570156D-3729-40F7-BE6D-5BF411DE128A} + {4615AD84-2342-4235-B117-0EFA3367D235} = {4615AD84-2342-4235-B117-0EFA3367D235} + {4615AD84-2342-4235-B117-0EFA3367D236} = {4615AD84-2342-4235-B117-0EFA3367D236} + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D} = {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D} + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2} = {5F821CE7-2FAA-4E64-B501-8833D19BC4E2} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FrameGrabber_IDS_4_51", "..\..\WAI_FRAMEGRABBER\IDS\WAI_FRAMEGRABBER_IDS_45\WAI_FRAMEGRABBER_IDS_4_51.vcxproj", "{4615AD84-2342-4235-B117-0EFA3367D235}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_IDS_4_60", "..\..\WAI_FRAMEGRABBER\IDS\WAI_FRAMEGRABBER_IDS_46\WAI_FRAMEGRABBER_IDS_4_60.vcxproj", "{4615AD84-2342-4235-B117-0EFA3367D236}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_MATROX_MIL_7_50", "..\..\WAI_FRAMEGRABBER\MATROX\MIL75\WAI_FRAMEGRABBER_MATROX_MIL_7_50.vcxproj", "{5F821CE7-2FAA-4E64-B501-8833D19BC4E2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_MATROX_MIL_9_20", "..\..\WAI_FRAMEGRABBER\MATROX\MIL92\WAI_FRAMEGRABBER_MATROX_MIL_9_20.vcxproj", "{9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HSI_MicroVu", "HSI_MicroVu.vcxproj", "{992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}" + ProjectSection(ProjectDependencies) = postProject + {10A99A1A-F837-4176-9803-CAD29E1626EB} = {10A99A1A-F837-4176-9803-CAD29E1626EB} + {BA27142D-4833-49CC-9D57-5B926FCB2698} = {BA27142D-4833-49CC-9D57-5B926FCB2698} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FrameDisplay", "..\..\WAI_FrameDisplay\WAI_FrameDisplay.vcxproj", "{FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_IDS_4_61", "..\..\WAI_FRAMEGRABBER\IDS\WAI_FRAMEGRABBER_IDS_461\WAI_FRAMEGRABBER_IDS_4_61.vcxproj", "{4615AD84-2342-4235-B117-0EFA3367D237}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_IDS_UEYE_3_60", "..\..\WAI_FRAMEGRABBER\IDS\WAI_FRAMEGRABBER_IDS_UEYE_36\WAI_FRAMEGRABBER_IDS_UEYE_3_60.vcxproj", "{4615AD84-2342-4235-B117-0EFA3367D239}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_IDS_UEYE_3_82", "..\..\WAI_FRAMEGRABBER\IDS\WAI_FRAMEGRABBER_IDS_UEYE_38\WAI_FRAMEGRABBER_IDS_UEYE_3_82.vcxproj", "{2DBD0F9C-0815-479B-B476-D6D694678FC5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_MATROX_MIL_8_0", "..\..\WAI_FRAMEGRABBER\MATROX\MIL8\WAI_FRAMEGRABBER_MATROX_MIL_8_0.vcxproj", "{7F06782C-7CE2-4DF0-8A74-5E4151310782}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_MATROX_MIL_9_0", "..\..\WAI_FRAMEGRABBER\MATROX\MIL9\WAI_FRAMEGRABBER_MATROX_MIL_9_0.vcxproj", "{3D7D6847-D15F-4ED8-92F4-6688596E6EEF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WAI_FRAMEGRABBER_NI_4_4", "..\..\WAI_FRAMEGRABBER\NationalInstruments\WAI_FRAMEGRABBER_NI_44\WAI_FRAMEGRABBER_NI_4_4.vcxproj", "{0ACDD27D-746F-4229-BEBC-28D0CD189846}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FrameGrabber", "FrameGrabber", "{8B0594E3-9D71-4D64-9897-1223A5892DEF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Debug|Win32.ActiveCfg = Debug|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Debug|Win32.Build.0 = Debug|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Debug|x64.ActiveCfg = Debug|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Debug|x64.Build.0 = Debug|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Release|Win32.ActiveCfg = Release|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Release|Win32.Build.0 = Release|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Release|x64.ActiveCfg = Release|Win32 + {C570156D-3729-40F7-BE6D-5BF411DE128A}.Release|x64.Build.0 = Release|Win32 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Debug|Win32.ActiveCfg = Debug|Win32 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Debug|Win32.Build.0 = Debug|Win32 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Debug|x64.ActiveCfg = Debug|x64 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Debug|x64.Build.0 = Debug|x64 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Release|Win32.ActiveCfg = Release|Win32 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Release|Win32.Build.0 = Release|Win32 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Release|x64.ActiveCfg = Release|x64 + {10A99A1A-F837-4176-9803-CAD29E1626EB}.Release|x64.Build.0 = Release|x64 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Debug|Win32.ActiveCfg = Debug|Win32 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Debug|Win32.Build.0 = Debug|Win32 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Debug|x64.ActiveCfg = Debug|x64 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Debug|x64.Build.0 = Debug|x64 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Release|Win32.ActiveCfg = Release|Win32 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Release|Win32.Build.0 = Release|Win32 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Release|x64.ActiveCfg = Release|x64 + {BA27142D-4833-49CC-9D57-5B926FCB2698}.Release|x64.Build.0 = Release|x64 + {4615AD84-2342-4235-B117-0EFA3367D235}.Debug|Win32.ActiveCfg = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D235}.Debug|Win32.Build.0 = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D235}.Debug|x64.ActiveCfg = Debug|x64 + {4615AD84-2342-4235-B117-0EFA3367D235}.Release|Win32.ActiveCfg = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D235}.Release|Win32.Build.0 = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D235}.Release|x64.ActiveCfg = Release|x64 + {4615AD84-2342-4235-B117-0EFA3367D236}.Debug|Win32.ActiveCfg = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D236}.Debug|Win32.Build.0 = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D236}.Debug|x64.ActiveCfg = Debug|x64 + {4615AD84-2342-4235-B117-0EFA3367D236}.Release|Win32.ActiveCfg = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D236}.Release|Win32.Build.0 = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D236}.Release|x64.ActiveCfg = Release|x64 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Debug|Win32.ActiveCfg = Debug|Win32 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Debug|Win32.Build.0 = Debug|Win32 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Debug|x64.ActiveCfg = Debug|x64 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Release|Win32.ActiveCfg = Release|Win32 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Release|Win32.Build.0 = Release|Win32 + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2}.Release|x64.ActiveCfg = Release|x64 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Debug|Win32.ActiveCfg = Debug|Win32 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Debug|Win32.Build.0 = Debug|Win32 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Debug|x64.ActiveCfg = Debug|x64 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Debug|x64.Build.0 = Debug|x64 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Release|Win32.ActiveCfg = Release|Win32 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Release|Win32.Build.0 = Release|Win32 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Release|x64.ActiveCfg = Release|x64 + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D}.Release|x64.Build.0 = Release|x64 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Debug|Win32.ActiveCfg = Debug|Win32 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Debug|Win32.Build.0 = Debug|Win32 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Debug|x64.ActiveCfg = Debug|x64 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Debug|x64.Build.0 = Debug|x64 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Release|Win32.ActiveCfg = Release|Win32 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Release|Win32.Build.0 = Release|Win32 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Release|x64.ActiveCfg = Release|x64 + {992F2F1B-CE2A-44EE-8E24-13DE4DFC8B9B}.Release|x64.Build.0 = Release|x64 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Debug|Win32.ActiveCfg = Debug|Win32 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Debug|Win32.Build.0 = Debug|Win32 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Debug|x64.ActiveCfg = Debug|x64 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Debug|x64.Build.0 = Debug|x64 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Release|Win32.ActiveCfg = Release|Win32 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Release|Win32.Build.0 = Release|Win32 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Release|x64.ActiveCfg = Release|x64 + {FE3EF8DB-18A6-4932-8B5A-69AC5A803EF5}.Release|x64.Build.0 = Release|x64 + {4615AD84-2342-4235-B117-0EFA3367D237}.Debug|Win32.ActiveCfg = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D237}.Debug|Win32.Build.0 = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D237}.Debug|x64.ActiveCfg = Debug|x64 + {4615AD84-2342-4235-B117-0EFA3367D237}.Debug|x64.Build.0 = Debug|x64 + {4615AD84-2342-4235-B117-0EFA3367D237}.Release|Win32.ActiveCfg = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D237}.Release|Win32.Build.0 = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D237}.Release|x64.ActiveCfg = Release|x64 + {4615AD84-2342-4235-B117-0EFA3367D237}.Release|x64.Build.0 = Release|x64 + {4615AD84-2342-4235-B117-0EFA3367D239}.Debug|Win32.ActiveCfg = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D239}.Debug|Win32.Build.0 = Debug|Win32 + {4615AD84-2342-4235-B117-0EFA3367D239}.Debug|x64.ActiveCfg = Debug|x64 + {4615AD84-2342-4235-B117-0EFA3367D239}.Release|Win32.ActiveCfg = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D239}.Release|Win32.Build.0 = Release|Win32 + {4615AD84-2342-4235-B117-0EFA3367D239}.Release|x64.ActiveCfg = Release|x64 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Debug|Win32.ActiveCfg = Debug|Win32 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Debug|Win32.Build.0 = Debug|Win32 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Debug|x64.ActiveCfg = Debug|x64 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Debug|x64.Build.0 = Debug|x64 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Release|Win32.ActiveCfg = Release|Win32 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Release|Win32.Build.0 = Release|Win32 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Release|x64.ActiveCfg = Release|x64 + {2DBD0F9C-0815-479B-B476-D6D694678FC5}.Release|x64.Build.0 = Release|x64 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Debug|Win32.ActiveCfg = Debug|Win32 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Debug|Win32.Build.0 = Debug|Win32 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Debug|x64.ActiveCfg = Debug|x64 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Release|Win32.ActiveCfg = Release|Win32 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Release|Win32.Build.0 = Release|Win32 + {7F06782C-7CE2-4DF0-8A74-5E4151310782}.Release|x64.ActiveCfg = Release|x64 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Debug|Win32.ActiveCfg = Debug|Win32 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Debug|Win32.Build.0 = Debug|Win32 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Debug|x64.ActiveCfg = Debug|x64 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Release|Win32.ActiveCfg = Release|Win32 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Release|Win32.Build.0 = Release|Win32 + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF}.Release|x64.ActiveCfg = Release|x64 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Debug|Win32.ActiveCfg = Debug|Win32 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Debug|Win32.Build.0 = Debug|Win32 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Debug|x64.ActiveCfg = Debug|x64 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Debug|x64.Build.0 = Debug|x64 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Release|Win32.ActiveCfg = Release|Win32 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Release|Win32.Build.0 = Release|Win32 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Release|x64.ActiveCfg = Release|x64 + {0ACDD27D-746F-4229-BEBC-28D0CD189846}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4615AD84-2342-4235-B117-0EFA3367D236} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {5F821CE7-2FAA-4E64-B501-8833D19BC4E2} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {9EEE5D94-EA5F-44A2-99F0-609A0DE80D8D} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {4615AD84-2342-4235-B117-0EFA3367D237} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {4615AD84-2342-4235-B117-0EFA3367D239} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {2DBD0F9C-0815-479B-B476-D6D694678FC5} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {7F06782C-7CE2-4DF0-8A74-5E4151310782} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {3D7D6847-D15F-4ED8-92F4-6688596E6EEF} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {0ACDD27D-746F-4229-BEBC-28D0CD189846} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + {4615AD84-2342-4235-B117-0EFA3367D235} = {8B0594E3-9D71-4D64-9897-1223A5892DEF} + EndGlobalSection +EndGlobal diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.suo b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.suo new file mode 100644 index 0000000..939c703 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/IHSI_MicroVu.suo differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/LOGGER.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/LOGGER.CPP new file mode 100644 index 0000000..69936bc --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/LOGGER.CPP @@ -0,0 +1,54 @@ +#include "stdafx.h" + +#include "Logger.h" + +void CLogger::Send(LPCTSTR format, ...) +{ + if (!m_File) + { + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } + int length = 0; + va_list list; + va_start(list, format); + length = vswprintf_s(m_Str,5000, format, list); + if(m_File) + { + _ftprintf(m_File, m_Str); + } +} +void CLogger::SendAndFlush(LPCTSTR format, ...) +{ + int length = 0; + va_list list; + + va_start(list, format); + length = vswprintf_s(m_Str2,5000, format, list); + Send(m_Str2); + + if(m_File) + { + fclose(m_File); + m_File = NULL; + if(m_FileName.GetLength() > 0) + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } +} + +void CLogger::SendAndFlushPerMode(LPCTSTR format, ...) +{ + int length = 0; + va_list list; + + va_start(list, format); + length = vswprintf_s(m_Str2,5000, format, list); + Send(m_Str2); + + if((m_lLogMask & LOGFLUSH) && m_File) + { + fclose(m_File); + m_File = NULL; + if(m_FileName.GetLength() > 0) + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/MicroVu_ReadMe.txt b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/MicroVu_ReadMe.txt new file mode 100644 index 0000000..12a505b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/MicroVu_ReadMe.txt @@ -0,0 +1,23 @@ +Device Driver Installation + + Use the INF-Wizard program to generate the INF file (modify the vendor and product IDs, strings etc). Create different inf-files to install different types of devices (devices with different IDs). + Unplug the device(s) from the system. This is optional. + Open the Windows Device Manager and remove all incorrectly installed USB devices (device entries with a yellow exclamation mark). This is optional. + Reconnect the device(s) to the system. + When Windows asks for a driver, choose the inf-file(s) created above. Windows will warn that the driver is is not 'digitally signed'. Ignore this message and continue with the installation. Since version 1.2.0.0, a valid digital signature is embedded inside libusb0.sys for AMD/Intel x86_64 version of Windows so that the users can install the driver as well under 64bit x86_64 version of Windows Vista/7/2008/2008R2. + Open the Windows Device Manager to verify that the device is installed correctly. Run the test program (testlibusb-win.exe) from the 'bin directory'. It should print out the descriptors of your device(s). + A reboot isn't necessary. + Starting from version 1.2.1.0, the inf-wizard.exe has embedded driver binaries and provide an option to install the driver at the end of the process. + +Removing the Device Driver + + The device driver can not be easily removed from the system. You can however try to use usbdeview to remove the entries. Under Vista and Windows 7, you can use pnputil to remove the driver package. + +Updating the Device Driver + + Download the latest device driver binary package (libusb-win32-device-bin-x.x.x.x.zip or tar.gz). + Modify the inf-file as described in the Installation section. + Open the Device Manager and select the device you want to update. + Choose 'Properties->Driver->Update'. Disable the automatic installation and select the new inf-file manually. + Since 1.2.1.0, inf-wizard.exe can be used to automatically install/update the device driver. + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.cpp b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.cpp new file mode 100644 index 0000000..914d47f --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.cpp @@ -0,0 +1,3294 @@ +//============================================================================= +#include "stdafx.h" +#include "Mv_Proto.h" +#include "SsiStatus.h" +#include "Logger.h" +#include "math.h" + +#define MY_CONFIG 1 +#define MAX_DEVPATH_LENGTH 256 +#define ENDPOINT_TIMEOUT 500 + +//***** Static Data ***** +struct_ep_buff CMv_Proto::ep_buff[lEPSIZE]; + +//================================================================ +int CMv_Proto::g_hEP81_Thread_State=THREAD_PAUSED; +HANDLE CMv_Proto::g_hEP81_Thread_Id=NULL; + +//================================================================ +int CMv_Proto::g_hEP82_Thread_State=THREAD_PAUSED; +HANDLE CMv_Proto::g_hEP82_Thread_Id=NULL; + +//================================================================ +int CMv_Proto::g_hEP01_Thread_State=THREAD_PAUSED; +HANDLE CMv_Proto::g_hEP01_Thread_Id=NULL; +HANDLE CMv_Proto::g_hEP01_Serial_Mutex; + +//================================================================ +int CMv_Proto::g_hEP02_Thread_State=THREAD_PAUSED; +HANDLE CMv_Proto::g_hEP02_Thread_Id=NULL; +HANDLE CMv_Proto::g_hEP02_Serial_Mutex; + +//================================================================ +struct_machine CMv_Proto::g_machine; +usb_dev_handle *CMv_Proto::g_dev=NULL; +CLogger *CMv_Proto::g_pLogger; +HANDLE CMv_Proto::g_hHomedEvent = NULL; + +//=========================================================================== +// Worker Thread to serialize EP_01 commands. +//=========================================================================== +unsigned __stdcall CMv_Proto::g_EP01_Thread(LPVOID pThis) +{ + CMv_Proto* _This = (CMv_Proto*)pThis; + for (;;) + { + TRACE0("g_hSerialUsbThread in loop set.\n"); + if (g_hEP01_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_01_CMD_IDX]._event,INFINITE); + TRACE0("g_hSerialUsbThread obtained event.\n"); + switch (g_hEP01_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hSerialUsbThread processing _send_usb_data();\n"); + _This->_send_usb_data(EP_01_CMD_IDX); + TRACE0("g_hSerialUsbThread return from _send_usb_data();\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP01_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//============================================== ============================= +// Worker Thread to serialize EP_02 commands. +//=========================================================================== +unsigned __stdcall CMv_Proto::g_EP02_Thread(LPVOID pThis) +{ + CMv_Proto* _This = (CMv_Proto*)pThis; + for (;;) + { + TRACE0("g_hEP02_Thread in loop set.\n"); + if (g_hEP02_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_02_CMD_IDX]._event,INFINITE); + TRACE0("g_hEP02_Thread obtained event.\n"); + switch (g_hEP02_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hEP02_Thread calling _send_usb_data. EP_02; %x\n"); + _This->_send_usb_data(EP_02_CMD_IDX); + TRACE0("g_hEP02_Thread return _send_usb_data. EP_02; %x\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP02_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CMv_Proto::g_EP81_Thread(LPVOID pThis) +{ + CMv_Proto* _This = (CMv_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_81_DATA_IDX]._event, INFINITE); + switch (g_hEP81_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_81_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CMv_Proto::g_EP82_Thread(LPVOID pThis) +{ + CMv_Proto* _This = (CMv_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_82_DATA_IDX]._event, INFINITE); + switch (g_hEP82_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_82_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//=========================================================================== +double CMv_Proto::ScaleToMM(long lCount, double dResolution) +{ + double dMM = 0.0; + dMM = lCount * dResolution; + return dMM; +} + +//=========================================================================== +long CMv_Proto::MMtoScale(double lDistanceMM, double dResolution) +{ + long lCounts = 0; + if (dResolution) + lCounts = (long) (lDistanceMM / dResolution); + else + ASSERT(0); + return lCounts; +} + +//=========================================================================== +void CMv_Proto::Trace_EP_Buff(long lIndex) +{ + UCHAR tmp[256]; + CString csTmp; + memcpy(tmp, ep_buff[lIndex]._buffer, ep_buff[lIndex]._size); + csTmp = _T("Trace_EP_Buff _59 "); + for (int ii= 0 ; ii < ep_buff[lIndex]._size ; ++ii) + { + CString csTmpHex; + csTmpHex.Format(_T("%2X"), tmp[ii] ); + csTmp += csTmpHex; + } + TRACE1("_process_MV_CMD_GET_INDEX_4E() Trace_EP_Buff %s \n", csTmp); +} + +//===================================================================================== +long CMv_Proto::_4char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[3]; + c_array[1] = cBuff[2]; + c_array[2] = cBuff[1]; + c_array[3] = cBuff[0]; + return(l_value); +} + +//======================================================================== +void CMv_Proto::_reverse_dword(DWORD *dWord) +{ + BYTE cBuff[4]; + BYTE *dwBuff = (BYTE *)dWord; + for ( int ii = 0 ; ii < 4 ; ++ii ) + cBuff[ii]= dwBuff[ii]; + + dwBuff[0] = cBuff[3]; + dwBuff[1] = cBuff[2]; + dwBuff[2] = cBuff[1]; + dwBuff[3] = cBuff[0]; +} + +//======================================================================== +void CMv_Proto::mv_set_full_ringlight_data(long lIntensity) +{ + if (g_machine.s_machine_config._vector_light_model == 3) + { + for (int ii=0 ; iig_machine.s_machine_config._vector_light_model == 2) + { + for (int ii=0 ; ii>8; + Val = MSB|LSB; +} + +//****************************************************************************** +double CMv_Proto::TimeInSecs(void) +{ + double Secs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPersec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Secs = ((double)HPTicks.QuadPart / HPCounterTicksPersec); + } + else + { + // Use clock with less resolution. + Secs = GetTickCount(); + Secs /= 1000.0; + } + return Secs; +} + +//****************************************************************************** +CMv_Proto::CMv_Proto() +{ + ep_buff[EP_01_CMD_IDX]._ep = EP_01; + ep_buff[EP_81_DATA_IDX]._ep = EP_81; + ep_buff[EP_02_CMD_IDX]._ep = EP_02; + ep_buff[EP_82_DATA_IDX]._ep = EP_82; + + for (int i=0;i 2)) + { + token = strtok( szLine, seps ); // Get the command token + if (!_stricmp(token, "DEBUG")) // Hex Mask + { + token = strtok( NULL, seps); + if (token) + { + g_pLogger->m_lLogMask=atoi(token); // 0 or 1 to indicate ON/Off + } + } + else if (!_stricmp(token, "STR_2B01")) // STR_2B_01 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_2b, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_2b, g_machine.s_machine_config._str_bin_2b, (int) strlen(g_machine.s_machine_config._str_2b)); + } + } + else if (!_stricmp(token, "STR_7000")) // STR_7000 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_7000_signature, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_7000_signature, g_machine.s_machine_config._str_bin_7000, (int) strlen(g_machine.s_machine_config._str_7000_signature)); + } + } + else if (!_stricmp(token, "STR_6f00")) // STR_6f00 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_6f00_signature, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_6f00_signature, g_machine.s_machine_config._str_bin_6f00, (int) strlen(g_machine.s_machine_config._str_6f00_signature)); + } + } + else if (!_stricmp(token, "USB_COMMAND_WAIT")) // Pause between Usb Receive Commands + { + token = strtok( NULL, seps); + if (token) + { + g_machine.s_machine_config._usb_command_wait=atoi(token); // 0 or 1 to indicate ON/Off + } + } + else if (!_stricmp(token, "USB_COMMAND_TIMEOUT")) // How long should we wait before we call it timeout + { + token = strtok( NULL, seps); + if (token) + { + g_machine.s_machine_config._usb_command_timeout=atoi(token); // 0 or 1 to indicate ON/Off + } + } + } + } + fclose(hConfigFile); + } + else + { + return SSI_STATUS_MV_CONFIG_FILE_NOT_FOUND; + }; + + return SSI_STATUS_NORMAL; +}; + +//****************************************************************************** +usb_dev_handle* CMv_Proto::_open_usb_dev(void) +{ + struct usb_bus *bus = NULL; + struct usb_device *dev = NULL; + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == MICROVU_VID && dev->descriptor.idProduct == MICROVU_PID) + { + return usb_open(dev); + } + } + } + return NULL; +} + +//****************************************************************************** +// Send is direct and async. +// The receive thread will receive data and interpret it. +//****************************************************************************** +SSI_STATUS CMv_Proto::Init_MvUsb() +{ + // Set initial state of the machine + g_machine.s_status._machine_running = false; + g_machine.s_status._poll_58_active = false; + g_machine.s_status._poll_59_active = false; + g_machine.s_status._poll_2b_active = false; + + SSI_STATUS Status=SSI_STATUS_NORMAL; + UNREFERENCED_PARAMETER(Status); + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Enter Initialize Mv Usb\n")); + + int usb_status = NULL; + usb_init(); // initialize the library + usb_status = usb_find_busses(); // find all busses + usb_status = usb_find_devices(); // find all connected devices + g_dev = _open_usb_dev(); + if (!g_dev) + { + MessageBox(NULL, _T("Unable to open device"), _T("Message"), MB_OK); + g_pLogger->SendAndFlushPerMode(_T("Unable to open device %s"), usb_strerror()); + return SSI_STATUS_DATALINK_ERROR; + } + + if (usb_set_configuration(g_dev, MY_CONFIG) < 0) + { + MessageBox(NULL, _T("Unable to SET CONFIGURATION"), _T("Message"), MB_OK); + return SSI_STATUS_DATALINK_ERROR; + } + + if (usb_claim_interface(g_dev, 0) < 0) + { + usb_close(g_dev); + MessageBox(NULL, _T("Unable to CLAIM DEVICE"), _T("Message"), MB_OK); + return SSI_STATUS_DATALINK_ERROR; + } + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_01_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP01_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP01_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Thread_State = THREAD_RUNNING; + + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_02_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP02_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP02_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Thread_State = THREAD_RUNNING; + + // ******************************************************************** + // Prepare and start EP_81 Thread - Use async commit. + // + ep_buff[EP_81_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP81_Thread_State = THREAD_PAUSED; + g_hEP81_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP81_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + // ******************************************************************** + // Prepare and start EP_82 Thread - Use async commit. + // + ep_buff[EP_82_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP82_Thread_State = THREAD_PAUSED; + g_hEP82_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP82_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + + // ********************************************************************* + g_hHomedEvent = CreateEvent(NULL, // default security attributes + TRUE, // manual reset event object + FALSE, // initial state is signaled + NULL); // unamed object + + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Initialize Usb\n")); + return SSI_STATUS_NORMAL; +} + +//****************************************************************************** +SSI_STATUS CMv_Proto::Exit_MvUsb() +{ + SSI_STATUS Status=SSI_STATUS_NORMAL; + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Enter Exit_MvUsb\n")); + + g_hEP81_Thread_State = THREAD_EXIT; + g_hEP82_Thread_State = THREAD_EXIT; + g_hEP01_Thread_State = THREAD_EXIT; + g_hEP02_Thread_State = THREAD_EXIT; + + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + if (g_hEP81_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP81_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + if (g_hEP82_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP82_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + if (g_hEP01_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP01_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + if (g_hEP02_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP02_Thread_Id,&dwCode); + Sleep(1); + } + } + + if (g_dev) + { + usb_release_interface(g_dev,0); + usb_close(g_dev); + g_dev = NULL; + } + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + CloseHandle(ep_buff[EP_81_DATA_IDX]._event); + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + CloseHandle(ep_buff[EP_82_DATA_IDX]._event); + g_hEP01_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + CloseHandle(ep_buff[EP_01_CMD_IDX]._event); + g_hEP02_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + CloseHandle(ep_buff[EP_02_CMD_IDX]._event); + ReleaseMutex(g_hEP01_Serial_Mutex); + CloseHandle(g_hEP01_Serial_Mutex); + ReleaseMutex(g_hEP02_Serial_Mutex); + CloseHandle(g_hEP02_Serial_Mutex); + + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Exit_MvUsb\n")); + return Status; +} + +//****************************************************************************** +SSI_STATUS CMv_Proto::ExtractAppPath(CString &Path) +{ + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) + { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } + else + { // not a complete path + Path=""; + }; + return SSI_STATUS_NORMAL; +}; + +//****************************************************************************** +SSI_STATUS CMv_Proto::GetAppPath(CString &Path) +{ + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) + { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return SSI_STATUS_NORMAL; +}; + +//****************************************************************************** +// Replay the capture file. +// There are three special commands: +// 7000 +// 6f00 +// 4c02 +//****************************************************************************** +SSI_STATUS CMv_Proto::_replay_capture(CString s_replay_file) +{ + char *_0x4e00_cmd = "4e00"; + FILE* pInFile; + + _wfopen_s(&pInFile, s_replay_file, _T("r")); + if (pInFile == NULL) + return SSI_STATUS_REPLAY_FILE_ERROR; + + char *cData = (char *)malloc(MAX_BUFF_SIZE); + char *inBuff = (char *)malloc(MAX_BUFF_SIZE); + + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + while (!feof(pInFile)) + { + if (*inBuff == '>') + { + if (strstr(inBuff, "0x00000001")) + { + if (!(_strnicmp(inBuff+35, _0x4e00_cmd, 4))) break; + _process_replay_capture_commands(inBuff, pInFile); + } + }; + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + }; + fclose(pInFile); + free(cData); + free(inBuff); + return SSI_STATUS_NORMAL; +} + +//****************************************************************************** +// Do not send out DCC Home. We can send everything else. +//****************************************************************************** +SSI_STATUS CMv_Proto::_process_replay_capture_commands(char *inBuff, FILE* pInFile) +{ + char x[3]; + char cSize[9]; + int iSendSize; + int iRcvSize; + + if ( ((*(inBuff+35) == '4')) && (*(inBuff+36) == 'f')) + { + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + return SSI_STATUS_NORMAL; + }; + + memset(cSize, 0 , 9); + memcpy(cSize, inBuff+24, 8); + sscanf_s(cSize, "%8x", &iSendSize); // get the length of the transmission + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0, MAX_BUFF_SIZE); + for (int j=0;j 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MV_COMMAND_TIMEOUT; + } + return SSI_STATUS_NORMAL; +} + +//=============================================================================== +// _send_usb_data(iEP) sends data to the corresponding iEP channel. +// iEP = EP_01 / EP_02 EP_01 = 0x01; EP_02 = 0x02; +//=============================================================================== +SSI_STATUS CMv_Proto::_send_usb_data(int iEP_Base) +{ + int _ret; + ep_buff[iEP_Base]._save_send_cmd = ep_buff[iEP_Base]._buffer[0]; + ep_buff[iEP_Base]._save_send_cmd0 = ep_buff[iEP_Base]._buffer[1]; + ep_buff[iEP_Base]._save_send_cmd1 = ep_buff[iEP_Base]._buffer[2]; + + TRACE3("_send_usb_data() iEP : %X - ep_buff[iEP]._save_send_cmd : %X ._buffer[0] : %X\r\n", iEP_Base, ep_buff[EP_01_CMD_IDX]._save_send_cmd, ep_buff[EP_81_DATA_IDX]._buffer[0]); + _ret = usb_bulk_setup_async(g_dev, &(ep_buff[iEP_Base]._async_context), (unsigned char)ep_buff[iEP_Base]._ep); + if (_ret < 0) + { + return SSI_STATUS_SETUP_ASYNC_CONTEXT_ERROR; + } + _ret = usb_submit_async(ep_buff[iEP_Base]._async_context, ep_buff[iEP_Base]._buffer, ep_buff[iEP_Base]._size); + if (_ret < 0) + { + printf("error usb_submit_async_ep_xx:\n%s\n", usb_strerror()); + return SSI_STATUS_SETUP_ASYNC_CONTEXT_ERROR; + } + TRACE1("_submit_async_8x(EP:%X)\r\n", iEP_Base); + // + ep_buff[iEP_Base+1]._save_send_cmd = ep_buff[iEP_Base+1]._buffer[0]; + ep_buff[iEP_Base+1]._save_send_cmd0 = ep_buff[iEP_Base+1]._buffer[1]; + ep_buff[iEP_Base+1]._save_send_cmd1 = ep_buff[iEP_Base+1]._buffer[2]; + // + _submit_async_8x(iEP_Base+1); // Send EP_81/EP_82 + // Get ready to receive on EP_81 or EP_82 + SetEvent(ep_buff[iEP_Base+1]._event); + // Get ready to receive on EP_01 or EP_02 + _ret = usb_reap_async(ep_buff[iEP_Base]._async_context, 10000); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MV_COMMAND_TIMEOUT; + } + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Poll Machine 58 +//======================================================================== +SSI_STATUS CMv_Proto::_poll_machine_58() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + *(ep_buff[EP_01_CMD_IDX]._buffer) = MV_CMD_GET_SCALE_58; + ep_buff[EP_01_CMD_IDX]._size = 0x01; // send 0x01 bytes over + ep_buff[EP_81_DATA_IDX]._size = 0x11; // expects 45 bytes back + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Poll Machine +// submit poll command, update the position readout +//======================================================================== +SSI_STATUS CMv_Proto::_poll_machine_59() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + *(ep_buff[EP_01_CMD_IDX]._buffer) = MV_CMD_GET_POLL_59; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = 0x01; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = 0x01; + ep_buff[EP_01_CMD_IDX]._size = 0x10; // send 0x01 bytes over + ep_buff[EP_81_DATA_IDX]._size = 0x3e; // expects 45 bytes back + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// _poll_machine_2b +//======================================================================== +SSI_STATUS CMv_Proto::_poll_machine_2b() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + *ep_buff[EP_01_CMD_IDX]._buffer = MV_CMD_SERVO_CMD_2B; + ep_buff[EP_01_CMD_IDX]._size = 0x01; // send 0x01 bytes over + ep_buff[EP_81_DATA_IDX]._size = 0x45; // expects 45 bytes back + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_is_supported() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// call from Hsi +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_startup(double dScaleResolutionX, double dScaleResolutionY, double dScaleResolutionZ) +{ + g_machine.s_machine_config.x_axis._scale_resolution = dScaleResolutionX; + g_machine.s_machine_config.y_axis._scale_resolution = dScaleResolutionY; + g_machine.s_machine_config.z_axis._scale_resolution = dScaleResolutionZ; + _start_machine(); + mv_motion_Dcc_Home(); + _replay_capture(_T("Replay_Capture")); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_axis_count(int &iCount) +{ + iCount = 4; + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// This speed setting will be carried out in the next DCC move +// Full Speed -> dPercentSpeed = 100% +// Slow Speed -> dPercentSpeed = 20% +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_set_speed_xyz(double dPercentSpeed) +{ + g_machine.s_machine_config._dXYZSpeed = dPercentSpeed; + return SSI_STATUS_NORMAL; +} + +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_speed_xyz(double &dPercentSpeed) +{ + dPercentSpeed = g_machine.s_machine_config._dXYZSpeed; + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_set_speed_r(long z_speed) +{ + g_machine.z._speed = z_speed; + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_settle_time() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_deadband() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_refresh_deadband() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Just get the values from g_machine. +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_position_xyz(double & dX, double & dY, double & dZ) +{ + long lX=0, lY=0, lZ=0, lZm=0; + + _send_cmd_MV_CMD_GET_POLL_59(lX, lY, lZ, lZm); + + lX -= g_machine.s_machine_config.x_axis._neg_working_limit; + lY -= g_machine.s_machine_config.y_axis._neg_working_limit; + lZ -= g_machine.s_machine_config.z_axis._neg_working_limit; + + dX = ScaleToMM(lX, g_machine.s_machine_config.x_axis._scale_resolution); + dY = ScaleToMM(lY, g_machine.s_machine_config.y_axis._scale_resolution); + dZ = ScaleToMM(lZ, g_machine.s_machine_config.z_axis._scale_resolution); + + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +SSI_STATUS CMv_Proto::_set_position_xyz(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MOVE_TO_53; + pMV_CMD_01->S_MV_CMD_0x53.uSubCmdByte = 0; + + pMV_CMD_01->S_MV_CMD_0x53.statusByte[0] = 1; + pMV_CMD_01->S_MV_CMD_0x53.statusByte[1] = 1; + pMV_CMD_01->S_MV_CMD_0x53.statusByte[2] = 1; + pMV_CMD_01->S_MV_CMD_0x53.statusByte[3] = 0; + + pMV_CMD_01->S_MV_CMD_0x53.S_POS.x = X.to; + pMV_CMD_01->S_MV_CMD_0x53.S_POS.y = Y.to; + pMV_CMD_01->S_MV_CMD_0x53.S_POS.z = Z.to; + pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.x = X.speed; + pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.y = Y.speed; + pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.z = Z.speed; +#pragma message("set accel and decel") + pMV_CMD_01->S_MV_CMD_0x53.S_ACC.x = X.acc; + pMV_CMD_01->S_MV_CMD_0x53.S_ACC.y = Y.acc; + pMV_CMD_01->S_MV_CMD_0x53.S_ACC.z = Z.acc; + pMV_CMD_01->S_MV_CMD_0x53.S_DEC.x = X.dec; + pMV_CMD_01->S_MV_CMD_0x53.S_DEC.y = Y.dec; + pMV_CMD_01->S_MV_CMD_0x53.S_DEC.z = Z.dec; + + // swap the bytes for buffer sent to controller + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_POS.x)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_POS.y)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_POS.z)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.x)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.y)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_SPEED.z)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_ACC.x)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_ACC.y)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_ACC.z)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_DEC.x)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_DEC.y)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x53.S_DEC.z)); + + ep_buff[EP_01_CMD_IDX]._size = 0x60; // send 0x60 bytes over + ep_buff[EP_82_DATA_IDX]._size = 0x2; // expects 2 bytes back + + // look at the start of the buffer + if (0) + { + long lMax = 60; + char * pch = ep_buff[EP_01_CMD_IDX]._buffer; + CString tmp; + for (long ii = 0 ; ii < lMax ; ++ii) + { + tmp.Format(_T("%X"), (unsigned char ) *(pch+ii)); + TRACE1("Set Position %s", tmp); + } + TRACE0("\n"); + } + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + + return SSI_STATUS_NORMAL; +} + +//==================================================================================================================== +// MV uses a proportional max accel and decel for all moves sample 10, 10, 1 move +//> [endpoint 0x00000001] 00000060 : 530001010100ffff2be6fffeea72ffffcd8e000000000003d08f0003ce20000061a100000000000f423b000f387d0001868200000000003d08ee003ce1f500061a07000000000000000000000000000000000000000000000000000000000000 +// [6015605 ms] *Command : 53 Move To -- # X Y Z ZM Scale +// *Pos: -0054298 -0071054 -0012914 00000000 +// *Vel: 00249999 00249376 00024993 00000000 +// *Acc: 00999995 00997501 00099970 00000000 +// *Dec: 03999982 03990005 00399879 00000000 +//==================================================================================================================== +SSI_STATUS CMv_Proto::_calculate_straightline_motion(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z, double dSpeedMM) +{ + + double dTime=0.0; + double dXTime = 0.0, dYTime = 0.0, dZTime = 0.0; + + double lSpeedXMM = ScaleToMM(g_machine.s_machine_config.x_axis._max_speed, g_machine.s_machine_config.x_axis._scale_resolution); + double lSpeedYMM = ScaleToMM(g_machine.s_machine_config.y_axis._max_speed, g_machine.s_machine_config.y_axis._scale_resolution); + double lSpeedZMM = ScaleToMM(g_machine.s_machine_config.z_axis._max_speed, g_machine.s_machine_config.z_axis._scale_resolution); + +#pragma message("Add code to apply the speed") + + if (lSpeedXMM) + dXTime = fabs((double)(X.dToMM-X.dFromMM)/lSpeedXMM); + + if (lSpeedYMM) + dYTime = fabs((double)(Y.dToMM-Y.dFromMM)/lSpeedYMM); + + if (lSpeedZMM) + dZTime = fabs((double)(Z.dToMM-Z.dFromMM)/lSpeedZMM); + + dTime = (dXTime>dYTime)?dXTime:dYTime; + dTime = (dZTime>dTime)?dZTime:dTime; + + double dDistance = sqrt( pow(X.dToMM-X.dFromMM, 2) + pow(Y.dToMM-Y.dFromMM, 2) + pow(Z.dToMM-Z.dFromMM, 2) ); + double dMaxSpeed = dDistance/dTime; + double dSpeedFactor = dSpeedMM / dMaxSpeed; + dSpeedFactor = (dSpeedFactor > 1.0) ? 1.0 : dSpeedFactor; + + double dXFactor = dSpeedFactor * dXTime/dTime; + double dYFactor = dSpeedFactor * dYTime/dTime; + double dZFactor = dSpeedFactor * dZTime/dTime; + + // MV uses a proportional max accel and decel for all moves sample 10, 10, 1 move + //> [endpoint 0x00000001] 00000060 : 530001010100ffff2be6fffeea72ffffcd8e000000000003d08f0003ce20000061a100000000000f423b000f387d0001868200000000003d08ee003ce1f500061a07000000000000000000000000000000000000000000000000000000000000 + // [6015605 ms] *Command : 53 Move To -- # X Y Z ZM Scale + // *Pos: -0054298 -0071054 -0012914 00000000 + // *Vel: 00249999 00249376 00024993 00000000 + // *Acc: 00999995 00997501 00099970 00000000 + // *Dec: 03999982 03990005 00399879 00000000 + + X.speed = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_speed); + X.acc = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_accel); + X.dec = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_decel); + + Y.speed = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_speed); + Y.acc = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_accel); + Y.dec = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_decel); + + Z.speed = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_speed); + Z.acc = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_accel); + Z.dec = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_decel); + + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// To do a move. +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait) +{ + _poll_machine_58(); + _poll_machine_59(); + + // get the current position + double dXStart, dYStart, dZStart; + mv_motion_get_position_xyz(dXStart, dYStart, dZStart); + + AXISMOVE X; + AXISMOVE Y; + AXISMOVE Z; + + X.dFromMM = dXStart; + X.dToMM = dX; + Y.dFromMM = dYStart; + Y.dToMM = dY; + Z.dFromMM = dZStart; + Z.dToMM = dZ; + + X.from = MMtoScale(dXStart, g_machine.s_machine_config.x_axis._scale_resolution); + X.to = MMtoScale(dX, g_machine.s_machine_config.x_axis._scale_resolution); + Y.from = MMtoScale(dYStart, g_machine.s_machine_config.y_axis._scale_resolution); + Y.to = MMtoScale(dY, g_machine.s_machine_config.y_axis._scale_resolution); + Z.from = MMtoScale(dZStart, g_machine.s_machine_config.z_axis._scale_resolution); + Z.to = MMtoScale(dZ, g_machine.s_machine_config.z_axis._scale_resolution); + + // move the position to make the -X, -Y, -Z position 0,0,0 + X.to += g_machine.s_machine_config.x_axis._neg_working_limit; + Y.to += g_machine.s_machine_config.y_axis._neg_working_limit; + Z.to += g_machine.s_machine_config.z_axis._neg_working_limit; + + X.from += g_machine.s_machine_config.x_axis._neg_working_limit; + Y.from += g_machine.s_machine_config.y_axis._neg_working_limit; + Z.from += g_machine.s_machine_config.z_axis._neg_working_limit; + + _calculate_straightline_motion(X, Y, Z, g_machine.s_machine_config._dXYZSpeed); + _set_position_xyz(X, Y, Z); + +#pragma message("Test settle wait comparing the status bit to the scale monitor") + + if (bWait) + { + const long lSleep = 20; + const long lMaxLoopCnt = 20000/lSleep; // use max homing time of 20 seconds + long lLoopCnt = 0; + Sleep(lSleep); + _poll_machine_58(); + _poll_machine_59(); + while (!g_machine.s_status._bXYZZMIdle && lLoopCnt < lMaxLoopCnt) + { + _poll_machine_58(); + _poll_machine_59(); + Sleep(lSleep); + ++lLoopCnt; + } + TRACE1("Presettle Time: %lf\n", TimeInSecs()); + WaitForSettleXYZZM(); + TRACE1("Postsettle Time: %lf\n", TimeInSecs()); + } + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// 43 10 +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_position_r(double &dPositionR) +{ + dPositionR = g_machine.r1._deg; + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_set_position_r(double dPositionR) +{ + _send_cmd_MV_CMD_GET_X_INDEX_41(0x10); // 41 10 + _send_cmd_MV_CMD_GET_Y_INDEX_42(0x10); // 42 10 + _send_cmd_PRE_ROTARY(); + _send_cmd_MV_CMD_GET_MAG_43(0x10); // 43 10 + // Converts dPositionR to scale count. + long lCount = (long) (g_machine.s_machine_config.r1_axis._scale_resolution*dPositionR); + _send_cmd_MV_CMD_MOVE_AXIS_4C10(lCount); + Sleep(200); +// while ( g_machine.s_status._bRMoving) // wait for move to complete +// { +// Sleep(50); +// }; + // once complete, we can update the true position. + g_machine.r1._deg = dPositionR; + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// todo: +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_store_position_xyz() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// todo: +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_stored_positions_xyz() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// todo: Check 0x59 commands. +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_is_axis_moving() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// home position is the position of the magnetic mark calculated +// from the power off position. +// When the machine is powered off, it has a position. +//======================================================================== +bool CMv_Proto::mv_motion_is_homed() +{ + return(g_machine.s_machine_config.x_axis._pos_working_limit == 0 && g_machine.s_machine_config.x_axis._neg_working_limit == 0)?false:true; +} + +//======================================================================== +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_set_stage_limits() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Stage Limit is .5" from the edge. so, it is +// Positive Limit = homing mark + (150 - (.5"25.4)) +// Negative Limit = homing mark - (150 - (.5"25.4)) +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_stage_limits() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Do not implement. +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_dcc_scan_start() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Do not implement. +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_dcc_scan_get_data_size() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_dcc_scan_get_data() +{ + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Move the stage left/right until the index location is non-zero +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_Dcc_Home() +{ + _get_config(); + //======================================== + // Get the current position + _poll_machine_59(); + _send_cmd_MV_CMD_GET_MAG_43(0x03); + //======================================== + // Read the index status from the controller + // if the returned 5E working_limit == 0, we need to home the machine + _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + _get_xyz_index(); + _send_cmd_MV_CMD_GET_CONFIG_69(0x01); + + if (!(g_machine.s_machine_config.x_axis._pos_working_limit == 0 && g_machine.s_machine_config.x_axis._neg_working_limit == 0 )) + { + SetEvent(g_hHomedEvent); + return SSI_STATUS_NORMAL; + } + + m_bHomingActive = true; // Tell the world we need to home the stage + + // Seek Zm - Index Position + _send_cmd_MV_CMD_SEEK_INDEX_4F(0x03, 0x00); + // Don't know what this is + _send_cmd_MV_CMD_GET_CONFIG_69(0x01); + // Seek Z - Index Position + _send_cmd_MV_CMD_SEEK_INDEX_4F(0x02, 0x00); + Sleep(20); + _poll_machine_59(); + _poll_machine_58(); + + TRACE0(" - waiting for Z to stop moving\n"); + //======================================== + // Wait until Z stopped moving + while (g_machine.s_status._bZMoving) + { + Sleep(50); + _poll_machine_59(); + } + + //===================================== + // get stage working limits + // move the Z to the top to clear the working area. + _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + _send_cmd_MV_CMD_MOVE_AXIS_4C(0x02, g_machine.s_machine_config.z_axis._pos_working_limit, 1); + _poll_machine_59(); + + //===================================== + // Seek X- Index Positions + _send_cmd_MV_CMD_SEEK_INDEX_4F(0x00, 0x00); + // Seek Y- Index Positions + _send_cmd_MV_CMD_SEEK_INDEX_4F(0x01, 0x00); + _poll_machine_59(); + _poll_machine_58(); + + TRACE0(" - waiting for X,Y,Zm to stop moving\n"); + //======================================== + // Wait until X-Y-Zm stopped moving + while (g_machine.s_status._bYMoving || g_machine.s_status._bXMoving || g_machine.s_status._bZMMoving) + { + Sleep(50); + _poll_machine_59(); + } + + //======================================== + // 5e Get stage working limits after homing + _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + // 5e Get state working limits to update to the real limits data + _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + _get_xyz_index(); + m_bHomingActive = false; + SetEvent(g_hHomedEvent); + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_shut_down() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_fly_mode_cancel() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// From g_machine +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_axes_max_speed(double &dMaxSpeedX, double &dMaxSpeedY, double &dMaxSpeedZ) +{ + dMaxSpeedX = g_machine.s_machine_config.x_axis._max_speed; + dMaxSpeedY = g_machine.s_machine_config.y_axis._max_speed; + dMaxSpeedZ = g_machine.s_machine_config.z_axis._max_speed; + + return SSI_STATUS_NORMAL; +} + +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_3D_max_speed(double &dMaxSpeed) +{ + double dMaxSpeedX = g_machine.s_machine_config.x_axis._max_speed; + double dMaxSpeedY = g_machine.s_machine_config.y_axis._max_speed; + double dMaxSpeedZ = g_machine.s_machine_config.z_axis._max_speed; + + dMaxSpeed = sqrt(dMaxSpeedX*dMaxSpeedX + dMaxSpeedY*dMaxSpeedY + dMaxSpeedZ*dMaxSpeedZ); + + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_motion_get_position_meas_point() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_is_supported() +{ + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_start_up() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// 11 steps +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_magnification_steps(int &iSteps) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + iSteps = 11; + TRACE1("Optics Get Mag Steps: %X \r\n",iSteps); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_numeric_aperture() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_magnification(int& iStep) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + iStep = g_machine.s_machine_config.zm_axis._mag_step; + TRACE1("Optics Get Mag : %X \r\n",g_machine.s_machine_config.zm_axis._mag_step); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +/* + *Command : 4C 03 00 Set Mag 00002633 00009484 00024487 00097948 + *Command : 4C 03 01 Set Mag -0000287 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00000013 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00005253 00009484 00024487 00097948 + *Command : 4C 03 01 Set Mag -0000287 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00000013 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00007873 00009484 00024487 00097948 +*/ +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_set_magnification(int iStep) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + g_machine.s_machine_config.zm_axis._mag_step = iStep; + TRACE1("Optics Set Mag : %X \r\n",g_machine.s_machine_config.zm_axis._mag_step); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_deadband() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + neg_scale_range = g_machine.s_machine_config.zm_axis._neg_working_limit; + pos_scale_range = g_machine.s_machine_config.zm_axis._pos_working_limit; + + neg_scale_range -= g_machine.s_machine_config.zm_axis._neg_working_limit; + pos_scale_range -= g_machine.s_machine_config.zm_axis._neg_working_limit; + + TRACE2("Get Scale Range : %X, %X \r\n",neg_scale_range, pos_scale_range); + TRACE2("Get Scale Range : %X, %X \r\n",neg_scale_range, pos_scale_range); + + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_get_scale_position(long &lScale) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + _poll_machine_59(); + lScale = g_machine.zm._pos_59; + lScale -= g_machine.s_machine_config.zm_axis._neg_working_limit; + TRACE1("get scale position : g_machine.s_machine_config.zm_axis._neg_working_limit = %X \r\n",g_machine.s_machine_config.zm_axis._neg_working_limit); + TRACE1(" scale position : %X \r\n",lScale); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// get scale first. +// if the target is backwards, +// set destination with 01 status +// set destination with 00 status +// +//======================================================================== +SSI_STATUS CMv_Proto::mv_optics_set_scale_position(long lScale) +{ +// const long lSleep = 20; +// const long lMaxLoopCnt = 20000/lSleep; // use max homing time of 20 seconds +// long lLoopCnt = 0; + + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + TRACE1("caller set scale position = %X \r\n", lScale); + lScale += g_machine.s_machine_config.zm_axis._neg_working_limit; + _poll_machine_59(); + + long lBacklashMove = g_machine.s_machine_config.zm_axis._slack; + long lLast = g_machine.zm._pos_59; + + // if a negative move, overshoot and come back for backlash removal + if (lScale < g_machine.zm._pos_59) + { + long lDestination = lScale - lBacklashMove; + lDestination = (lDestinationg_machine.s_machine_config.zm_axis._pos_working_limit) ? g_machine.s_machine_config.zm_axis._pos_working_limit : lDestination; + lDestination = (lDestinationg_machine.s_machine_config._vector_light_model == 2) + { + g_machine.s_lights_200._axial_light = (long)(dTopPercent/100.0 * (mvMAXLIGHTVALUE - 1)); + g_machine.s_lights_200._bottom_light = (long)(dBottomPercent/100.0 * (mvMAXLIGHTVALUE - 1)); + TRACE2("mv_light_set_lamp_state bottom: %ld top: %ld\n", + g_machine.s_lights_300._bottom_light, g_machine.s_lights_200._axial_light); + }; + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// Do nothing +//======================================================================== +SSI_STATUS CMv_Proto::mv_light_set_light_off() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + if (g_machine.s_machine_config._vector_light_model == 3) + { + g_machine.s_lights_300._axial_light = 0; + g_machine.s_lights_300._bottom_light = 0; + } + else +// if (g_machine.s_machine_config._vector_light_model == 2) + { + g_machine.s_lights_200._axial_light = 0; + g_machine.s_lights_200._bottom_light = 0; + } + mv_set_full_ringlight_data(0); + mv_light_set_light(); + return SSI_STATUS_NORMAL; +} + +//======================================================================== +//======================================================================== +SSI_STATUS CMv_Proto::mv_light_set_light() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + _send_cmd_MV_CMD_SET_LIGHT_6E(); + return SSI_STATUS_NORMAL; +} + +//======================================================================== +//======================================================================== +SSI_STATUS CMv_Proto::mv_pendant_enable(BOOL bTrue) +{ + UNREFERENCED_PARAMETER(bTrue); + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + _send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(bTrue); + return SSI_STATUS_NORMAL; +}; + +//======================================================================== +// read the configuration from the controller and populate the g_machine +// data structure +// 1. Extract machine signature : 6f00 +// 2. Get Limits +//======================================================================== +SSI_STATUS CMv_Proto::_get_config() +{ + _send_cmd_MV_CMD_START_MACHINE_2C(0x01); + // 50 Get Max Speed - axis set one + _send_cmd_MV_CMD_MAX_SPEED_50(0x00, 0x01, 0x11); + // 51 Get Max Acceleration - axis set one + _send_cmd_MV_CMD_MAX_ACCEL_51(0x00, 0x01, 0x11); + // 76 Get Max Deceleration - axis set one + _send_cmd_MV_CMD_MAX_DECEL_76(0x00, 1, 0x11); + // 5001 Get Max Speed - axis set two + _send_cmd_MV_CMD_MAX_SPEED_50(0x01, 0x02, 0x11); + // 5101 Get Max Acceleration - axis set two + _send_cmd_MV_CMD_MAX_ACCEL_51(0x01, 0x02, 0x11); + // 7601 Get Max Deceleration - axis set two + _send_cmd_MV_CMD_MAX_DECEL_76(0x01, 0x02, 0x11); + // 4103 + _send_cmd_MV_CMD_GET_X_INDEX_41(0x03); + // 4203 + _send_cmd_MV_CMD_GET_Y_INDEX_42(0x03); + // 4503 + _send_cmd_MV_CMD_GET_ZOOM_DECEL_45(0x03); + _send_cmd_MV_CMD_GET_SCALE_SLACK_7C(0x03); + // 4303 - Get Mag Settings + _send_cmd_MV_CMD_GET_MAG_43(0x03); + _send_cmd_MV_CMD_GET_CONFIG_60(); + // 5e Get state working limits + _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + return SSI_STATUS_NORMAL; +} + +//======================================================================== +// read the configuration from the controller and populate the g_machine +// data structure +//======================================================================== +SSI_STATUS CMv_Proto::_get_xyz_index() +{ + _send_cmd_MV_CMD_GET_INDEX_4E(0x00, 0x02, 0x07); // Get X - Index + _send_cmd_MV_CMD_GET_INDEX_4E(0x01, 0x02, 0x07); // Get Y - Index + _send_cmd_MV_CMD_GET_INDEX_4E(0x02, 0x02, 0x07); // Get Z - Index + return SSI_STATUS_NORMAL; +} + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_POS_XYZ_00_02() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_POS_XYZ_00_02; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SET_POS_XYZ_00_03() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SET_POS_XYZ_00_03; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_POS_R_00_04() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_POS_R_00_04; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SET_POS_R_00_05() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SET_POS_R_00_05; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SET_ZOOM_00_06() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SET_ZOOM_00_06; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_ZOOM_00_07() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_ZOOM_00_07; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_STARUP_CONFIG_00() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_STARUP_CONFIG_00; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_SUB_CONFIG_28() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_SUB_CONFIG_28; + ep_buff[EP_01_CMD_IDX]._size = 0x20; + ep_buff[EP_81_DATA_IDX]._size = 0x12; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//====================================================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_SUB_CONFIG_29(BYTE cmd0, DWORD addr, BYTE cmd1) +{ + unsigned char x[4]; + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + x[0] = *(((unsigned char *)&addr + 3)); + x[1] = *(((unsigned char *)&addr + 2)); + x[2] = *(((unsigned char *)&addr + 1)); + x[3] = *(((unsigned char *)&addr)); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_SUB_CONFIG_29; + pMV_CMD_01->S_MV_CMD_0x29.cmd0 = cmd0; + // take the DWORD addr, create an array of bytes to force a little endian format. + memcpy((void *)(&pMV_CMD_01->S_MV_CMD_0x29.dAddr), x, 4); + pMV_CMD_01->S_MV_CMD_0x29.cmd1 = cmd1; + switch (cmd0) + { + case 0x00: + case 0x02: + ep_buff[EP_01_CMD_IDX]._size = 0x20; + ep_buff[EP_81_DATA_IDX]._size = 0x60; + break; + default: + ep_buff[EP_01_CMD_IDX]._size = 0x20; + ep_buff[EP_81_DATA_IDX]._size = 0x60; + break; + }; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SERVO_CMD_2B() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SERVO_CMD_2B; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +} + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_START_MACHINE_2C(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_START_MACHINE_2C; + ep_buff[EP_01_CMD_IDX]._buffer[1] = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x10; + ep_buff[EP_81_DATA_IDX]._size = 0x20; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_31() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_31; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x20; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_32() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_32; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_34() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_34; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_35() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_35; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_3C() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_3C; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_X_INDEX_41(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_X_INDEX_41; + pMV_CMD_01->S_MV_CMD_0x41.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x02; + ep_buff[EP_81_DATA_IDX]._size = 0x06; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_Y_INDEX_42(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_Y_INDEX_42; + pMV_CMD_01->S_MV_CMD_0x42.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x02; + ep_buff[EP_81_DATA_IDX]._size = 0x06; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_MAG_43(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_MAG_43; + pMV_CMD_01->S_MV_CMD_0x43.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x02; + ep_buff[EP_81_DATA_IDX]._size = 0x06; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_ZOOM_DECEL_45(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_ZOOM_DECEL_45; + pMV_CMD_01->S_MV_CMD_0x45.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x02; + ep_buff[EP_81_DATA_IDX]._size = 0x06; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(BOOL bEnable) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SET_JOYSTICK_MODE_47; + ep_buff[EP_01_CMD_IDX]._size = 0x10; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + if (!bEnable) + { + ep_buff[EP_01_CMD_IDX]._buffer[1] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[2] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[3] = 0x01; + ep_buff[EP_01_CMD_IDX]._buffer[4] = 0x01; + }; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MOVE_AXIS_4C10(long lCount) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MOVE_AXIS_4C; + pMV_CMD_01->S_MV_CMD_0x4C10.uAxis = 0x10; + pMV_CMD_01->S_MV_CMD_0x4C10.lR1_Pos = lCount; + pMV_CMD_01->S_MV_CMD_0x4C10.lX = g_machine.s_machine_config.x_axis._index_10; + pMV_CMD_01->S_MV_CMD_0x4C10.lY = g_machine.s_machine_config.y_axis._index_10; + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C10.lR1_Pos)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C10.lX)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C10.lY)); + ep_buff[EP_01_CMD_IDX]._size = 0x1f; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MOVE_AXIS_4C(BYTE Axis, long lDestination, BYTE lStatusByte) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MOVE_AXIS_4C; + + pMV_CMD_01->S_MV_CMD_0x4C.uAxis = Axis; +#pragma message("what exactly does the message byte do") + pMV_CMD_01->S_MV_CMD_0x4C.statusByte = lStatusByte; + pMV_CMD_01->S_MV_CMD_0x4C.lPosition = lDestination; + switch (Axis) + { + case 0: + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed = g_machine.s_machine_config.x_axis._max_speed; + pMV_CMD_01->S_MV_CMD_0x4C.lAcc = g_machine.s_machine_config.x_axis._max_accel; + pMV_CMD_01->S_MV_CMD_0x4C.lDecel = g_machine.s_machine_config.x_axis._max_decel; + break; + case 1: + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed = g_machine.s_machine_config.y_axis._max_speed; + pMV_CMD_01->S_MV_CMD_0x4C.lAcc = g_machine.s_machine_config.y_axis._max_accel; + pMV_CMD_01->S_MV_CMD_0x4C.lDecel = g_machine.s_machine_config.y_axis._max_decel; + break; + case 2: + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed = g_machine.s_machine_config.z_axis._max_speed; + pMV_CMD_01->S_MV_CMD_0x4C.lAcc = g_machine.s_machine_config.z_axis._max_accel; + pMV_CMD_01->S_MV_CMD_0x4C.lDecel = g_machine.s_machine_config.z_axis._max_decel; + break; + case 3: + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed = g_machine.s_machine_config.zm_axis._max_speed; + pMV_CMD_01->S_MV_CMD_0x4C.lAcc = g_machine.s_machine_config.zm_axis._max_accel; + pMV_CMD_01->S_MV_CMD_0x4C.lDecel = g_machine.s_machine_config.zm_axis._max_decel; + break; + default: + break; + } + + CString msg; + msg.Format(_T("_send_cmd_MV_CMD_MOVE_AXIS_4C Zoom move %ld %ld %ld %ld\n"), + pMV_CMD_01->S_MV_CMD_0x4C.lPosition, + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed, + pMV_CMD_01->S_MV_CMD_0x4C.lAcc, + pMV_CMD_01->S_MV_CMD_0x4C.lDecel); + TRACE1("%s", msg); + + if (0) + { + long lPos = 500; + pMV_CMD_01->S_MV_CMD_0x4C.lPosition = lPos; + pMV_CMD_01->S_MV_CMD_0x4C.lSpeed = 9000; + pMV_CMD_01->S_MV_CMD_0x4C.lAcc = 24000; + pMV_CMD_01->S_MV_CMD_0x4C.lDecel = 97000; + } + + // swap the bytes for buffer sent to controller + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C.lPosition)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C.lSpeed)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C.lAcc)); + _reverse_dword((DWORD *)&(pMV_CMD_01->S_MV_CMD_0x4C.lDecel)); + + ep_buff[EP_01_CMD_IDX]._size = 0x21; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_INDEX_4E(BYTE cmd0, BYTE send_len, BYTE recv_len) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_INDEX_4E; + pMV_CMD_01->S_MV_CMD_0x4E.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = send_len; + ep_buff[EP_81_DATA_IDX]._size = recv_len; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//====================================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SEEK_INDEX_4F(BYTE cmd0, BYTE cmd1) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_SEEK_INDEX_4F; + pMV_CMD_01->S_MV_CMD_0x4F.cmd0 = cmd0; + pMV_CMD_01->S_MV_CMD_0x4F.cmd1 = cmd1; + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MAX_SPEED_50(BYTE cmd0, BYTE send_len, BYTE recv_len) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MAX_SPEED_50; + ep_buff[EP_01_CMD_IDX]._buffer[1] = cmd0; + ep_buff[EP_01_CMD_IDX]._size = send_len; + ep_buff[EP_81_DATA_IDX]._size = recv_len; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MAX_ACCEL_51(BYTE cmd0, BYTE send_len, BYTE recv_len) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MAX_ACCEL_51; + pMV_CMD_01->S_MV_CMD_0x50.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = send_len; + ep_buff[EP_81_DATA_IDX]._size = recv_len; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MOVE_TO_53() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MOVE_TO_53; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_SCALE_58(long &lX, long &lY, long &lZ) +{ + _poll_machine_58(); + lX = g_machine.x._pos_58; + lY = g_machine.y._pos_58; + lZ = g_machine.z._pos_58; + return SSI_STATUS_NORMAL; +}; + +//======================================================================= +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_POLL_59(long &lX, long &lY, long &lZ, long &lZM) +{ + _poll_machine_59(); + lX = g_machine.x._pos_59; + lY = g_machine.y._pos_59; + lZ = g_machine.z._pos_59; + lZM = g_machine.zm._pos_59; + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_WORKING_LIMITS_5E() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_WORKING_LIMITS_5E; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x78; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_CONFIG_60() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_CONFIG_60; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x7e; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_RAW_SCALE_63() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_RAW_SCALE_63; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_CONFIG_69(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_CONFIG_69; + pMV_CMD_01->S_MV_CMD_0x69.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x10; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_6A() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_6A; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_SET_LIGHT_6E() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + if (g_machine.s_machine_config._vector_light_model == 3) + { + // moved here form mv_light_set_light where it clearly does not belong as it is outside the USB mutex + pMV_CMD_01->uCmdByte = MV_CMD_SET_LIGHT_6E; + pMV_CMD_01->S_MV_CMD_300_0x6e.uSubCmdByte = 0; + memcpy(pMV_CMD_01->S_MV_CMD_300_0x6e.segment, g_machine.s_lights_300._segment, sizeof(g_machine.s_lights_300._segment[FIVE_RINGS][EIGHT_SEGS])); + pMV_CMD_01->S_MV_CMD_300_0x6e.bottom_light = g_machine.s_lights_300._bottom_light; + pMV_CMD_01->S_MV_CMD_300_0x6e.axial_light = g_machine.s_lights_300._axial_light; + + memcpy(ep_buff[EP_01_CMD_IDX]._buffer+2, &(g_machine.s_lights_300), 0xfe); + unsigned char x[4]; + for (int i=0;i<42;i++) // MAXSEGS_5*MAXRINGS_8 + 2 = 5*8 + 2 + { + memcpy(x, (unsigned char *)(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4), 4); + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+0) = x[3]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+1) = x[2]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+2) = x[1]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+3) = x[0]; + }; + } + else +// if (g_machine.s_machine_config._vector_light_model == 3) + { + pMV_CMD_01->uCmdByte = MV_CMD_SET_LIGHT_6E; + pMV_CMD_01->S_MV_CMD_200_0x6e.uSubCmdByte = 0; + memcpy(pMV_CMD_01->S_MV_CMD_200_0x6e.segment, g_machine.s_lights_200._segment, sizeof(g_machine.s_lights_200._segment[FIVE_RINGS][EIGHT_SEGS])); + pMV_CMD_01->S_MV_CMD_200_0x6e.bottom_light = g_machine.s_lights_200._bottom_light; + pMV_CMD_01->S_MV_CMD_200_0x6e.axial_light = g_machine.s_lights_200._axial_light; + + memcpy(ep_buff[EP_01_CMD_IDX]._buffer+2, &(g_machine.s_lights_200), 0xfe); + unsigned char x[4]; + for (int i=0;i<18;i++) // MAXSEGS_2*MAXRINGS_8 + 2 = 5*8 + 2 = 2*8 + 2 + { + memcpy(x, (unsigned char *)(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4), 4); + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+0) = x[3]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+1) = x[2]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+2) = x[1]; + *(ep_buff[EP_01_CMD_IDX]._buffer+2+i*4+3) = x[0]; + }; + }; + pMV_CMD_01->uCmdByte = MV_CMD_SET_LIGHT_6E; + ep_buff[EP_01_CMD_IDX]._size = 0xfe; + ep_buff[EP_81_DATA_IDX]._size = 0x02; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + Sleep(10); + + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_MACHINE_SIGNATURE_6F(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_MACHINE_SIGNATURE_6F; + pMV_CMD_01->S_MV_CMD_0x6F.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x10; + ep_buff[EP_81_DATA_IDX]._size = 0xfe; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_LIGHT_CONFIG_70() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + unsigned char unk1[] = {0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0xe4, 0xfb, 0x12, 0x00, 0x12, 0x00, 0x00, 0x00}; + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_LIGHT_CONFIG_70; + memcpy((void *)(&(ep_buff[EP_01_CMD_IDX]._buffer[1])), unk1, 15); + ep_buff[EP_01_CMD_IDX]._size = 0x10; + ep_buff[EP_81_DATA_IDX]._size = 0xfe; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_71() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_71; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_74() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_74; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_UNK_75() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_UNK_75; + ep_buff[EP_01_CMD_IDX]._size = 0x01; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_MAX_DECEL_76(BYTE cmd0, BYTE send_len, BYTE recv_len) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_MAX_DECEL_76; + pMV_CMD_01->S_MV_CMD_0x76.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = send_len; + ep_buff[EP_81_DATA_IDX]._size = recv_len; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_SCALE_SLACK_7C(BYTE cmd0) +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + pMV_CMD_01->uCmdByte = MV_CMD_GET_SCALE_SLACK_7C; + pMV_CMD_01->S_MV_CMD_0x7C.cmd0 = cmd0; + ep_buff[EP_01_CMD_IDX]._size = 0x02; + ep_buff[EP_81_DATA_IDX]._size = 0x04; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_MV_CMD_GET_FINE_SCALE(long &lX, long &lY, long &lZ, long &lZm) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + ep_buff[EP_02_CMD_IDX]._buffer[0] = 0x00; + ep_buff[EP_02_CMD_IDX]._buffer[1] = 0x01; + ep_buff[EP_02_CMD_IDX]._buffer[2] = 0x01; + ep_buff[EP_02_CMD_IDX]._buffer[3] = 0x01; + ep_buff[EP_02_CMD_IDX]._buffer[4] = 0x01; + ep_buff[EP_02_CMD_IDX]._buffer[5] = 0x01; + ep_buff[EP_02_CMD_IDX]._size = 0x06; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + lX = g_machine.x._scale_pos; + lY = g_machine.y._scale_pos; + lZ = g_machine.z._scale_pos; + lZm = g_machine.zm._scale_pos; + return SSI_STATUS_NORMAL; +}; + +//============================================================= +// Send 0x6 bytes to the device +// 00 01 01 01 01 01 +// Get 0x10 bytes from the device +// FF FF FF FF FF FF FF FD 00 00 06 0E FF FF FE 6B +// This is actually getting index value. +// Probably not useful. +//============================================================== +SSI_STATUS CMv_Proto::_send_cmd_PRE_ROTARY() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + ep_buff[EP_02_CMD_IDX]._buffer[0] = 0; + ep_buff[EP_02_CMD_IDX]._buffer[1] = 1; + ep_buff[EP_02_CMD_IDX]._buffer[2] = 1; + ep_buff[EP_02_CMD_IDX]._buffer[3] = 1; + ep_buff[EP_02_CMD_IDX]._buffer[4] = 1; + ep_buff[EP_02_CMD_IDX]._buffer[5] = 1; + ep_buff[EP_02_CMD_IDX]._size = 0x6; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_SUB_CONFIG_28() +{ + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_SERVO_CMD_2B() +{ + memcpy((char *)g_machine.s_machine_config._str_servo_Id, ep_buff[EP_81_DATA_IDX]._buffer+1, 32); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_2C() +{ + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_X_INDEX_41() +{ + if (*(ep_buff[EP_81_DATA_IDX]._buffer+1) == 0x03) + { + g_machine.s_machine_config.x_axis._index_03 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_X_INDEX_41()_index_03 : %ld\n", g_machine.s_machine_config.x_axis._index_03); + } + else + if (*(ep_buff[EP_81_DATA_IDX]._buffer+1) == 0x10) + { + g_machine.s_machine_config.x_axis._index_10 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_X_INDEX_41()_index_10 : %ld\n", g_machine.s_machine_config.x_axis._index_10); + }; + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_Y_INDEX_42() +{ + if (*(ep_buff[EP_81_DATA_IDX]._buffer+1) == 0x03) + { + g_machine.s_machine_config.y_axis._index_03 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_Y_INDEX_42()_index_03 : %ld\n", g_machine.s_machine_config.y_axis._index_03); + } + else + if (*(ep_buff[EP_81_DATA_IDX]._buffer+1) == 0x10) + { + g_machine.s_machine_config.y_axis._index_10 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_Y_INDEX_42()_index_10 : %ld\n", g_machine.s_machine_config.y_axis._index_10); + }; + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_MAG_43() +{ + if (*(ep_buff[EP_81_DATA_IDX]._buffer+2) == 0x03) + { + g_machine.s_machine_config.zm_axis._index_03 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_MAG_43() : %ld\n", g_machine.s_machine_config.zm_axis._index_03); + } + else + if (*(ep_buff[EP_81_DATA_IDX]._buffer+2) == 0x10) + { + g_machine.s_machine_config.zm_axis._index_10 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_MAG_43() : %ld\n", g_machine.s_machine_config.zm_axis._index_10); + }; + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_ZOOM_DECEL_45() +{ + g_machine.s_machine_config.zm_axis._index_03 = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+2)); + TRACE1("_process_MV_CMD_GET_ZOOM_DECEL_45() : %ld\n", g_machine.s_machine_config.zm_axis._index_03); + return SSI_STATUS_NORMAL; +} + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_INDEX_4E() +{ + long lIdx = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+3)); + switch (*(ep_buff[EP_01_CMD_IDX]._buffer+1)) + { + case 0 : // X-Index + g_machine.s_machine_config.x_axis._index_03 = lIdx; + break; + case 1 : // Y-Index + g_machine.s_machine_config.y_axis._index_03 = lIdx; + break; + case 2 : // Z - Index + g_machine.s_machine_config.z_axis._index_03 = lIdx; + break; + default: + return SSI_STATUS_DATALINK_ERROR; + }; + + return SSI_STATUS_NORMAL; +} +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_MAX_SPEED_50() +{ + g_machine.s_machine_config.x_axis._max_speed = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+1)); + g_machine.s_machine_config.y_axis._max_speed = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+5)); + g_machine.s_machine_config.z_axis._max_speed = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+9)); + g_machine.s_machine_config.zm_axis._max_speed = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+13)); + TRACE3("_process_MV_CMD_MAX_SPEED_50() x,y,z: %ld %ld %ld\n", g_machine.s_machine_config.x_axis._max_speed, + g_machine.s_machine_config.y_axis._max_speed, + g_machine.s_machine_config.z_axis._max_speed); + TRACE1("_process_MV_CMD_MAX_SPEED_50() Zm : %ld\n", g_machine.s_machine_config.zm_axis._max_speed); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_MAX_ACCEL_51() +{ + g_machine.s_machine_config.x_axis._max_accel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+1)); + g_machine.s_machine_config.y_axis._max_accel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+5)); + g_machine.s_machine_config.z_axis._max_accel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+9)); + g_machine.s_machine_config.zm_axis._max_accel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+13)); + TRACE3("_process_MV_CMD_MAX_ACCEL_51() x,y,z: %ld %ld %ld\n", g_machine.s_machine_config.x_axis._max_accel, + g_machine.s_machine_config.y_axis._max_accel, + g_machine.s_machine_config.z_axis._max_accel); + TRACE1("_process_MV_CMD_MAX_ACCEL_51() Zm : %ld\n", g_machine.s_machine_config.zm_axis._max_accel); + return SSI_STATUS_NORMAL; +}; +//============================================================== +// +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_UNK_56() +{ + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_SCALE_58() +{ + memcpy(&(g_machine.x._pos_58), ep_buff[EP_81_DATA_IDX]._buffer+1, 4); + _reverse_dword((DWORD *)&(g_machine.x._pos_58)); + memcpy(&(g_machine.y._pos_58), ep_buff[EP_81_DATA_IDX]._buffer+1+4, 4); + _reverse_dword((DWORD *)&(g_machine.y._pos_58)); + memcpy(&(g_machine.z._pos_58), ep_buff[EP_81_DATA_IDX]._buffer+1+4*2, 4); + _reverse_dword((DWORD *)&(g_machine.z._pos_58)); + memcpy(&(g_machine.zm._pos_58), ep_buff[EP_81_DATA_IDX]._buffer+1+4*3, 4); + _reverse_dword((DWORD *)&(g_machine.zm._pos_58)); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_POLL_59() +{ + CString Tmp; + ASSERT(ep_buff[EP_81_DATA_IDX]._buffer[0]); + memcpy(&(g_machine.x._pos_59), ep_buff[EP_81_DATA_IDX]._buffer+1+45, 4); + _reverse_dword((DWORD *)&(g_machine.x._pos_59)); + memcpy(&(g_machine.y._pos_59), ep_buff[EP_81_DATA_IDX]._buffer+1+49, 4); + _reverse_dword((DWORD *)&(g_machine.y._pos_59)); + memcpy(&(g_machine.z._pos_59), ep_buff[EP_81_DATA_IDX]._buffer+1+53, 4); + _reverse_dword((DWORD *)&(g_machine.z._pos_59)); + memcpy(&(g_machine.zm._pos_59), ep_buff[EP_81_DATA_IDX]._buffer+1+57, 4); + _reverse_dword((DWORD *)&(g_machine.zm._pos_59)); + + long lXIdle = *(ep_buff[EP_81_DATA_IDX]._buffer+16); + long lYIdle = *(ep_buff[EP_81_DATA_IDX]._buffer+17); + long lZIdle = *(ep_buff[EP_81_DATA_IDX]._buffer+18); + long lZMIdle = *(ep_buff[EP_81_DATA_IDX]._buffer+19); + g_machine.s_status._bXMoving = lXIdle == 0 ? true : false; + g_machine.s_status._bYMoving = lYIdle == 0 ? true : false; + g_machine.s_status._bZMoving = lZIdle == 0 ? true : false; + g_machine.s_status._bZMMoving = lZMIdle == 0 ? true : false; + g_machine.s_status._bXYZZMIdle = (lXIdle + lYIdle + lZIdle + lZMIdle == 4) ? true : false; + + TRACE1("_bXYZZMIdle %ld\n", g_machine.s_status._bXYZZMIdle); + + Tmp.Format(_T("_process_MV_CMD_GET_POLL_59() %lf: _save_cmd %X ep_buff[81] %X x %ld y %ld z %ld zm %ld x_pos %ld y_pos %ld z_pos %ld zm-pos %ld \r\n"), + TimeInSecs(), + ep_buff[EP_01_CMD_IDX]._save_send_cmd, + ep_buff[EP_81_DATA_IDX]._buffer[0], + lXIdle, lYIdle, lZIdle, lZMIdle, + g_machine.x._pos_59, + g_machine.y._pos_59, + g_machine.z._pos_59, + g_machine.zm._pos_59); + TRACE1("%s", Tmp); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_WORKING_LIMITS_5E() +{ + memcpy(&(g_machine.s_machine_config.x_axis._neg_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.x_axis._neg_working_limit)); + + memcpy(&(g_machine.s_machine_config.y_axis._neg_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*1, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.y_axis._neg_working_limit)); + + memcpy(&(g_machine.s_machine_config.z_axis._neg_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*2, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.z_axis._neg_working_limit)); + + memcpy(&(g_machine.s_machine_config.zm_axis._neg_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*3, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.zm_axis._neg_working_limit)); + + memcpy(&(g_machine.s_machine_config.x_axis._pos_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*4, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.x_axis._pos_working_limit)); + + memcpy(&(g_machine.s_machine_config.y_axis._pos_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*5, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.y_axis._pos_working_limit)); + + memcpy(&(g_machine.s_machine_config.z_axis._pos_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*6, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.z_axis._pos_working_limit)); + + memcpy(&(g_machine.s_machine_config.zm_axis._pos_working_limit), ep_buff[EP_81_DATA_IDX]._buffer+5+4*7, 4); + _reverse_dword((DWORD *)&(g_machine.s_machine_config.zm_axis._pos_working_limit)); + + CString Tmp; + Tmp.Format(_T("_process_MV_CMD_GET_WORKING_LIMITS_5E() +:- xL-%ld yL-%ld zL-%ld zmL-%ld xH-%ld yH-%ld zH-%ld zmH-%ld\n"), + g_machine.s_machine_config.x_axis._pos_working_limit, + g_machine.s_machine_config.x_axis._neg_working_limit, + g_machine.s_machine_config.y_axis._pos_working_limit, + g_machine.s_machine_config.y_axis._neg_working_limit, + g_machine.s_machine_config.z_axis._pos_working_limit, + g_machine.s_machine_config.z_axis._neg_working_limit, + g_machine.s_machine_config.zm_axis._pos_working_limit, + g_machine.s_machine_config.zm_axis._neg_working_limit ); + TRACE1("%s", Tmp); + + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_CONFIG_60() +{ + memcpy((char *)g_machine.s_machine_config._str_serial_no, ep_buff[EP_81_DATA_IDX]._buffer+1, 32); + memcpy((char *)g_machine.s_machine_config._str_model, ep_buff[EP_81_DATA_IDX]._buffer+1+32, 32); + memcpy((char *)g_machine.s_machine_config._str_model_nbr, ep_buff[EP_81_DATA_IDX]._buffer+1+32+32, 32); + if (wcsstr(g_machine.s_machine_config._str_model_nbr, L"220")) + g_machine.s_machine_config._vector_light_model = 2; + else if (wcsstr(g_machine.s_machine_config._str_model_nbr, L"310")) + g_machine.s_machine_config._vector_light_model = 3; + else + g_machine.s_machine_config._vector_light_model = 3; + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_CONFIG_69() +{ + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_SET_LIGHT_6E() +{ + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_LIGHT_CONFIG_70() +{ + if (g_machine.s_machine_config._vector_light_model == 3) + memcpy((char *)g_machine.s_lights_300._segment, ep_buff[EP_81_DATA_IDX]._buffer+1, EIGHT_SEGS*FIVE_RINGS*4+8); + else + // if (g_machine.s_machine_config._vector_light_model == 3) + memcpy((char *)g_machine.s_lights_200._segment, ep_buff[EP_81_DATA_IDX]._buffer+1, EIGHT_SEGS*TWO_RINGS*4+8); + + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_MAX_DECEL_76() +{ + + g_machine.s_machine_config.x_axis._max_decel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+1)); + g_machine.s_machine_config.y_axis._max_decel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+5)); + g_machine.s_machine_config.z_axis._max_decel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+9)); + g_machine.s_machine_config.zm_axis._max_decel = _4char2long((unsigned char*)(ep_buff[EP_81_DATA_IDX]._buffer+13)); + TRACE3("_process_MV_CMD_MAX_DECEL_76() x,y,z: %ld %ld %ld\n", g_machine.s_machine_config.x_axis._max_decel, + g_machine.s_machine_config.y_axis._max_decel, + g_machine.s_machine_config.z_axis._max_decel); + TRACE1("_process_MV_CMD_MAX_DECEL_76() Zm : %ld\n", g_machine.s_machine_config.zm_axis._max_decel); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_SCALE_SLACK_7C() +{ + union + { + int iValue; + char c_array[4]; + }; + memset (c_array, 0, 4); + c_array[0] = *(ep_buff[EP_81_DATA_IDX]._buffer+3); + c_array[1] = *(ep_buff[EP_81_DATA_IDX]._buffer+2); + g_machine.s_machine_config.zm_axis._slack = iValue; + TRACE1("_process_MV_CMD_GET_SCALE_SLACK_7C() Zm : %ld\n", iValue); + return SSI_STATUS_NORMAL; +}; + +//============================================================== +SSI_STATUS CMv_Proto::_process_MV_CMD_GET_FINE_SCALE() +{ + memcpy(&(g_machine.x._scale_pos), ep_buff[EP_82_DATA_IDX]._buffer, 4); + _reverse_dword((DWORD *)&(g_machine.x._scale_pos)); + memcpy(&(g_machine.y._scale_pos), ep_buff[EP_82_DATA_IDX]._buffer+4*1, 4); + _reverse_dword((DWORD *)&(g_machine.y._scale_pos)); + memcpy(&(g_machine.z._scale_pos), ep_buff[EP_82_DATA_IDX]._buffer+4*2, 4); + _reverse_dword((DWORD *)&(g_machine.z._scale_pos)); + memcpy(&(g_machine.zm._scale_pos), ep_buff[EP_82_DATA_IDX]._buffer+4*3, 4); + _reverse_dword((DWORD *)&(g_machine.zm._scale_pos)); + + CString Tmp; + Tmp.Format(_T("_process_MV_CMD_GET_FINE_SCALE() +:- x-%ld y-%ld z-%ld zm-%ld\n"), + g_machine.x._scale_pos, + g_machine.y._scale_pos, + g_machine.z._scale_pos, + g_machine.zm._scale_pos ); + TRACE1("%s", Tmp); + return SSI_STATUS_NORMAL; +}; + + +#pragma message("Add error reporting and dbug logging in the HSI for when the move settle fails") +//=============================================================================== +// not sure what To Do if the settle testing fails. Should this genreate errors +// to indicate a creeping stage and increased settle parameters? +// retry count is the number of extra times To Do the stage moving test +// bandwidth is the maximum motion in a single watch time +// timeout is the maximum time to wait for a sub bandwidth move +//=============================================================================== +SSI_STATUS CMv_Proto::WaitForSettleXYZZM() +{ + // if TP active in DCC or rach mode then dont wait for settle + MV_TRACE(_T("Enter CSsi::WaitForSettleXYZZM\n")); + static bool bTest=true; + //if ( bTest ) + // if ( m_lTPEnable && (m_lTPMode==0 || m_lTPMode==3) ) + // { + // MV_TRACE(_T("Exit CSsi::WaitForSettleXYZZM m_lTPEnable && (m_lTPMode==0 || m_lTPMode==3\n")); + // return SSI_STATUS_NORMAL; + // } + + // if homing is active then we dont need to wait for this settle + if ( m_bHomingActive ) + { + MV_TRACE(_T("Enter CSsi::WaitForSettleXYZZM Homing active\n")); + return SSI_STATUS_NORMAL; + } + + long lSettledMask = 0; + long XSettled = 0x00000001; + long YSettled = 0x00000002; + long ZSettled = 0x00000004; + long ZMSettled = 0x00000008; + long AllSettled = 0x000000F; + long XTimedOut = 0x00010000; + long YTimedOut = 0x00020000; + long ZTimedOut = 0x00040000; + long ZMTimedOut = 0x00080000; + long AllTimeouts =0x000F0000; + + long lStartX = 0; + long lStartY = 0; + long lStartZ = 0; + long lStartZM = 0; +// long lStartR = 0; +// long Reserved; + + for ( int ii = 0 ; ii < 0 ; ++ii ) + { + double dStartTime = TimeInSecs(); + _send_cmd_MV_CMD_GET_POLL_59(lStartX, lStartY, lStartZ, lStartZM); + CString msg; + msg.Format(_T("\nSettlePositionTrace: Sec: %lf XYZZM: %ld %ld %ld %ld"), + dStartTime, lStartX, lStartY, lStartZ, lStartZM); + TRACE1("%s", msg); + Sleep(100); + } + + CSettleStageParams cParams; + + _send_cmd_MV_CMD_GET_POLL_59(lStartX, lStartY, lStartZ, lStartZM); + double dStartTime = TimeInSecs(); + long lXDeadband = (long)(cParams.EDGE_RETRY_BANDWIDTH_X * 1000.0 * g_machine.s_machine_config.x_axis._scale_resolution); + long lYDeadband = (long)(cParams.EDGE_RETRY_BANDWIDTH_Y * 1000.0 * g_machine.s_machine_config.y_axis._scale_resolution); + long lZDeadband = (long)(cParams.EDGE_RETRY_BANDWIDTH_Z * 1000.0 * g_machine.s_machine_config.z_axis._scale_resolution); + long lZMDeadband = (long)(cParams.EDGE_RETRY_BANDWIDTH_MAG/2000000.0); + + double dScaleTestIncr = 0.15; + long lX=0,lY=0,lZ=0, lZM=0; + //long lR=0, lReserved=0; + + TRACE1("\nSettle start time %lf\n\n", dStartTime); + double dMaxSettleTimeSec=0.0; + dMaxSettleTimeSec = (cParams.EDGE_RETRY_TIMEOUT_X/1000.0 < dMaxSettleTimeSec)?dMaxSettleTimeSec:cParams.EDGE_RETRY_TIMEOUT_X/1000.0; + dMaxSettleTimeSec = (cParams.EDGE_RETRY_TIMEOUT_Y/1000.0 < dMaxSettleTimeSec)?dMaxSettleTimeSec:cParams.EDGE_RETRY_TIMEOUT_Y/1000.0; + dMaxSettleTimeSec = (cParams.EDGE_RETRY_TIMEOUT_Z/1000.0 < dMaxSettleTimeSec)?dMaxSettleTimeSec:cParams.EDGE_RETRY_TIMEOUT_Z/1000.0; + dMaxSettleTimeSec = (cParams.EDGE_RETRY_TIMEOUT_MAG/1000.0 < dMaxSettleTimeSec)?dMaxSettleTimeSec:cParams.EDGE_RETRY_TIMEOUT_MAG/1000.0; + + CSettleStage cXAxis(1, dStartTime, lStartX, lXDeadband, dScaleTestIncr, 5*dMaxSettleTimeSec); + CSettleStage cYAxis(2, dStartTime, lStartY, lYDeadband, dScaleTestIncr, 5*dMaxSettleTimeSec); + CSettleStage cZAxis(3, dStartTime, lStartZ, lZDeadband, dScaleTestIncr, 5*dMaxSettleTimeSec); + CSettleStage cZMAxis(4, dStartTime, lStartZM, lZMDeadband, dScaleTestIncr, 5*dMaxSettleTimeSec); + + // if the axis time increment has passed and the stage has not moved more than the + // bandwidth then it has settled. If the max settle time widow has expired + // then it failed to settle + + // loop until or one has timed out or all settled + while ( !(AllTimeouts&lSettledMask) && ((AllSettled&lSettledMask) != AllSettled) ) + { + Sleep(10); + double dCurTime = TimeInSecs(); + enum SETTLE_STATUS SettleStatus = NOTSETTLED; + _send_cmd_MV_CMD_GET_POLL_59(lX, lY, lZ, lZM); + TRACE1("time: %lf\n", dCurTime); + + SettleStatus = cXAxis.Test(dCurTime, lX); + TRACE1("X Test Status %ld\n", SettleStatus); + +#ifdef _DEBUG + if ( SettleStatus == TIMEDOUT ) TRACE0("X settle timeout\n"); + if ( SettleStatus == SETTLED ) TRACE0("X settled\n"); +#endif + + lSettledMask = (SettleStatus == SETTLED)?(lSettledMask |XSettled):lSettledMask; + lSettledMask = (SettleStatus == TIMEDOUT)?(lSettledMask |XTimedOut):lSettledMask; + + SettleStatus = cYAxis.Test(dCurTime, lY); + TRACE1("Y Test Status %ld\n", SettleStatus); + +#ifdef _DEBUG + if ( SettleStatus == TIMEDOUT ) TRACE0("Y settle timeout\n"); + if ( SettleStatus == SETTLED ) TRACE0("Y settled\n"); +#endif + + lSettledMask = (SettleStatus == SETTLED)?lSettledMask |= YSettled:lSettledMask; + lSettledMask = (SettleStatus == TIMEDOUT)?lSettledMask |= YTimedOut:lSettledMask; + + SettleStatus = cZAxis.Test(dCurTime, lZ); + TRACE1("Z Test Status %ld\n", SettleStatus); + +#ifdef _DEBUG + if ( SettleStatus == TIMEDOUT ) TRACE0("Z settle timeout\n"); + if ( SettleStatus == SETTLED ) TRACE0("Z settled\n"); +#endif + + lSettledMask = (SettleStatus == SETTLED)?lSettledMask |= ZSettled:lSettledMask; + lSettledMask = (SettleStatus == TIMEDOUT)?lSettledMask |= ZTimedOut:lSettledMask; + + SettleStatus = cZMAxis.Test(dCurTime, lZM); + TRACE1("ZM Test Status %ld\n", SettleStatus); + +#ifdef _DEBUG + if ( SettleStatus == TIMEDOUT ) TRACE0("ZM settle timeout\n"); + if ( SettleStatus == SETTLED ) TRACE0("ZM settled\n"); +#endif + + lSettledMask = (SettleStatus == SETTLED)?lSettledMask |= ZMSettled:lSettledMask; + lSettledMask = (SettleStatus == TIMEDOUT)?lSettledMask |= ZMTimedOut:lSettledMask; + } + + TRACE1("CSsi::WaitForSettle exit status %X", lSettledMask); + TRACE2("\nSettle finish time %lf Elapsed: %lf\n\n", TimeInSecs(), TimeInSecs()-dStartTime); + if ( (AllSettled&lSettledMask) == AllSettled ) + { + TRACE0(" - no timeout\n"); + MV_TRACE(_T("Exit CSsi::WaitForSettleXYZZM normal\n")); + return SSI_STATUS_NORMAL; + } + else + { + TRACE0(" - timeout\n"); + MV_TRACE(_T("Exit CSsi::WaitForSettleXYZZM timeout\n")); + return SSI_STATUS_ERROR; + } +} + +CSettleStage::CSettleStage(long lAxis, double dStartTime, long lStart, long lDeadband, double dTestIncrSec, double dMaxTimeSec) +{ + m_dStartTime = dStartTime; + m_lStartPos = lStart; + m_lDeadband = lDeadband; + m_dTestIncrSec = dTestIncrSec; + m_dMaxTimeSec = dMaxTimeSec; + m_dIncrStartTimeSec = m_dStartTime; + m_lAxis = lAxis; +} + +enum SETTLE_STATUS CSettleStage::Test(double dCurTime, long lCurPos) +{ + if ( dCurTime - m_dStartTime > m_dMaxTimeSec ) + { + TRACE1("CSettleStage::Test Axis: %ld Final TIMEDOUT\n", m_lAxis); + ASSERT(0); + return TIMEDOUT; + } + + if ( dCurTime - m_dIncrStartTimeSec > m_dTestIncrSec ) + { + if ( abs(lCurPos - m_lStartPos) <= m_lDeadband ) + { + TRACE2("settle test Axis: %ld %lf Settled\n", m_lAxis, dCurTime); + return SETTLED; + } + else + { + CString msg; + msg.Format(_T("Settle test Axis: %ld Incr timeout cur time: %lf, inc start time: %lf cur pos: %ld start pos %ld\n"), m_lAxis, dCurTime, m_dIncrStartTimeSec, lCurPos, m_lStartPos); + TRACE1("%s", msg); + m_lStartPos = lCurPos; + m_dIncrStartTimeSec = dCurTime; + } + } + return NOTSETTLED; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.h b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.h new file mode 100644 index 0000000..683d93a --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/Mv_Proto.h @@ -0,0 +1,676 @@ +// DataLink.h: interface for the CDataLink class. +// +////////////////////////////////////////////////////////////////////// +#if !defined(AFX_DataLink_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) + #define AFX_DataLink_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 /*ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h + + #include "logger.h" + #include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h" + #include "SsiStatus.h" + + #define MV_TIMER_POLL_58 0x58 + #define MV_TIMER_POLL_59 0x59 + #define MV_TIMER_POLL_2B 0x2B + + #define MAX_ASYNC_CONTEXT 10 + #define MV_CMD_UNKNOWN 0x00 + #define MV_CMD_POLL_00_01 0x01 + #define MV_CMD_GET_POS_XYZ_00_02 0x02 + #define MV_CMD_SET_POS_XYZ_00_03 0x03 + #define MV_CMD_GET_POS_R_00_04 0x04 + #define MV_CMD_SET_POS_R_00_05 0x05 + #define MV_CMD_SET_ZOOM_00_06 0x06 + #define MV_CMD_GET_ZOOM_00_07 0x07 + #define MV_CMD_GET_STARUP_CONFIG_00 0x00 + #define MV_CMD_GET_SUB_CONFIG_28 0x28 // Get 0x12 bytes + #define MV_CMD_GET_SUB_CONFIG_29 0x29 // Get 0x60 bytes - two subcode + #define MV_CMD_SERVO_CMD_2B 0x2b // Get 0x45 bytes + #define MV_CMD_START_MACHINE_2C 0x2c // Get 0x20 bytes + #define MV_CMD_GET_UNK_31 0x31 // Get 0x20 + #define MV_CMD_GET_UNK_32 0x32 // Get 0x02 + #define MV_CMD_GET_UNK_34 0x34 // Get 0x02 + #define MV_CMD_GET_UNK_35 0x35 // Get 0x10 + #define MV_CMD_GET_UNK_3C 0x3C // Get 0x10 + #define MV_CMD_GET_X_INDEX_41 0x41 // Get 0x06 + #define MV_CMD_GET_Y_INDEX_42 0x42 // Get 0x06 + #define MV_CMD_GET_MAG_43 0x43 // Get 0x06 + #define MV_CMD_GET_ZOOM_DECEL_45 0x45 // Get 0x06 + #define MV_CMD_SET_JOYSTICK_MODE_47 0x47 // + #define MV_CMD_MOVE_AXIS_4C 0x4C // Get 0x02 + #define MV_CMD_GET_INDEX_4E 0x4E // Get 0x07 + #define MV_CMD_SEEK_INDEX_4F 0x4F // Get 0x07 + #define MV_CMD_MAX_SPEED_50 0x50 + #define MV_CMD_MAX_ACCEL_51 0x51 + #define MV_CMD_MOVE_TO_53 0x53 // Get 0x11 + #define MV_CMD_GET_UNK_56 0x56 // Get 0x20 + #define MV_CMD_GET_SCALE_58 0x58 // Get 0x11 + #define MV_CMD_GET_POLL_59 0x59 // Get 0x3E + #define MV_CMD_GET_WORKING_LIMITS_5E 0x5E // Get 0x78 + #define MV_CMD_GET_CONFIG_60 0x60 // Get 0x72 bytes + #define MV_CMD_GET_RAW_SCALE_63 0x63 // Get 0x63 + #define MV_CMD_GET_CONFIG_69 0x69 // Get 0xFE + #define MV_CMD_GET_UNK_6A 0x6A // Get 0x6a + #define MV_CMD_SET_LIGHT_6E 0x6E // Get 0xFE + #define MV_CMD_GET_MACHINE_SIGNATURE_6F 0x6F // Get 0xFE + #define MV_CMD_GET_LIGHT_CONFIG_70 0x70 // Get 0xFE + #define MV_CMD_GET_UNK_71 0x71 // Get 0xFE + #define MV_CMD_GET_UNK_74 0x74 // Get 0xFE + #define MV_CMD_GET_UNK_75 0x75 // Get 0xFE + #define MV_CMD_MAX_DECEL_76 0x76 // Get 0x11 + #define MV_CMD_GET_SCALE_SLACK_7C 0x7C // Get 0x04 + + #define MAX_BUFF_SIZE 0x200 + + #define USB_ENDPOINT_TYPE_CONTROL 0 + #define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 + #define USB_ENDPOINT_TYPE_BULK 2 + #define USB_ENDPOINT_TYPE_INTERRUPT 3 + + #define USB_DEVICE_DESCRIPTOR_TYPE 1 + #define USB_CONFIGURATION_DESCRIPTOR_TYPE 2 + + #define THREAD_RUNNING 0 + #define THREAD_PAUSED 1 + #define THREAD_EXIT -1 + +// Device configuration and interface id. + #define MV_USB_CONFIG 1 + #define MV_USB_INTF 0 + + #define EP_01 0x01 + #define EP_02 0x02 + #define EP_03 0x03 + #define EP_81 0x81 + #define EP_82 0x82 + #define EP_84 0x84 + + #define EP_01_CMD_IDX 0 // index to usb buffers + #define EP_81_DATA_IDX 1 // + #define EP_02_CMD_IDX 2 // + #define EP_82_DATA_IDX 3 // + #define EP_03_CMD_IDX 4 // + #define EP_84_DATA_IDX 5 // + + #define lEPSIZE 6 + #define MAXRINGS 5 // for MicroVu Vertex 220 + #define MAXSEGS 8 + + #define TWO_RINGS 2 + #define EIGHT_SEGS 8 + #define FIVE_RINGS 5 + + const long MAXINTENSITY = 0x3FF; + #define mvMAXLIGHTVALUE 1024 + +#pragma pack(push) +#pragma pack(1) +//**************************************************************************************************** +// Set the _status to Idle after reply data has been received. +// How to recover? In order to send data, _status must be Idle. If the system is not available +// for 1 second, assume something wrong and treat it as "TimeOut". +// Another way to do this is to lock this structure is to use a mutex to ensure single-threaded +// access. +//**************************************************************************************************** +typedef struct s_axis // axis parameters +{ + long _pos_58; + long _pos_59; + long _scale_pos; + long _speed; + long _acceleration; + long _deceleration; + double _deg; +} AXIS; +struct s_axis_config // axis configuration +{ + double _scale_resolution; + long _scale_range; + long _neg_working_limit; + long _pos_working_limit; + long _scale_count; + long _max_speed; + long _max_accel; + long _max_decel; + long _index_10; + long _index_03; + bool _bhomed; +}; +struct s_zm_axis_config // zm configuration +{ + int _mag_step; // number of steps + long _max_speed; + long _scale_count; // total scale count + long _neg_working_limit; // within the limits + long _pos_working_limit; + long _max_accel; + long _max_decel; + long _index_03; + long _index_10; + int _slack; +}; + +struct s_r_axis_config +{ + double _scale_resolution; + long _scale_count; // total scale count +}; + +//-------------------------------------------------------------------- +// +//-------------------------------------------------------------------- +struct struct_machine +{ // g_machine structure + struct s_machine_config + { + wchar_t _str_servo_Id[16]; + wchar_t _str_model[16]; + wchar_t _str_model_nbr[16]; + wchar_t _str_serial_no[16]; + int _vector_light_model; + char _str_2b[64]; + BYTE _str_bin_2b[64]; + char _str_4c02_signature[64]; + BYTE _str_bin_4c02[64]; + char _str_6f00_signature[64]; + BYTE _str_bin_6f00[64]; + char _str_7000_signature[64]; + BYTE _str_bin_7000[64]; + int _usb_command_wait; + int _usb_command_timeout; + struct s_axis_config x_axis; + struct s_axis_config y_axis; + struct s_axis_config z_axis; + struct s_zm_axis_config zm_axis; + struct s_r_axis_config r1_axis; + struct s_r_axis_config r2_axis; + int _nbr_lamps; + double _dXYZSpeed; // this is not part of the MV original config data + } s_machine_config; + struct s_status + { + bool _homed; + bool _machine_running; + bool _poll_58_active; + bool _poll_59_active; + bool _poll_2b_active; + bool _bXMoving; + bool _bYMoving; + bool _bZMoving; + bool _bZMMoving; + bool _bXYZZMIdle; + } s_status; + union { + struct s_lights_300 // special data structure for 5x8 ring configuration + { + int _segment[FIVE_RINGS][EIGHT_SEGS]; + int _bottom_light; + int _axial_light; + } s_lights_300; + struct s_lights_200 // special data structure for 2x8 ring configuration + { + int _segment[TWO_RINGS][EIGHT_SEGS]; + int _bottom_light; + int _axial_light; + } s_lights_200; + }; + long _hit_pos_x; // touch probe + long _hit_pos_y; // touch probe + struct s_axis x; + struct s_axis y; + struct s_axis z; + struct s_axis zm; + struct s_axis r1; + struct s_axis r2; +}; + + #define MICROVU_VID 0x0d26 + #define MICROVU_PID 0x1001 + +//**************************************************************************************************** +// Binary MicroVu command structure, out going +// +//**************************************************************************************************** + #define pMV_CMD_01 ((s_MV_CMD_BUFF_01 *) ep_buff[EP_01_CMD_IDX]._buffer) + +struct s_MV_CMD_BUFF_01 +{ + UCHAR uCmdByte; + //---------------------------------------------------------------------- + // [endpoint 0x00000001] 00000060 : 530001010100fffe1d89ffff4d37fffebeee000000000000c34e0000021a0000003200000000000f423b000029fb0000138800000000003d08ee00030d4000030d40000000000000000000000000000000000000000000000000000000000000 + // *Command : 53 Move To -- X Y Z ZM Scale-0123511 -0045769 -0082194 00000000 + // *Speed : 00049998 00000538 00000050 00000000 + // *Unk1 : 00999995 00010747 00005000 00000000 + // *Unk2 : 03999982 00200000 00200000 00000000 + union + { + struct + { + BYTE cmd0; + DWORD dAddr; + BYTE cmd1; + } S_MV_CMD_0x29; + struct + { + wchar_t servo_Id[16]; + unsigned int unk_1[16]; + } S_MV_CMD_0x2b; + struct + { + BYTE cmd0; + } S_MV_CMD_0x41; + struct + { + BYTE cmd0; + } S_MV_CMD_0x42; + struct + { + BYTE cmd0; + } S_MV_CMD_0x43; + struct + { + BYTE cmd0; + } S_MV_CMD_0x45; + struct + { + BYTE cmd0; + } S_MV_CMD_0x4E; + struct + { + BYTE cmd0; + BYTE cmd1; + } S_MV_CMD_0x4F; + struct + { + BYTE cmd0; + } S_MV_CMD_0x50; + struct + { + UCHAR uSubCmdByte; + UCHAR statusByte[4]; + struct S_POS + { + LONG x; + LONG y; + LONG z; + LONG zm; + } S_POS; + struct S_SPEED + { + LONG x; + LONG y; + LONG z; + LONG zm; + }S_SPEED; + struct S_ACC + { + LONG x; + LONG y; + LONG z; + LONG zm; + }S_ACC; + struct S_DEC + { + LONG x; + LONG y; + LONG z; + LONG zm; + }S_DEC; + } S_MV_CMD_0x53; + struct // single axis move command + { + UCHAR uAxis; + UCHAR statusByte; + LONG lPosition; + LONG lSpeed; + LONG lAcc; + LONG lDecel; + } S_MV_CMD_0x4C; + struct // single axis move command + { + UCHAR uAxis; + LONG lR1_Pos; + LONG lR2_Pos; + LONG lX; + LONG lY; + LONG lZ; + } S_MV_CMD_0x4C10; + struct + { + BYTE cmd0; + BYTE cmd1; + } S_MV_CMD_0x59; + struct + { + BYTE cmd0; + } S_MV_CMD_0x69; + struct + { + UINT uSubCmdByte; + UINT segment[FIVE_RINGS][EIGHT_SEGS]; + UINT bottom_light; + UINT axial_light; + } S_MV_CMD_300_0x6e; + struct + { + UINT uSubCmdByte; + UINT segment[TWO_RINGS][EIGHT_SEGS]; + UINT bottom_light; + UINT axial_light; + } S_MV_CMD_200_0x6e; + struct + { + BYTE cmd0; + } S_MV_CMD_0x6F; + struct + { + BYTE cmd0; + } S_MV_CMD_0x76; + struct + { + BYTE cmd0; + } S_MV_CMD_0x7C; + }; +}; + +//====================== +typedef struct s_xyzzm +{ + bool bFast; + long from; + long to; + long speed; + long acc; + long dec; + double dFromMM; + double dToMM; +} AXISMOVE; +#pragma pack(pop) + +//====================== +struct struct_ep_buff +{ + int _ep; + BYTE _save_send_cmd; + BYTE _save_send_cmd0; + BYTE _save_send_cmd1; + char *_buffer; // MAX_BUFF_SIZE + int _size; + void *_async_context; + BOOL _hProtoPending; + HANDLE _event; +}; + +enum SETTLE_STATUS +{ + NOTSETTLED = 0, + SETTLED, + TIMEDOUT +}; + +// CSettleStageParams and CSettleStage are copied from QVI, but QVI is based on millionths of and inch +// and we will use microns for MV +class CSettleStageParams +{ +public: + CSettleStageParams() + { + EDGE_RETRY_TIMEOUT_X = 800; + EDGE_RETRY_TIMEOUT_Y = 800; + EDGE_RETRY_TIMEOUT_Z = 800; + EDGE_RETRY_TIMEOUT_MAG = 800; + EDGE_RETRY_BANDWIDTH_X = 1; + EDGE_RETRY_BANDWIDTH_Y = 1; + EDGE_RETRY_BANDWIDTH_Z = 1; + EDGE_RETRY_BANDWIDTH_MAG = 1; + EDGE_RETRY_COUNT_X = 1; + EDGE_RETRY_COUNT_Y = 1; + EDGE_RETRY_COUNT_Z = 1; + EDGE_RETRY_COUNT_MAG = 1; + }; + + long EDGE_RETRY_TIMEOUT_X; //300 + long EDGE_RETRY_TIMEOUT_Y; //300 + long EDGE_RETRY_TIMEOUT_Z; //300 + long EDGE_RETRY_TIMEOUT_MAG; //300 + long EDGE_RETRY_BANDWIDTH_X; //50 + long EDGE_RETRY_BANDWIDTH_Y; //50 + long EDGE_RETRY_BANDWIDTH_Z; //50 + long EDGE_RETRY_BANDWIDTH_MAG; //50 + long EDGE_RETRY_COUNT_X; //1 + long EDGE_RETRY_COUNT_Y; //1 + long EDGE_RETRY_COUNT_Z; //1 + long EDGE_RETRY_COUNT_MAG; //1 +}; + +class CSettleStage +{ +public: + CSettleStage(long lAxis, double dStartTime, long lStart, long lDeadband, double dTestIncrSec, double dMaxTimeSec); + enum SETTLE_STATUS Test(double dCurTime, long lCurPos); + +private: + double m_dStartTime; + long m_lStartPos; + long m_lDeadband; + double m_dTestIncrSec; + double m_dMaxTimeSec; + double m_dIncrStartTimeSec; + long m_lAxis; +}; + +//====================================================================================== +class CMv_Proto +{ +public: + // EP 01/81 channel threads. + static int g_hEP81_Thread_State; + static unsigned __stdcall g_EP81_Thread(LPVOID pThis); + static HANDLE g_hEP81_Thread_Id; + + // EP 02/82 channel threads. + static int g_hEP82_Thread_State; + static unsigned __stdcall g_EP82_Thread(LPVOID pThis); + static HANDLE g_hEP82_Thread_Id; + // + // g_hEP01_Thread_Event is used to kick a command + // + static int g_hEP01_Thread_State; + static unsigned __stdcall g_EP01_Thread(LPVOID pThis); + static HANDLE g_hEP01_Thread_Id; + static HANDLE g_hEP01_Serial_Mutex; // EP01 + // + static int g_hEP02_Thread_State; + static unsigned __stdcall g_EP02_Thread(LPVOID pThis); + static HANDLE g_hEP02_Thread_Id; + static HANDLE g_hEP02_Serial_Mutex; // EP02 + + static HANDLE g_hHomedEvent; + + double ScaleToMM(long lCount, double dResolution); + long MMtoScale(double lDistanceMM, double dResolution); + static void Trace_EP_Buff(long lIndex); + + static void _process_rcv_transfer_data(int iEP); + static SSI_STATUS _process_MV_CMD_SERVO_CMD_2B(); + static SSI_STATUS _process_MV_CMD_2C(); + static SSI_STATUS _process_MV_CMD_GET_SUB_CONFIG_28(); + static SSI_STATUS _process_MV_CMD_GET_CONFIG_60(); + static SSI_STATUS _process_MV_CMD_GET_CONFIG_69(); + static SSI_STATUS _process_MV_CMD_SET_LIGHT_6E(); + static SSI_STATUS _process_MV_CMD_GET_X_INDEX_41(); + static SSI_STATUS _process_MV_CMD_GET_Y_INDEX_42(); + static SSI_STATUS _process_MV_CMD_GET_MAG_43(); + static SSI_STATUS _process_MV_CMD_GET_ZOOM_DECEL_45(); + static SSI_STATUS _process_MV_CMD_GET_INDEX_4E(); + static SSI_STATUS _process_MV_CMD_MAX_SPEED_50(); + static SSI_STATUS _process_MV_CMD_MAX_ACCEL_51(); + static SSI_STATUS _process_MV_CMD_GET_UNK_56(); + static SSI_STATUS _process_MV_CMD_GET_SCALE_58(); + static SSI_STATUS _process_MV_CMD_GET_POLL_59(); + static SSI_STATUS _process_MV_CMD_GET_WORKING_LIMITS_5E(); + static SSI_STATUS _process_MV_CMD_GET_LIGHT_CONFIG_70(); + static SSI_STATUS _process_MV_CMD_MAX_DECEL_76(); + static SSI_STATUS _process_MV_CMD_GET_SCALE_SLACK_7C(); + static SSI_STATUS _process_MV_CMD_GET_FINE_SCALE(); + + // Global Structures + static struct_ep_buff ep_buff[lEPSIZE]; + static struct_machine g_machine; + + // + CMv_Proto(); + virtual ~CMv_Proto(); + SSI_STATUS Init_MvUsb(); + SSI_STATUS Exit_MvUsb(); + SSI_STATUS Load_MicroVu_Config(); + SSI_STATUS GetAppPath(CString &Path); + SSI_STATUS ExtractAppPath(CString &Path); + + static double TimeInSecs(void); + static CLogger* g_pLogger; + static usb_dev_handle *g_dev; + bool m_bHomingActive; + + usb_dev_handle* _open_usb_dev(void); + SSI_STATUS _start_machine(); + SSI_STATUS _shutdown_machine(); + SSI_STATUS _do_single_threaded_usb_comm(int iEP); + SSI_STATUS _poll_machine_2b(); + SSI_STATUS _poll_machine_58(); + SSI_STATUS _poll_machine_59(); + + SSI_STATUS _submit_async_8x(int iEP_Base); + SSI_STATUS _reap_async_8x(int iEP_Base); + SSI_STATUS _send_usb_data(int iEP_Base); + + SSI_STATUS _get_config(); + SSI_STATUS _get_xyz_index(); + SSI_STATUS _replay_capture(CString cFileName); + SSI_STATUS _process_replay_capture_commands(char *inBuff, FILE* pInFile); + static void _swap_byte(unsigned short &Val); + static void _reverse_dword(DWORD *); + static void _scale2inch(unsigned long scale, double &inch); + static void _inch2scale(unsigned long &scale, double inch); + static long _4char2long(unsigned char *cBuff); + static void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len); + SSI_STATUS _calculate_straightline_motion(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z, double dSpeedMM); + SSI_STATUS WaitForSettleXYZZM(); + void mv_set_full_ringlight_data(long lIntensity); + void mv_set_ringlight_data(long lMaxSize, double *pSegments); + + SSI_STATUS _set_position_xyz(AXISMOVE &X, AXISMOVE &Y, AXISMOVE &Z); + // + // Motion Related + // + SSI_STATUS mv_motion_is_supported(); + SSI_STATUS mv_motion_startup(double x_scale_resolution, double y_scale_resolution, double z_scale_resolution); + SSI_STATUS mv_motion_get_axis_count(int &iCount); + SSI_STATUS mv_motion_set_speed_xyz(double dSpeed); + SSI_STATUS mv_motion_get_speed_xyz(double &dSpeed); + SSI_STATUS mv_motion_set_speed_r(long r_speed); + SSI_STATUS mv_motion_get_settle_time(); + SSI_STATUS mv_motion_get_deadband(); + SSI_STATUS mv_motion_get_refresh_deadband(); + SSI_STATUS mv_motion_get_position_xyz(double &_dX, double &_dY, double &_dZ); + SSI_STATUS mv_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait); + SSI_STATUS mv_motion_get_position_r(double &dPositionR); + SSI_STATUS mv_motion_set_position_r(double dPositionR); + SSI_STATUS mv_motion_store_position_xyz(); + SSI_STATUS mv_motion_get_stored_positions_xyz(); + SSI_STATUS mv_motion_is_axis_moving(); + bool mv_motion_is_homed(); + SSI_STATUS mv_motion_set_stage_limits(); + SSI_STATUS mv_motion_get_stage_limits(); + SSI_STATUS mv_motion_dcc_scan_start(); + SSI_STATUS mv_motion_dcc_scan_get_data_size(); + SSI_STATUS mv_motion_dcc_scan_get_data(); + SSI_STATUS mv_motion_Dcc_Home(); + SSI_STATUS mv_motion_shut_down(); + SSI_STATUS mv_motion_fly_mode_cancel(); + SSI_STATUS mv_motion_get_axes_max_speed(double &dMaxSpeedX, double &dMaxSpeedY, double &dMaxSpeedZ); + SSI_STATUS mv_motion_get_3D_max_speed(double &dMaxSpeed); + SSI_STATUS mv_motion_get_position_meas_point(); + // + SSI_STATUS mv_optics_is_supported(); + SSI_STATUS mv_optics_start_up(); + SSI_STATUS mv_optics_get_magnification_steps(int& iSteps); + SSI_STATUS mv_optics_get_numeric_aperture(); + SSI_STATUS mv_optics_get_magnification(int& iStep); + SSI_STATUS mv_optics_set_magnification(int iStep); + SSI_STATUS mv_optics_get_deadband(); + SSI_STATUS mv_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range); + SSI_STATUS mv_optics_get_scale_position(long &lScale); + SSI_STATUS mv_optics_set_scale_position(const long lScale); + SSI_STATUS mv_optics_refresh_lens(); + SSI_STATUS mv_optics_enable_grid(); + SSI_STATUS mv_optics_is_grid_enabled(); + SSI_STATUS mv_optics_enable_laser(); + SSI_STATUS mv_optics_is_laser_enabled(); + SSI_STATUS mv_optics_shut_down(); + SSI_STATUS mv_light_is_supported(BOOL &bTrue); + SSI_STATUS mv_light_start_up(); + SSI_STATUS mv_light_get_lamp_count(int& iCount); + SSI_STATUS mv_light_get_lamp_info(); + SSI_STATUS mv_light_set_lamp_state(double dBottomPercent, double dTopPercent); + SSI_STATUS mv_light_shut_down(); + SSI_STATUS mv_light_set_light(); + SSI_STATUS mv_light_set_light_off(); + + SSI_STATUS mv_pendant_enable(BOOL bTrue); + + SSI_STATUS _send_cmd_MV_CMD_GET_POS_XYZ_00_02(); + SSI_STATUS _send_cmd_MV_CMD_SET_POS_XYZ_00_03(); + SSI_STATUS _send_cmd_MV_CMD_GET_POS_R_00_04(); + SSI_STATUS _send_cmd_MV_CMD_SET_POS_R_00_05(); + SSI_STATUS _send_cmd_MV_CMD_SET_ZOOM_00_06(); + SSI_STATUS _send_cmd_MV_CMD_GET_ZOOM_00_07(); + SSI_STATUS _send_cmd_MV_CMD_GET_STARUP_CONFIG_00(); + SSI_STATUS _send_cmd_MV_CMD_GET_SUB_CONFIG_28(); + SSI_STATUS _send_cmd_MV_CMD_GET_SUB_CONFIG_29(BYTE cmd0, DWORD addr, BYTE cmd1); + SSI_STATUS _send_cmd_MV_CMD_SERVO_CMD_2B(); + SSI_STATUS _send_cmd_MV_CMD_START_MACHINE_2C(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_31(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_32(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_34(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_35(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_3C(); + SSI_STATUS _send_cmd_MV_CMD_GET_X_INDEX_41(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_Y_INDEX_42(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_MAG_43(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_ZOOM_DECEL_45(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_MOVE_AXIS_4C(BYTE Axis, long lDestination, BYTE lStatusByte); + SSI_STATUS _send_cmd_PRE_ROTARY(); + SSI_STATUS _send_cmd_MV_CMD_MOVE_AXIS_4C10(long lCount); + SSI_STATUS _send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(BOOL bTrue); + SSI_STATUS _send_cmd_MV_CMD_GET_INDEX_4E(BYTE cmd0, BYTE send_len, BYTE recv_len); + SSI_STATUS _send_cmd_MV_CMD_SEEK_INDEX_4F(BYTE cmd0, BYTE cmd1); + SSI_STATUS _send_cmd_MV_CMD_MAX_SPEED_50(BYTE cmd0, BYTE send_len, BYTE recv_len); + SSI_STATUS _send_cmd_MV_CMD_MAX_ACCEL_51(BYTE cmd0, BYTE send_len, BYTE recv_len); + SSI_STATUS _send_cmd_MV_CMD_MOVE_TO_53(); + SSI_STATUS _send_cmd_MV_CMD_GET_STAGE_RANGE_56(); + SSI_STATUS _send_cmd_MV_CMD_GET_SCALE_58(long &lX, long &lY, long &lZ); + SSI_STATUS _send_cmd_MV_CMD_GET_POLL_59(long &lX, long &lY, long &lZ, long &lZM); + SSI_STATUS _send_cmd_MV_CMD_GET_WORKING_LIMITS_5E(); + SSI_STATUS _send_cmd_MV_CMD_GET_CONFIG_60(); + SSI_STATUS _send_cmd_MV_CMD_GET_RAW_SCALE_63(); + SSI_STATUS _send_cmd_MV_CMD_GET_CONFIG_69(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_6A(); + SSI_STATUS _send_cmd_MV_CMD_SET_LIGHT_6E(); + SSI_STATUS _send_cmd_MV_CMD_GET_MACHINE_SIGNATURE_6F(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_LIGHT_CONFIG_70(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_71(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_74(); + SSI_STATUS _send_cmd_MV_CMD_GET_UNK_75(); + SSI_STATUS _send_cmd_MV_CMD_MAX_DECEL_76(BYTE cmd0, BYTE send_len, BYTE recv_len); + SSI_STATUS _send_cmd_MV_CMD_GET_SCALE_SLACK_7C(BYTE cmd0); + SSI_STATUS _send_cmd_MV_CMD_GET_FINE_SCALE(long &lX, long &lY, long &lZ, long &lZM); +}; + +#endif +// !defined(AFX_DataLink_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/REGISTRY.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/REGISTRY.CPP new file mode 100644 index 0000000..16705d5 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/REGISTRY.CPP @@ -0,0 +1,82 @@ +#include "StdAfx.h" + +#include +#include + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#define new DEBUG_NEW +#endif + +HKEY OpenKeySection(const TCHAR *i_Section) +{ + HKEY hKey = NULL; + + if(i_Section) + { + RegOpenKeyEx(HKEY_LOCAL_MACHINE, i_Section, 0, KEY_WRITE|KEY_READ, &hKey); + if(!hKey) + { + DWORD dw; + RegCreateKeyEx(HKEY_LOCAL_MACHINE, i_Section, 0, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE|KEY_READ, NULL, &hKey, &dw); + } + } + + return hKey; +} + +bool ReadRegKey(const TCHAR *i_Section, const TCHAR *i_Key, int &o_Value) +{ + bool ReadOK = false; + + if(i_Section) + { + HKEY hKey = OpenKeySection(i_Section); + + if(hKey) + { + DWORD dwType; + DWORD dwCount; + + LONG lResult = RegQueryValueEx(hKey, i_Key, NULL, &dwType, NULL, &dwCount); + + if(lResult == ERROR_SUCCESS && dwType == REG_DWORD) + { + lResult = RegQueryValueEx(hKey, i_Key, NULL, &dwType, (LPBYTE)&o_Value, &dwCount); + ReadOK = true; + } + + RegCloseKey(hKey); + } + } + + return ReadOK; +} + +void WriteRegKey(const TCHAR *i_Section, const TCHAR *i_Key, int i_Value) +{ + if(i_Section) + { + HKEY hKey = OpenKeySection(i_Section); + + if(hKey) + { + RegSetValueEx(hKey, i_Key, NULL, REG_DWORD, (LPBYTE)&i_Value, sizeof(i_Value)); + RegCloseKey(hKey); + } + } +} + +void DeleteRegKey(const TCHAR *i_Section, const TCHAR *i_Key) +{ + if(i_Section) + { + HKEY hKey = OpenKeySection(i_Section); + + if(hKey) + { + /*LONG lResult = */RegDeleteKey(hKey, i_Key); + } + } +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/RESOURCE.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/RESOURCE.H new file mode 100644 index 0000000..70e5509 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/RESOURCE.H @@ -0,0 +1,22 @@ +#pragma once +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by HSI.rc +// +#define IDS_PROJNAME 100 +#define IDR_FRAMEGRABBER 102 +#define IDR_MOTION 103 +#define IDR_LIGHTING 104 +#define IDR_OPTICS 105 +#define IDD_CONFIG_DLG 201 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 202 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 106 +#endif +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SSIDATA.cpp b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SSIDATA.cpp new file mode 100644 index 0000000..c399f2d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SSIDATA.cpp @@ -0,0 +1,4162 @@ +// SSIData.cpp: implementation of the CSSIData class. +// +////////////////////////////////////////////////////////////////////// +#include "stdafx.h" +#include "HAL_SSIStatus.H" +#include "Logger.h" +#include "SSIData.h" + +//=================================================================================== +int CSSIData::Read_CSG_Config_File(CString FileName) +{ +// FILE * pFile = NULL; +// CStdioFile cCalFile; +// BOOL bFileStatus = FALSE; +// CFileException cfeOpenError; +// bFileStatus = cCalFile.Open(FileName, CFile::modeRead|CFile::typeText, &cfeOpenError ); +// if (!bFileStatus) +// { +// return SSI_STATUS_ERROR; +// } +// +// CString csLine; +// +// switch (eMode) +// { +// case eHEXMODE: +// { +// CString resToken; +// int curPos= 0; +// int ii=0; +// +// cCalFile.ReadString(csLine); +// resToken= csLine.Tokenize(_T(" "),curPos); +// while (resToken != "" && ii <= EEPROMBYTES) +// { +// printf("Resulting token: %s\n", resToken); +// _stscanf(resToken, _T("%x"), &(m_EEPROM.EEPROM_Bytes[ii++])); +// resToken= csLine.Tokenize(_T(" "),curPos); +// } +// break; +// } +// case eCFGTEXTMODE: +// { +// CStdioFile cLogFile; +// bFileStatus = cLogFile.Open(_T("ParserLog.txt"), CFile::modeCreate | CFile::modeWrite| CFile::typeText, &cfeOpenError ); +// if (!bFileStatus) +// { +// return SSI_STATUS_ERROR; +// } +// +// long lStart=0; +// CString csValue; +// +// while (cCalFile.ReadString(csLine)) +// { +// if (csLine.Left(1) != _T("#")) // comment line +// { +// csLine.Replace(_T("="),_T(" ")); +// csLine.Replace(_T(":"),_T(" ")); +// if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_10))>-1) +// { +// Z_POS_KEEP_PARAM_10 = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_10.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_11))>-1) +// { +// Z_POS_KEEP_PARAM_11 = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_11.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_12))>-1) +// { +// Z_POS_KEEP_PARAM_12 = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_12.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ROTARY_SLOW_VELOCITY))>-1) { +// ROTARY_SLOW_VELOCITY = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_SLOW_VELOCITY.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ROTARY_MEDIUM_VELOCITY))>-1) { +// ROTARY_MEDIUM_VELOCITY = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_MEDIUM_VELOCITY.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ROTARY_FAST_VELOCITY))>-1) { +// ROTARY_FAST_VELOCITY = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_FAST_VELOCITY.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KP))>-1) { +// PRIMARY_ROTARY_SERVO_KP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KP.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KI))>-1) { +// PRIMARY_ROTARY_SERVO_KI = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KI.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KIC))>-1) { +// PRIMARY_ROTARY_SERVO_KIC = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KIC.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KDD))>-1) { +// PRIMARY_ROTARY_SERVO_KDD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KDD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_IL))>-1) { +// PRIMARY_ROTARY_SERVO_IL = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_IL.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KSP))>-1) { +// PRIMARY_ROTARY_SERVO_KSP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KSP.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KSD))>-1) { +// PRIMARY_ROTARY_SERVO_KSD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KSD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_XCESS_PERR))>-1) { +// PRIMARY_ROTARY_XCESS_PERR = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_XCESS_PERR.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_TRAJECTORY_FILTER))>-1) { +// PRIMARY_ROTARY_TRAJECTORY_FILTER = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_TRAJECTORY_FILTER.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KP))>-1) { +// SECONDARY_ROTARY_SERVO_KP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KP.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KI))>-1) { +// SECONDARY_ROTARY_SERVO_KI = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KI.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KIC))>-1) { +// SECONDARY_ROTARY_SERVO_KIC = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KIC.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KDD))>-1) { +// SECONDARY_ROTARY_SERVO_KDD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KDD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_IL))>-1) { +// SECONDARY_ROTARY_SERVO_IL = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_IL.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KSP))>-1) { +// SECONDARY_ROTARY_SERVO_KSP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KSP.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KSD))>-1) { +// SECONDARY_ROTARY_SERVO_KSD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KSD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_XCESS_PERR))>-1) { +// SECONDARY_ROTARY_XCESS_PERR = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_XCESS_PERR.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_TRAJECTORY_FILTER))>-1) { +// SECONDARY_ROTARY_TRAJECTORY_FILTER = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_TRAJECTORY_FILTER.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_BREAK_THRESHOLD))>-1) { +// X_BREAK_THRESHOLD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_BREAK_THRESHOLD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_BREAK_THRESHOLD))>-1) { +// Y_BREAK_THRESHOLD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_BREAK_THRESHOLD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_BREAK_THRESHOLD))>-1) { +// Z_BREAK_THRESHOLD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_BREAK_THRESHOLD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ZM_BREAK_THRESHOLD))>-1) { +// ZM_BREAK_THRESHOLD = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ZM_BREAK_THRESHOLD.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_BREAK_TICKS))>-1) { +// X_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_BREAK_TICKS.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_BREAK_TICKS))>-1) { +// Y_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_BREAK_TICKS.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_BREAK_TICKS))>-1) { +// Z_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_BREAK_TICKS.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ZM_BREAK_TICKS))>-1) { +// ZM_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ZM_BREAK_TICKS.GetLength()))); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_JS_X_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_JS_X_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_JS_X_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_JS_X_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_JS_X_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_JS_X_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_JS_X_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_JS_X_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_JS_Y_SERVO_SWAP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_SWAP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_JS_Y_SERVO_SWAP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_TB_Y_SERVO_SWAP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_SWAP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_TB_Y_SERVO_SWAP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_ACC))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_ACC.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_ACC = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_ACC))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_ACC.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_ACC = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_ACC))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_ACC.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_ACC = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_ACC))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_ACC.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_ACC = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_KP = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KI))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KI.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_KI = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_KD = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_SERVO_IL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_IL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_SERVO_IL = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_MAX_ZOOM_COUNTS))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_MAX_ZOOM_COUNTS.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_MAX_ZOOM_COUNTS = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Zoom_Lens_Magnification_Calibration_Table))>-1) +// { +// ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_Zoom_Lens_Magnification_Calibration_Table.GetLength())), +// _T(" "), 100, m_EEPROM.ConfigData.e_Zoom_Lens_Magnification_Calibration_Table); +// goto bottom; +// } +// if (((lStart = csLine.Find(cs_X_SCALE_FACTOR))>-1) && (csLine.Find(cs_SECOND_X_SCALE_FACTOR) == -1)) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_X_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if (((lStart = csLine.Find(cs_Y_SCALE_FACTOR))>-1) && (csLine.Find(cs_SECOND_Y_SCALE_FACTOR) == -1) +// && (csLine.Find(cs_XY_SCALE_FACTOR) == -1)) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Y_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECOND_X_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_SECOND_X_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECOND_Y_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_SECOND_Y_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_SECOND_Z_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_SECOND_Z_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if (((lStart = csLine.Find(cs_Z_SCALE_FACTOR))>-1) && (csLine.Find(cs_XZ_SCALE_FACTOR) == -1) +// && (csLine.Find(cs_YZ_SCALE_FACTOR) == -1) && (csLine.Find(cs_SECOND_Z_SCALE_FACTOR) == -1)) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Z_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_XY_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_XY_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_XY_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_XZ_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_XZ_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_XZ_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_YZ_SCALE_FACTOR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_YZ_SCALE_FACTOR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_YZ_SCALE_FACTOR = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_LOW_FOV_INCHES))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_LOW_FOV_INCHES.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_X_LOW_FOV_INCHES = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_HIGH_FOV_INCHES))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_HIGH_FOV_INCHES.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_X_HIGH_FOV_INCHES = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_LOW_FOV_INCHES))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_LOW_FOV_INCHES.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Y_LOW_FOV_INCHES = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_HIGH_FOV_INCHES))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_HIGH_FOV_INCHES.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Y_HIGH_FOV_INCHES = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_CONTRAST_THRESHOLD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_CONTRAST_THRESHOLD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_CONTRAST_THRESHOLD = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_X_OFFSET))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_X_OFFSET.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_X_OFFSET = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_Y_OFFSET))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_Y_OFFSET.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_Y_OFFSET = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_IS_CALIBRATED))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_IS_CALIBRATED.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_IS_CALIBRATED = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_AUTO_FOV))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_AUTO_FOV.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_AUTO_FOV = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_RELATIVE_MAG))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RELATIVE_MAG.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_RELATIVE_MAG = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_ZOOM_RATIO))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_ZOOM_RATIO.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_ZOOM_RATIO = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_FRAME_AVERAGES))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_FRAME_AVERAGES.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_FRAME_AVERAGES = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_AUTO_REMEASURE))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_AUTO_REMEASURE.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_AUTO_REMEASURE = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_EDGE_TARGET_SIZE))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_TARGET_SIZE.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_EDGE_TARGET_SIZE = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_OPTICS_TUBE))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OPTICS_TUBE.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_OPTICS_TUBE = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_OPTICS_LENS))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OPTICS_LENS.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_OPTICS_LENS = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_STAGE_TRAVEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_STAGE_TRAVEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_X_STAGE_TRAVEL = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_STAGE_TRAVEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_STAGE_TRAVEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Y_STAGE_TRAVEL = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_STAGE_TRAVEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_STAGE_TRAVEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Z_STAGE_TRAVEL = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_BACK_LIGHT_OFFSET))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_BACK_LIGHT_OFFSET.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_BACK_LIGHT_OFFSET = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_RING_LIGHT_OFFSET))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_RING_LIGHT_OFFSET.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_RING_LIGHT_OFFSET = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AUX_LIGHT_OFFSET))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AUX_LIGHT_OFFSET.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AUX_LIGHT_OFFSET = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_SERVO_PRE_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SERVO_PRE_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_SERVO_PRE_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_SERVO_PRE_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SERVO_PRE_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_SERVO_PRE_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_SERVO_PRE_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SERVO_PRE_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_SERVO_PRE_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ZM_SERVO_PRE_VEL))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ZM_SERVO_PRE_VEL.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_ZM_SERVO_PRE_VEL = _tstol(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_X_SERVO_XCESS_PERR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SERVO_XCESS_PERR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_X_SERVO_XCESS_PERR = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_SERVO_XCESS_PERR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SERVO_XCESS_PERR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Y_SERVO_XCESS_PERR = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Z_SERVO_XCESS_PERR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SERVO_XCESS_PERR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_Z_SERVO_XCESS_PERR = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_ZM_SERVO_XCESS_PERR))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ZM_SERVO_XCESS_PERR.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_ZM_SERVO_XCESS_PERR = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_X_POS_WIN))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_POS_WIN.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_X_POS_WIN = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Y_POS_WIN))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_POS_WIN.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Y_POS_WIN = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_Z_POS_WIN))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_POS_WIN.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_Z_POS_WIN = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_AG_ZM_POS_WIN))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_POS_WIN.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// m_EEPROM.ConfigData.e_AG_ZM_POS_WIN = _tstoi(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSD))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSD.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// Y_POS_KEEP_KSD = _tstof(csValue); +// goto bottom; +// } +// if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSP))>-1) +// { +// csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSP.GetLength())); +// csValue.Replace(_T(":"), _T(" ")); +// Y_POS_KEEP_KSP = _tstof(csValue); +// goto bottom; +// } +// { +// // if here then no parsed cfg label +// CString msg; +// msg.Format(_T("No laser cfg parse: %s \n"), csLine); +// cLogFile.WriteString(msg); +// } +//bottom:; +// goto finish; +//finish:; +// } +// } +// +// cLogFile.Close(); +// } +// } +// cCalFile.Close(); + return SSI_STATUS_NORMAL; +} + +//=================================================================================== +// Find the Lens type and +// Build the file name based on the result. +// +int CSSIData::Read_EEPROM_From_File( eFILEWRITEMODE eMode, CString FileName) +{ +// FILE * pFile = NULL; + CStdioFile cCalFile; + BOOL bFileStatus = FALSE; + CFileException cfeOpenError; + bFileStatus = cCalFile.Open(FileName, CFile::modeRead|CFile::typeText, &cfeOpenError ); + if (!bFileStatus) + { + return SSI_STATUS_ERROR; + } + + CString csLine; + + switch (eMode) + { + case eHEXMODE: + { + CString resToken; + int curPos= 0; + int ii=0; + + cCalFile.ReadString(csLine); + resToken= csLine.Tokenize(_T(" "),curPos); + while (resToken != "" && ii <= EEPROMBYTES) + { + printf("Resulting token: %s\n", resToken); + _stscanf(resToken, _T("%x"), &(m_EEPROM.EEPROM_Bytes[ii++])); + resToken= csLine.Tokenize(_T(" "),curPos); + } + break; + } + case eCFGTEXTMODE: + { + CStdioFile cLogFile; + bFileStatus = cLogFile.Open(_T("ParserLog.txt"), CFile::modeCreate | CFile::modeWrite| CFile::typeText, &cfeOpenError ); + if (!bFileStatus) + { + return SSI_STATUS_ERROR; + } + + long lStart=0; + CString csValue; + + while (cCalFile.ReadString(csLine)) + { + if (csLine.Left(1) != _T("#")) // comment line + { + csLine.Replace(_T("="),_T(" ")); + csLine.Replace(_T(":"),_T(" ")); + /////////////////////////////////////////////////////////////// + /// non EEPROM params /// + /////////////////////////////////////////////////////////////// + //if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_X))>-1) + //{ + // EDGE_RETRY_TIMEOUT_X = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_X.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_Y))>-1) + //{ + // EDGE_RETRY_TIMEOUT_Y = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_Y.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_Z))>-1) + //{ + // EDGE_RETRY_TIMEOUT_Z = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_Z.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_MAG))>-1) + //{ + // EDGE_RETRY_TIMEOUT_MAG = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_MAG.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_X))>-1) + //{ + // EDGE_RETRY_BANDWIDTH_X = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_X.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_Y))>-1) + //{ + // EDGE_RETRY_BANDWIDTH_Y = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_Y.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_Z))>-1) + //{ + // EDGE_RETRY_BANDWIDTH_Z = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_Z.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_MAG))>-1) + //{ + // EDGE_RETRY_BANDWIDTH_MAG = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_MAG.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_X))>-1) + //{ + // EDGE_RETRY_COUNT_X = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_X.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_Y))>-1) + //{ + // EDGE_RETRY_COUNT_Y = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_Y.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_Z))>-1) + //{ + // EDGE_RETRY_COUNT_Z = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_Z.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_MAG))>-1) + //{ + // EDGE_RETRY_COUNT_MAG = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_MAG.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_MM_XY_PIXEL_MOTION_TOLERANCE))>-1) + //{ + // MM_XY_PIXEL_MOTION_TOLERANCE = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_MM_XY_PIXEL_MOTION_TOLERANCE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_MM_Z_INCH_MOTION_TOLERANCE))>-1) + //{ + // MM_Z_INCH_MOTION_TOLERANCE = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_MM_Z_INCH_MOTION_TOLERANCE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE))>-1) + //{ + // MM_ZOOM_PERCENT_MOTION_TOLERANCE = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_LIGHT_SETTLE_TIME))>-1) + //{ + // LIGHT_SETTLE_TIME = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_LIGHT_SETTLE_TIME.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_BACK_LIGHT_MAPPING))>-1) + //{ + // BACK_LIGHT_MAPPING = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_BACK_LIGHT_MAPPING.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_RING_LIGHT_MAPPING))>-1) + //{ + // RING_LIGHT_MAPPING = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_RING_LIGHT_MAPPING.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_AUX_LIGHT_MAPPING))>-1) + //{ + // AUX_LIGHT_MAPPING = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_AUX_LIGHT_MAPPING.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_GRID_LIGHT_MAPPING))>-1) + //{ + // GRID_LIGHT_MAPPING = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_GRID_LIGHT_MAPPING.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_ROTARY_AZIMUTH_RADIANS))>-1) + //{ + // ROTARY_AZIMUTH_RADIANS = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_AZIMUTH_RADIANS.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_RING_KNOB_TO_LED_RING))>-1) + //{ + // RING_KNOB_TO_LED_RING = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_RING_KNOB_TO_LED_RING.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_WATT_WATCHER_TIMEOUT))>-1) + //{ + // WATT_WATCHER_TIMEOUT = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_WATT_WATCHER_TIMEOUT.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_LASER_PRESENT))>-1) + //{ + // LASER_PRESENT = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_LASER_PRESENT.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_TP_DO_ARC_MOTION))>-1) + //{ + // TP_DO_ARC_MOTION = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_TP_DO_ARC_MOTION.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_PARAMS_ENABLE))>-1) + //{ + // X_POS_KEEP_PARAMS_ENABLE = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_PARAMS_ENABLE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KP))>-1) + //{ + // X_POS_KEEP_KP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KP.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KI))>-1) + //{ + // X_POS_KEEP_KI = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KI.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KD))>-1) + //{ + // X_POS_KEEP_KD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_IL))>-1) + //{ + // X_POS_KEEP_IL = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_IL.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KDD))>-1) + //{ + // X_POS_KEEP_KDD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KDD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KSD))>-1) + //{ + // X_POS_KEEP_KSD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KSD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KSP))>-1) + //{ + // X_POS_KEEP_KSP = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KSP.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KPF))>-1) + //{ + // X_POS_KEEP_KPF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KPF.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_KIF))>-1) + //{ + // X_POS_KEEP_KIF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KIF.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_PARAMS_ENABLE))>-1) + //{ + // Y_POS_KEEP_PARAMS_ENABLE = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_PARAMS_ENABLE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KP))>-1) + //{ + // Y_POS_KEEP_KP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KP.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KI))>-1) + //{ + // Y_POS_KEEP_KI = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KI.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KD))>-1) + //{ + // Y_POS_KEEP_KD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_IL))>-1) + //{ + // Y_POS_KEEP_IL = _tstol(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_IL.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KDD))>-1) + //{ + // Y_POS_KEEP_KDD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KDD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSD))>-1) + //{ + // Y_POS_KEEP_KSD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSP))>-1) + //{ + // Y_POS_KEEP_KSP = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSP.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KPF))>-1) + //{ + // Y_POS_KEEP_KPF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KPF.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_KIF))>-1) + //{ + // Y_POS_KEEP_KIF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KIF.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAMS_ENABLE))>-1) + //{ + // Z_POS_KEEP_PARAMS_ENABLE = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAMS_ENABLE.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KP))>-1) + //{ + // Z_POS_KEEP_KP = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KP.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KI))>-1) + //{ + // Z_POS_KEEP_KI = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KI.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KD))>-1) + //{ + // Z_POS_KEEP_KD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_IL))>-1) + //{ + // Z_POS_KEEP_IL = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_IL.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KDD))>-1) + //{ + // Z_POS_KEEP_KDD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KDD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KSD))>-1) + //{ + // Z_POS_KEEP_KSD = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KSD.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KSP))>-1) + //{ + // Z_POS_KEEP_KSP = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KSP.GetLength()))); + // goto bottom; + //} + if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_10))>-1) + { + Z_POS_KEEP_PARAM_10 = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_10.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_11))>-1) + { + Z_POS_KEEP_PARAM_11 = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_11.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAM_12))>-1) + { + Z_POS_KEEP_PARAM_12 = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAM_12.GetLength()))); + goto bottom; + } + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KPF))>-1) + //{ + // Z_POS_KEEP_KPF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KPF.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_KIF))>-1) + //{ + // Z_POS_KEEP_KIF = _tstof(csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KIF.GetLength()))); + // goto bottom; + //} + if ((lStart = csLine.Find(cs_ROTARY_SLOW_VELOCITY))>-1) { + ROTARY_SLOW_VELOCITY = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_SLOW_VELOCITY.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_ROTARY_MEDIUM_VELOCITY))>-1) { + ROTARY_MEDIUM_VELOCITY = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_MEDIUM_VELOCITY.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_ROTARY_FAST_VELOCITY))>-1) { + ROTARY_FAST_VELOCITY = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_FAST_VELOCITY.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KP))>-1) { + PRIMARY_ROTARY_SERVO_KP = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KP.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KI))>-1) { + PRIMARY_ROTARY_SERVO_KI = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KI.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KIC))>-1) { + PRIMARY_ROTARY_SERVO_KIC = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KIC.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KDD))>-1) { + PRIMARY_ROTARY_SERVO_KDD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KDD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_IL))>-1) { + PRIMARY_ROTARY_SERVO_IL = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_IL.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KSP))>-1) { + PRIMARY_ROTARY_SERVO_KSP = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KSP.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_SERVO_KSD))>-1) { + PRIMARY_ROTARY_SERVO_KSD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_SERVO_KSD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_XCESS_PERR))>-1) { + PRIMARY_ROTARY_XCESS_PERR = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_XCESS_PERR.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_PRIMARY_ROTARY_TRAJECTORY_FILTER))>-1) { + PRIMARY_ROTARY_TRAJECTORY_FILTER = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_PRIMARY_ROTARY_TRAJECTORY_FILTER.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KP))>-1) { + SECONDARY_ROTARY_SERVO_KP = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KP.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KI))>-1) { + SECONDARY_ROTARY_SERVO_KI = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KI.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KIC))>-1) { + SECONDARY_ROTARY_SERVO_KIC = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KIC.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KDD))>-1) { + SECONDARY_ROTARY_SERVO_KDD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KDD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_IL))>-1) { + SECONDARY_ROTARY_SERVO_IL = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_IL.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KSP))>-1) { + SECONDARY_ROTARY_SERVO_KSP = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KSP.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_SERVO_KSD))>-1) { + SECONDARY_ROTARY_SERVO_KSD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_SERVO_KSD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_XCESS_PERR))>-1) { + SECONDARY_ROTARY_XCESS_PERR = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_XCESS_PERR.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECONDARY_ROTARY_TRAJECTORY_FILTER))>-1) { + SECONDARY_ROTARY_TRAJECTORY_FILTER = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_SECONDARY_ROTARY_TRAJECTORY_FILTER.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_BREAK_THRESHOLD))>-1) { + X_BREAK_THRESHOLD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_BREAK_THRESHOLD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_BREAK_THRESHOLD))>-1) { + Y_BREAK_THRESHOLD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_BREAK_THRESHOLD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_BREAK_THRESHOLD))>-1) { + Z_BREAK_THRESHOLD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_BREAK_THRESHOLD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_ZM_BREAK_THRESHOLD))>-1) { + ZM_BREAK_THRESHOLD = (USHORT)_tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ZM_BREAK_THRESHOLD.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_BREAK_TICKS))>-1) { + X_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_X_BREAK_TICKS.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_BREAK_TICKS))>-1) { + Y_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Y_BREAK_TICKS.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_BREAK_TICKS))>-1) { + Z_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_Z_BREAK_TICKS.GetLength()))); + goto bottom; + } + if ((lStart = csLine.Find(cs_ZM_BREAK_TICKS))>-1) { + ZM_BREAK_TICKS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_ZM_BREAK_TICKS.GetLength()))); + goto bottom; + } + //if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_X))>-1) { + // m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_X = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_X.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_Y))>-1) { + // m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Y = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_Y.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_Z))>-1) { + // m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Z = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_Z.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_ZM))>-1) { + // m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_ZM = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_ZM.GetLength()))); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_OPTICS_LENS))>-1) { + // m_EEPROM.ConfigData.e_OPTICS_LENS = _tstoi(csLine.Right(csLine.GetLength() - (lStart + cs_OPTICS_LENS.GetLength()))); + // goto bottom; + //} + + + csLine.Replace(_T("="),_T(" ")); + if ((lStart = csLine.Find(cs_X_Non_linear_Correction_table))>-1) + { + ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_X_Non_linear_Correction_table.GetLength())), + _T(" "), 25, m_EEPROM.ConfigData.e_X_Non_linear_Correction_table); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_Non_linear_Correction_table))>-1) + { + ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_X_Non_linear_Correction_table.GetLength())), + _T(" "), 25, m_EEPROM.ConfigData.e_Y_Non_linear_Correction_table); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_Deviation_table))>-1) + { + ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_X_Deviation_table.GetLength())), + _T(" "), 25, m_EEPROM.ConfigData.e_X_Deviation_table); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_Deviation_table))>-1) + { + ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_Y_Deviation_table.GetLength())), + _T(" "), 25, m_EEPROM.ConfigData.e_Y_Deviation_table); + goto bottom; + } + + //========================================================================================================= + // Merged code from V1 to V3. The commented out lines above have dupes below + //========================================================================================================= + + if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_X))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_X.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_X = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_Y))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_Y.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Y = _tstol(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_JS_MAX_VELOCITY_Z))>-1)&& (csLine.Find(cs_JS_MAX_VELOCITY_ZM)==-1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_Z.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Z = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_MAX_VELOCITY_ZM))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_MAX_VELOCITY_ZM.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_ZM = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_MAX_ZOOM_COUNTS))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_MAX_ZOOM_COUNTS.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_MAX_ZOOM_COUNTS = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Zoom_Lens_Magnification_Calibration_Table))>-1) + { + ParseLineArrayData(csLine.Right(csLine.GetLength() - (lStart + cs_Zoom_Lens_Magnification_Calibration_Table.GetLength())), + _T(" "), 100, m_EEPROM.ConfigData.e_Zoom_Lens_Magnification_Calibration_Table); + goto bottom; + } + if (((lStart = csLine.Find(cs_X_SCALE_FACTOR))>-1) && (csLine.Find(cs_SECOND_X_SCALE_FACTOR) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_Y_SCALE_FACTOR))>-1) && (csLine.Find(cs_SECOND_Y_SCALE_FACTOR) == -1) + && (csLine.Find(cs_XY_SCALE_FACTOR) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_X_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_X_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_Y_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_Y_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_Z_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_Z_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_Z_SCALE_FACTOR))>-1) && (csLine.Find(cs_XZ_SCALE_FACTOR) == -1) + && (csLine.Find(cs_YZ_SCALE_FACTOR) == -1) && (csLine.Find(cs_SECOND_Z_SCALE_FACTOR) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Z_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_XY_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_XY_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_XY_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_XZ_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_XZ_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_XZ_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_YZ_SCALE_FACTOR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_YZ_SCALE_FACTOR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_YZ_SCALE_FACTOR = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_LOW_FOV_INCHES))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_LOW_FOV_INCHES.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_LOW_FOV_INCHES = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_HIGH_FOV_INCHES))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_HIGH_FOV_INCHES.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_HIGH_FOV_INCHES = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_LOW_FOV_INCHES))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_LOW_FOV_INCHES.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_LOW_FOV_INCHES = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_HIGH_FOV_INCHES))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_HIGH_FOV_INCHES.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_HIGH_FOV_INCHES = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_CONTRAST_THRESHOLD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_CONTRAST_THRESHOLD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_CONTRAST_THRESHOLD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_X_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_X_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_X_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_Y_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_Y_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_Y_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_IS_CALIBRATED))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_IS_CALIBRATED.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_IS_CALIBRATED = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_AUTO_FOV))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_AUTO_FOV.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_AUTO_FOV = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RELATIVE_MAG))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RELATIVE_MAG.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_RELATIVE_MAG = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_ZOOM_RATIO))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_ZOOM_RATIO.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_ZOOM_RATIO = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_FRAME_AVERAGES))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_FRAME_AVERAGES.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_FRAME_AVERAGES = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_AUTO_REMEASURE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_AUTO_REMEASURE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_AUTO_REMEASURE = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_TARGET_SIZE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_TARGET_SIZE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_EDGE_TARGET_SIZE = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_OPTICS_TUBE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OPTICS_TUBE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_OPTICS_TUBE = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_OPTICS_LENS))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OPTICS_LENS.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_OPTICS_LENS = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_STAGE_TRAVEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_STAGE_TRAVEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_STAGE_TRAVEL = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_STAGE_TRAVEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_STAGE_TRAVEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_STAGE_TRAVEL = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_STAGE_TRAVEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_STAGE_TRAVEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Z_STAGE_TRAVEL = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_BACK_LIGHT_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_BACK_LIGHT_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_BACK_LIGHT_OFFSET = (BYTE)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_RING_LIGHT_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_RING_LIGHT_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_RING_LIGHT_OFFSET = (BYTE)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AUX_LIGHT_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AUX_LIGHT_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AUX_LIGHT_OFFSET = (BYTE)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_SERVO_PRE_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SERVO_PRE_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_PRE_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_SERVO_PRE_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SERVO_PRE_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_PRE_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_SERVO_PRE_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SERVO_PRE_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_PRE_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_ZM_SERVO_PRE_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ZM_SERVO_PRE_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_ZM_SERVO_PRE_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_SERVO_XCESS_PERR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SERVO_XCESS_PERR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_SERVO_XCESS_PERR = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_SERVO_XCESS_PERR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SERVO_XCESS_PERR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_SERVO_XCESS_PERR = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_SERVO_XCESS_PERR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SERVO_XCESS_PERR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Z_SERVO_XCESS_PERR = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_ZM_SERVO_XCESS_PERR))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ZM_SERVO_XCESS_PERR.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_ZM_SERVO_XCESS_PERR = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_POS_WIN))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_POS_WIN.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_POS_WIN = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_POS_WIN))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_POS_WIN.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_POS_WIN = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_POS_WIN))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_POS_WIN.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_POS_WIN = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_POS_WIN))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_POS_WIN.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_POS_WIN = (short)_tstoi(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_X_SCALE_SWAP))>-1) && (csLine.Find(cs_SECOND_X_SCALE_SWAP) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_SCALE_SWAP = (short)_tstoi(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_Y_SCALE_SWAP))>-1) && (csLine.Find(cs_SECOND_Y_SCALE_SWAP) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_SCALE_SWAP = (short)_tstoi(csValue); + goto bottom; + } + if (((lStart = csLine.Find(cs_Z_SCALE_SWAP))>-1) && (csLine.Find(cs_SECOND_Z_SCALE_SWAP) == -1)) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Z_SCALE_SWAP = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_X_SCALE_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_X_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_X_SCALE_SWAP = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_Y_SCALE_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Y_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_Y_SCALE_SWAP = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_SECOND_Z_SCALE_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_SECOND_Z_SCALE_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_SECOND_Z_SCALE_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_USE_SECOND_X_SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_USE_SECOND_X_SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_USE_SECOND_X_SCALE = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_USE_SECOND_Y_SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_USE_SECOND_Y_SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_USE_SECOND_Y_SCALE = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_OFFSET_X_LIMIT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OFFSET_X_LIMIT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_OFFSET_X_LIMIT = _tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_OFFSET_Y_LIMIT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OFFSET_Y_LIMIT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_OFFSET_Y_LIMIT = _tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_OFFSET_Z_LIMIT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_OFFSET_Z_LIMIT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_OFFSET_Z_LIMIT = _tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_FORCE_STAGE_INIT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_FORCE_STAGE_INIT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_FORCE_STAGE_INIT = (short)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_NEG_PRELIM))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_NEG_PRELIM.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_NEG_PRELIM = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_ZM_POS_PRELIM))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_ZM_POS_PRELIM.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_ZM_POS_PRELIM = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_NEG_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_NEG_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_NEG_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_NEG_PRELIM))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_NEG_PRELIM.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_NEG_PRELIM = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_POS_PRELIM_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_POS_PRELIM_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_POS_PRELIM_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_POS_PRELIM))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_POS_PRELIM.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_POS_PRELIM = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_MIN_MOVE_TIME))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_MIN_MOVE_TIME.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_MIN_MOVE_TIME = _tstof(csValue); + goto bottom; + } + /////////////////////////////////////////////////////////////// + /// 2000 EEPROM params /// + /////////////////////////////////////////////////////////////// + if ((lStart = csLine.Find(cs_JS_X_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_X_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_X_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_X_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Y_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Y_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Y_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_JS_Z_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_JS_Z_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_JS_Z_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_X_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_X_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_X_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TB_Y_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TB_Y_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TB_Y_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_ACC))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_ACC.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_ACC = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_VEL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_VEL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_VEL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_X_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_X_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_X_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Y_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Y_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KI = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_IL = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KDD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KSD = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_AFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_AFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_AFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_VFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_VFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_VFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_AP_Z_SERVO_PID_SWAP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_AP_Z_SERVO_PID_SWAP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_PID_SWAP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_INDEX_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_INDEX_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_X_INDEX_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_INDEX_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_INDEX_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Y_INDEX_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_INDEX_OFFSET))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_INDEX_OFFSET.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_Z_INDEX_OFFSET = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_USE_INDEX_PULSE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_USE_INDEX_PULSE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_USE_INDEX_PULSE = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_ROLLOFF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_ROLLOFF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_ROLLOFF = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_KSP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_KSP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_KSP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_KSP = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_X_SHAFT2SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_X_SHAFT2SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_X_SHAFT2SCALE = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Y_SHAFT2SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Y_SHAFT2SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Y_SHAFT2SCALE = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_Z_SHAFT2SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_Z_SHAFT2SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_Z_SHAFT2SCALE = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AG_ZM_SHAFT2SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AG_ZM_SHAFT2SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_AG_ZM_SHAFT2SCALE = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_USE_SECOND_Z_SCALE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_USE_SECOND_Z_SCALE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_USE_SECOND_Z_SCALE = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_PAN_VIDEO_X))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_PAN_VIDEO_X.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_PAN_VIDEO_X = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_PAN_VIDEO_Y))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_PAN_VIDEO_Y.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_PAN_VIDEO_Y = (USHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_ILL_LENS))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ILL_LENS.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_ILL_LENS = (USHORT)_tstoi(csValue); + goto bottom; + } + /////////////////////////////////////////////////////////////// + /// non EEPROM params /// + /////////////////////////////////////////////////////////////// + if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_X))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_X.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_TIMEOUT_X = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_Y))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_Y.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_TIMEOUT_Y = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_Z))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_Z.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_TIMEOUT_Z = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_TIMEOUT_MAG))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_TIMEOUT_MAG.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_TIMEOUT_MAG = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_X))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_X.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_BANDWIDTH_X = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_Y))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_Y.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_BANDWIDTH_Y = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_Z))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_Z.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_BANDWIDTH_Z = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_BANDWIDTH_MAG))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_BANDWIDTH_MAG.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_BANDWIDTH_MAG = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_X))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_X.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_COUNT_X = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_Y))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_Y.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_COUNT_Y = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_Z))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_Z.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_COUNT_Z = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_EDGE_RETRY_COUNT_MAG))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_EDGE_RETRY_COUNT_MAG.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + EDGE_RETRY_COUNT_MAG = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_MM_XY_PIXEL_MOTION_TOLERANCE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_MM_XY_PIXEL_MOTION_TOLERANCE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + MM_XY_PIXEL_MOTION_TOLERANCE = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_MM_Z_INCH_MOTION_TOLERANCE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_MM_Z_INCH_MOTION_TOLERANCE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + MM_Z_INCH_MOTION_TOLERANCE = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + MM_ZOOM_PERCENT_MOTION_TOLERANCE = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_LIGHT_SETTLE_TIME))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_LIGHT_SETTLE_TIME.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + LIGHT_SETTLE_TIME = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_BACK_LIGHT_MAPPING))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_BACK_LIGHT_MAPPING.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + BACK_LIGHT_MAPPING = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_RING_LIGHT_MAPPING))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_RING_LIGHT_MAPPING.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + RING_LIGHT_MAPPING = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_AUX_LIGHT_MAPPING))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_AUX_LIGHT_MAPPING.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + AUX_LIGHT_MAPPING = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_GRID_LIGHT_MAPPING))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_GRID_LIGHT_MAPPING.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + GRID_LIGHT_MAPPING = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_ROTARY_AZIMUTH_RADIANS))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_ROTARY_AZIMUTH_RADIANS.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + ROTARY_AZIMUTH_RADIANS = _tstol(csValue); + goto bottom; + } + + if ((lStart = csLine.Find(cs_RING_KNOB_TO_LED_RING))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_RING_KNOB_TO_LED_RING.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + RING_KNOB_TO_LED_RING = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_WATT_WATCHER_TIMEOUT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_WATT_WATCHER_TIMEOUT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + WATT_WATCHER_TIMEOUT = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_LASER_PRESENT))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_LASER_PRESENT.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + LASER_PRESENT = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_TP_DO_ARC_MOTION))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_TP_DO_ARC_MOTION.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + TP_DO_ARC_MOTION = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_DOCKABLE_TOUCH_PROBE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_DOCKABLE_TOUCH_PROBE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + m_EEPROM.ConfigData.e_DOCKABLE_TOUCH_PROBE = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_PARAMS_ENABLE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_PARAMS_ENABLE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_PARAMS_ENABLE = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KP = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KI = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_IL = (unsigned short)_tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KDD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KSD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KSP = _tstof(csValue); + goto bottom; + } + //if ((lStart = csLine.Find(cs_X_POS_KEEP_UNK1))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_UNK1.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // X_POS_KEEP_UNK1 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_UNK2))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_UNK2.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // X_POS_KEEP_UNK2 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_X_POS_KEEP_UNK3))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_UNK3.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // X_POS_KEEP_UNK3 = _tstoi(csValue); + // goto bottom; + //} + if ((lStart = csLine.Find(cs_X_POS_KEEP_KPF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KPF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KPF = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_X_POS_KEEP_KIF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_X_POS_KEEP_KIF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + X_POS_KEEP_KIF = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_PARAMS_ENABLE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_PARAMS_ENABLE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_PARAMS_ENABLE = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KP = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KI = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_IL = _tstol(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KDD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KSD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KSP = _tstof(csValue); + goto bottom; + } + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_UNK1))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_UNK1.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Y_POS_KEEP_UNK1 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_UNK2))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_UNK2.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Y_POS_KEEP_UNK2 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Y_POS_KEEP_UNK3))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_UNK3.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Y_POS_KEEP_UNK3 = _tstoi(csValue); + // goto bottom; + //} + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KPF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KPF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KPF = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Y_POS_KEEP_KIF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Y_POS_KEEP_KIF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Y_POS_KEEP_KIF = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_PARAMS_ENABLE))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_PARAMS_ENABLE.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_PARAMS_ENABLE = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KP = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KI))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KI.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KI = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_IL))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_IL.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_IL = (SHORT)_tstoi(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KDD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KDD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KDD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KSD))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KSD.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KSD = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KSP))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KSP.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KSP = _tstof(csValue); + goto bottom; + } + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_UNK1))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_UNK1.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Z_POS_KEEP_UNK1 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_UNK2))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_UNK2.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Z_POS_KEEP_UNK2 = _tstoi(csValue); + // goto bottom; + //} + //if ((lStart = csLine.Find(cs_Z_POS_KEEP_UNK3))>-1) + //{ + // csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_UNK3.GetLength())); + // csValue.Replace(_T(":"), _T(" ")); + // Z_POS_KEEP_UNK3 = _tstoi(csValue); + // goto bottom; + //} + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KPF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KPF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KPF = _tstof(csValue); + goto bottom; + } + if ((lStart = csLine.Find(cs_Z_POS_KEEP_KIF))>-1) + { + csValue = csLine.Right(csLine.GetLength() - (lStart + cs_Z_POS_KEEP_KIF.GetLength())); + csValue.Replace(_T(":"), _T(" ")); + Z_POS_KEEP_KIF = _tstof(csValue); + goto bottom; + } + + { + // if here then no parsed cfg label + CString msg; + msg.Format(_T("No cfg parse: %s \n"), csLine); + cLogFile.WriteString(msg); + } +bottom:; + goto finish; +finish:; + } + } + + cLogFile.Close(); + } + } + cCalFile.Close(); + return SSI_STATUS_NORMAL; +} + +// ============================================================== +int CSSIData::ParseLineArrayData(CString csDataStr, CString csTokenStr, long lMaxCnt, double *DataArray ) +{ + int nPos = 0; + int nCnt = 0; + CString csData; + csDataStr.Replace(_T(":"), _T(" ")); + csDataStr.TrimLeft(_T(" ")); + csData = csDataStr.Tokenize(csTokenStr, nPos); + while ((csData.GetLength() > 0) && (nCnt < lMaxCnt)) + { + DataArray[nCnt] = _tstof(csData); + ++nCnt; + csData = csDataStr.Tokenize(csTokenStr, nPos); + csData.TrimLeft(_T(" ")); + } + return SSI_STATUS_NORMAL; +} + +// ============================================================== +void CSSIData::Get_Cfg_Filename(CString &FileName) +{ + CString Path; + GetAppPath(Path); + FileName = Path + _T("\\hardware_PCDMIS.cfg"); +} + +// ============================================================== +void CSSIData::Get_Laser_Cfg_Filename(CString &FileName) +{ + CString Path; + GetAppPath(Path); + FileName = Path + _T("\\laser_PCDMIS.cfg"); +} + + +// ============================================================== +void CSSIData::Get_RegToFile_Cfg_Filename(CString &FileName) +{ + CString Path; + GetAppPath(Path); + FileName = Path + _T("\\hardware_PCDMIS_RegToFile.cfg"); +} + +// ============================================================== +int CSSIData::Write_EEPROM_To_File(eFILEWRITEMODE eMode, CString FileName) +{ + FILE * pOutFile = NULL; + if (!FileName.GetLength()) + return SSI_STATUS_ERROR; + + _tfopen_s(&pOutFile, FileName, _T("w")); + if (!pOutFile) + { + return SSI_STATUS_ERROR; + } + + switch (eMode) + { + case eHEXMODE: + { + for (int ii = 0 ; ii < EEPROMBYTES ; ++ii) + { + _ftprintf(pOutFile, _T(" %x "), m_EEPROM.EEPROM_Bytes[ii]); + } + fclose(pOutFile); + break; + } + case eCFGTEXTMODE: + { + int i; + _ftprintf(pOutFile, _T("%s "), _T("EEPROM Configuration Data: ")); + _ftprintf(pOutFile, _T("\n%s "), cs_SerialNo); + for (i=0;i<16;i++) + { + _ftprintf(pOutFile, _T(" %c"), m_EEPROM.ConfigData.e_SerialNo[i]); + }; + + _ftprintf(pOutFile, _T("\n%s "), cs_X_Non_linear_Correction_table); + for (i=0;i<25;i++) + { + _ftprintf(pOutFile, _T(" %f"), m_EEPROM.ConfigData.e_X_Non_linear_Correction_table[i]); + }; + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_Non_linear_Correction_table); + for (i=0;i<25;i++) + { + _ftprintf(pOutFile, _T(" %f"), m_EEPROM.ConfigData.e_Y_Non_linear_Correction_table[i]); + }; + + _ftprintf(pOutFile, _T("\n%s "), cs_X_Deviation_table); + for (i=0;i<25;i++) + { + _ftprintf(pOutFile, _T(" %f"), m_EEPROM.ConfigData.e_X_Deviation_table[i]); + }; + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_Deviation_table); + for (i=0;i<25;i++) + { + _ftprintf(pOutFile, _T(" %f"), m_EEPROM.ConfigData.e_Y_Deviation_table[i]); + }; + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_MAX_VELOCITY_X); // 681288 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_X); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_MAX_VELOCITY_Y); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Y); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_MAX_VELOCITY_Z); // 349524 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_Z); // 349524 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_MAX_VELOCITY_ZM); // 98304 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_JS_MAX_VELOCITY_ZM); + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_SWAP); // 1 + _ftprintf(pOutFile, _T("%i"), (short)m_EEPROM.ConfigData.e_JS_X_SERVO_SWAP); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_SWAP); // -1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_SWAP); // -1 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_SWAP); // -1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_SWAP); // -1 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_SERVO_SWAP); // -1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_ZM_SERVO_SWAP); // -1 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_SERVO_KP); // 100 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_ZM_SERVO_KP); // 100 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_ZM_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_ZM_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_ZM_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_ACC); // 50000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_ACC); // 50000 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_VEL); // 681288 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_KP); // 8 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_KP); // 8 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_SWAP); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_SWAP); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_ACC); // 50000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_ACC); // 50000 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_VEL); // 681288 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_KP); // 8 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_KP); // 8 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_SWAP); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_SWAP); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_ACC); // 50000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_ACC); // 50000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_VEL); // 681288 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_ACC); // 50000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_ACC); // 50000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_VEL); // 681288 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_ACC); // 160000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_ACC); // 160000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_VEL); // 349524 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_VEL); // 349524 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_KP); // 4 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KP); // 4 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_ACC); // 1524 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_ACC); // 1524 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_VEL); // 98304 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_VEL); // 98304 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_KP); // 100 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_KP); // 100 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_KI); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_KI); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_IL); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_IL); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_KD); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_KD); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_MAX_ZOOM_COUNTS); // 14477.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_MAX_ZOOM_COUNTS); // 14477.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_Zoom_Lens_Magnification_Calibration_Table); + for (i = 0; i< 101; i++) + _ftprintf(pOutFile, _T(" %f"), m_EEPROM.ConfigData.e_Zoom_Lens_Magnification_Calibration_Table[i]); + + _ftprintf(pOutFile, _T("\n%s "), cs_X_SCALE_FACTOR); // 0.000020 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_X_SCALE_FACTOR); // 0.000020 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_SCALE_FACTOR); // 0.000020 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_Y_SCALE_FACTOR); // 0.000020 + + _ftprintf(pOutFile, _T("\n%s "), cs_Z_SCALE_FACTOR); // 0.000020 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_Z_SCALE_FACTOR); // 0.000020 + + _ftprintf(pOutFile, _T("\n%s "), cs_XY_SCALE_FACTOR); // 0.000000 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_XY_SCALE_FACTOR); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_XZ_SCALE_FACTOR); // 0.000000 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_XZ_SCALE_FACTOR); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_YZ_SCALE_FACTOR); // 0.000000 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_YZ_SCALE_FACTOR); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_LOW_FOV_INCHES); // 0.536659 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_X_LOW_FOV_INCHES); // 0.536659 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_HIGH_FOV_INCHES); // 0.091453 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_X_HIGH_FOV_INCHES); // 0.091453 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_LOW_FOV_INCHES); // 0.542137 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Y_LOW_FOV_INCHES); // 0.542137 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_HIGH_FOV_INCHES); // 0.542137 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Y_HIGH_FOV_INCHES); // 0.542137 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_CONTRAST_THRESHOLD); // 1.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_EDGE_CONTRAST_THRESHOLD); // 1.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_X_OFFSET); // -7.500000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_EDGE_X_OFFSET); // -7.500000 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_Y_OFFSET); // -16.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_EDGE_Y_OFFSET); // -16.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_IS_CALIBRATED); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_EDGE_IS_CALIBRATED); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_AUTO_FOV); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_EDGE_AUTO_FOV); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RELATIVE_MAG); // 1.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_EDGE_RELATIVE_MAG); // 1.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_ZOOM_RATIO); // 6.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_EDGE_ZOOM_RATIO); // 6.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_FRAME_AVERAGES); // 2 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_EDGE_FRAME_AVERAGES); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_AUTO_REMEASURE); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_EDGE_AUTO_REMEASURE); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_TARGET_SIZE); // 30 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_EDGE_TARGET_SIZE); // 30 + + _ftprintf(pOutFile, _T("\n%s "), cs_OPTICS_TUBE); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_OPTICS_TUBE); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_OPTICS_LENS); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_OPTICS_LENS); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_STAGE_TRAVEL); // 8.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_X_STAGE_TRAVEL); // 8.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_STAGE_TRAVEL); // 6.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Y_STAGE_TRAVEL); // 6.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_Z_STAGE_TRAVEL); // 8.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Z_STAGE_TRAVEL); // 8.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_BACK_LIGHT_OFFSET); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_BACK_LIGHT_OFFSET); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_RING_LIGHT_OFFSET); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_RING_LIGHT_OFFSET); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AUX_LIGHT_OFFSET); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AUX_LIGHT_OFFSET); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_SERVO_PRE_VEL); // 681288 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_AG_X_SERVO_PRE_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_SERVO_PRE_VEL); // 681288 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_AG_Y_SERVO_PRE_VEL); // 681288 + + _ftprintf(pOutFile, _T("\n%s "), cs_Z_SERVO_PRE_VEL); // 349524 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_AG_Z_SERVO_PRE_VEL); // 349524 + + _ftprintf(pOutFile, _T("\n%s "), cs_ZM_SERVO_PRE_VEL); // 98304 + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_ZM_SERVO_PRE_VEL); // 98304 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_SERVO_XCESS_PERR); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_X_SERVO_XCESS_PERR); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_SERVO_XCESS_PERR); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_Y_SERVO_XCESS_PERR); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_Z_SERVO_XCESS_PERR); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_Z_SERVO_XCESS_PERR); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_ZM_SERVO_XCESS_PERR); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_ZM_SERVO_XCESS_PERR); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_POS_WIN); // 2 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_POS_WIN); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_POS_WIN); // 2 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_POS_WIN); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_POS_WIN); // 2 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_POS_WIN); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_POS_WIN); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_POS_WIN); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_X_SCALE_SWAP); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_X_SCALE_SWAP); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_Y_SCALE_SWAP); // -1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_Y_SCALE_SWAP); // -1 + + _ftprintf(pOutFile, _T("\n%s "), cs_Z_SCALE_SWAP); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_Z_SCALE_SWAP); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_X_SCALE_SWAP); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_SECOND_X_SCALE_SWAP); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_Y_SCALE_SWAP); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_SECOND_Y_SCALE_SWAP); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_Z_SCALE_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_SECOND_Z_SCALE_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_X_SCALE_FACTOR); // 0.000000 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_SECOND_X_SCALE_FACTOR); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_Y_SCALE_FACTOR); // 0.000000 + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_SECOND_Y_SCALE_FACTOR); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_SECOND_Z_SCALE_FACTOR); + _ftprintf(pOutFile, _T("%12.11f"), m_EEPROM.ConfigData.e_SECOND_Z_SCALE_FACTOR); + + _ftprintf(pOutFile, _T("\n%s "), cs_USE_SECOND_X_SCALE); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_USE_SECOND_X_SCALE); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_USE_SECOND_Y_SCALE); // 0 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_USE_SECOND_Y_SCALE); // 0 + + _ftprintf(pOutFile, _T("\n%s "), cs_USE_SECOND_Z_SCALE); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_USE_SECOND_Z_SCALE); + + _ftprintf(pOutFile, _T("\n%s "), cs_OFFSET_X_LIMIT); // 0.000000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_OFFSET_X_LIMIT); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_OFFSET_Y_LIMIT); // 0.000000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_OFFSET_Y_LIMIT); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_OFFSET_Z_LIMIT); // 0.000000 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_OFFSET_Z_LIMIT); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_FORCE_STAGE_INIT); // 1 + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_FORCE_STAGE_INIT); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_X_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_Y_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_Z_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_NEG_PRELIM); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_ZM_NEG_PRELIM); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_X_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_Y_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_Z_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_ZM_POS_PRELIM); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_JS_ZM_POS_PRELIM); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_X_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Y_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_NEG_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Z_NEG_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_NEG_PRELIM); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_ZM_NEG_PRELIM); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_X_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Y_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_POS_PRELIM_OFFSET); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Z_POS_PRELIM_OFFSET); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_POS_PRELIM); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_ZM_POS_PRELIM); // 0.000000 + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_MIN_MOVE_TIME); // 0.000000 + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_MIN_MOVE_TIME); // 0.000000 + + /////////////////////////////////////////////////////////////// + /// 2000 EEPROM params /// + /////////////////////////////////////////////////////////////// + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_X_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_X_SERVO_VFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Y_SERVO_VFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_JS_Z_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_JS_Z_SERVO_VFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_X_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_X_SERVO_VFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TB_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TB_Y_SERVO_VFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_ACC); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_ACC); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_VEL); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_VEL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_KP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KP); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_KI); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KI); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_KD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_IL); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_IL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_X_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_X_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_ACC); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_ACC); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_VEL); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_VEL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_KP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KP); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_KI); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KI); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_KD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_IL); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_IL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Y_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Y_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_ACC); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_ACC); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_VEL); + _ftprintf(pOutFile, _T("%ld"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_VEL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_KP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KP); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_KI); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KI); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_KD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_IL); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_IL); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_SERVO_KDD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_KSD); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_AFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_VFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_VFF); + _ftprintf(pOutFile, _T("\n%s "), cs_TP_AP_Z_SERVO_PID_SWAP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_TP_AP_Z_SERVO_PID_SWAP); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_ROLLOFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_ROLLOFF); + + _ftprintf(pOutFile, _T("\n%s "), cs_X_INDEX_OFFSET); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_X_INDEX_OFFSET); // 1.503326743391 + _ftprintf(pOutFile, _T("\n%s "), cs_Y_INDEX_OFFSET); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Y_INDEX_OFFSET); // 5.563602257609 + _ftprintf(pOutFile, _T("\n%s "), cs_Z_INDEX_OFFSET); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_Z_INDEX_OFFSET); // 1.175433201424 + + _ftprintf(pOutFile, _T("\n%s "), cs_USE_INDEX_PULSE); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_USE_INDEX_PULSE); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_ROLLOFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_ROLLOFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_ROLLOFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_ROLLOFF); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_ROLLOFF); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_KSP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_X_KSP); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_KSP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Y_KSP); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_KSP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_Z_KSP); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_KSP); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_AG_ZM_KSP); + + _ftprintf(pOutFile, _T("\n%s "), cs_AG_X_SHAFT2SCALE); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_X_SHAFT2SCALE); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Y_SHAFT2SCALE); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Y_SHAFT2SCALE); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_Z_SHAFT2SCALE); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_Z_SHAFT2SCALE); + _ftprintf(pOutFile, _T("\n%s "), cs_AG_ZM_SHAFT2SCALE); + _ftprintf(pOutFile, _T("%f"), m_EEPROM.ConfigData.e_AG_ZM_SHAFT2SCALE); + + _ftprintf(pOutFile, _T("\n%s "), cs_PAN_VIDEO_X); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_PAN_VIDEO_X); + _ftprintf(pOutFile, _T("\n%s "), cs_PAN_VIDEO_Y); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_PAN_VIDEO_Y); + _ftprintf(pOutFile, _T("\n%s "), cs_ILL_LENS); + _ftprintf(pOutFile, _T("%i"), m_EEPROM.ConfigData.e_ILL_LENS); + + /////////////////////////////////////////////////////////////// + /// non-EEPROM params /// + /////////////////////////////////////////////////////////////// + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_TIMEOUT_X); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_TIMEOUT_X); // 300 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_TIMEOUT_Y); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_TIMEOUT_Y); // 300 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_TIMEOUT_Z); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_TIMEOUT_Z); // 300 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_TIMEOUT_MAG); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_TIMEOUT_MAG); // 300 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_BANDWIDTH_X); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_BANDWIDTH_X); // 50 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_BANDWIDTH_Y); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_BANDWIDTH_Y); // 50 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_BANDWIDTH_Z); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_BANDWIDTH_Z); // 50 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_BANDWIDTH_MAG); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_BANDWIDTH_MAG); // 50 + + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_COUNT_X); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_COUNT_X); // 1 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_COUNT_Y); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_COUNT_Y); // 1 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_COUNT_Z); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_COUNT_Z); // 1 + _ftprintf(pOutFile, _T("\n%s "), cs_EDGE_RETRY_COUNT_MAG); + _ftprintf(pOutFile, _T("%i"), EDGE_RETRY_COUNT_MAG); // 1 + + _ftprintf(pOutFile, _T("\n%s "), cs_MM_XY_PIXEL_MOTION_TOLERANCE); + _ftprintf(pOutFile, _T("%i"), MM_XY_PIXEL_MOTION_TOLERANCE); // 10 + + _ftprintf(pOutFile, _T("\n%s "), cs_MM_Z_INCH_MOTION_TOLERANCE); + _ftprintf(pOutFile, _T("%lf"), MM_Z_INCH_MOTION_TOLERANCE); // 0.0001 + + _ftprintf(pOutFile, _T("\n%s "), cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE); + _ftprintf(pOutFile, _T("%i"), MM_ZOOM_PERCENT_MOTION_TOLERANCE); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_LIGHT_SETTLE_TIME); + _ftprintf(pOutFile, _T("%i"), LIGHT_SETTLE_TIME); // 30 + + _ftprintf(pOutFile, _T("\n%s "), cs_BACK_LIGHT_MAPPING); + _ftprintf(pOutFile, _T("%i"), BACK_LIGHT_MAPPING); // 10753 + + _ftprintf(pOutFile, _T("\n%s "), cs_RING_LIGHT_MAPPING); + _ftprintf(pOutFile, _T("%i"), RING_LIGHT_MAPPING); // 1154 + + _ftprintf(pOutFile, _T("\n%s "), cs_AUX_LIGHT_MAPPING); + _ftprintf(pOutFile, _T("%i"), AUX_LIGHT_MAPPING); // 33028 + + _ftprintf(pOutFile, _T("\n%s "), cs_GRID_LIGHT_MAPPING); + _ftprintf(pOutFile, _T("%i"), GRID_LIGHT_MAPPING); // 16384 + + _ftprintf(pOutFile, _T("\n%s "), cs_RING_KNOB_TO_LED_RING); + _ftprintf(pOutFile, _T("%i"), RING_KNOB_TO_LED_RING); // 2 + + _ftprintf(pOutFile, _T("\n%s "), cs_LASER_STEP); + _ftprintf(pOutFile, _T("%i"), LASER_STEP); // 10 + + fclose(pOutFile); + break; + } + default: + ASSERT(0); + break; + } + return SSI_STATUS_NORMAL; +} + +// ============================================================== +int CSSIData::Hex_Diff_To_File(CSSIData *pDataDiff1, CSSIData *pDataDiff2, CString FileName) +{ + CStdioFile cCalFile; + BOOL bFileStatus = FALSE; + CFileException cfeOpenError; + bFileStatus = cCalFile.Open(FileName, CFile::modeCreate | CFile::modeWrite| CFile::typeText, &cfeOpenError ); + if (!bFileStatus) + { + CString str; + str = _T("Cant open file: "); + str += FileName; + //str = GetCFileOpenErrorCause(cfeOpenError); + MessageBox(NULL, str, NULL, MB_OK); + return SSI_STATUS_ERROR; + } + + CString Marker; + CString Outline; + for (int ii = 0 ; ii < EEPROMBYTES ; ++ii) + { + if (pDataDiff1->m_EEPROM.EEPROM_Bytes[ii] != pDataDiff2->m_EEPROM.EEPROM_Bytes[ii]) + { + Marker = _T(">"); + } else + { + Marker = _T(" "); + } + Outline.Format(_T("%s %x %x\n"), Marker, pDataDiff1->m_EEPROM.EEPROM_Bytes[ii], pDataDiff2->m_EEPROM.EEPROM_Bytes[ii]); + cCalFile.WriteString(Outline); + } + return SSI_STATUS_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.CPP b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.CPP new file mode 100644 index 0000000..a3baee1 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.CPP @@ -0,0 +1,17 @@ +// stdafx.cpp : source file that includes just the standard includes +// stdafx.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include +# include +# if _MSC_VER < 1300 +# include +# endif +#endif + +#if _MSC_VER < 1300 +# include +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.H b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.H new file mode 100644 index 0000000..15a3ba5 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/STDAFX.H @@ -0,0 +1,14 @@ +#pragma once +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#include "stdafx_net.h" + +#define _ATL_APARTMENT_THREADED + +#include +#include // MFC OLE dialog classes + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiData.h b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiData.h new file mode 100644 index 0000000..72d4f36 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiData.h @@ -0,0 +1,1137 @@ + + +#if !defined(_SSI_SSIDATA__INCLUDED_) +#define _SSI_SSIDATA__INCLUDED_ +const CString cs_SerialNo =_T("SerialNo"); +const CString cs_X_Non_linear_Correction_table =_T("X Non linear Correction table"); +const CString cs_Y_Non_linear_Correction_table =_T("Y Non linear Correction table"); +const CString cs_X_Deviation_table =_T("X Deviation table"); +const CString cs_Y_Deviation_table =_T("Y Deviation table"); +const CString cs_JS_MAX_VELOCITY_X =_T("JS_MAX_VELOCITY_X"); +const CString cs_JS_MAX_VELOCITY_Y =_T("JS_MAX_VELOCITY_Y"); +const CString cs_JS_MAX_VELOCITY_Z =_T("JS_MAX_VELOCITY_Z"); +const CString cs_JS_MAX_VELOCITY_ZM =_T("JS_MAX_VELOCITY_ZM"); +const CString cs_JS_X_SERVO_SWAP =_T("JS_X_SERVO_SWAP"); +const CString cs_JS_X_SERVO_KP =_T("JS_X_SERVO_KP"); +const CString cs_JS_X_SERVO_KI =_T("JS_X_SERVO_KI"); +const CString cs_JS_X_SERVO_KD =_T("JS_X_SERVO_KD"); +const CString cs_JS_X_SERVO_IL =_T("JS_X_SERVO_IL"); +const CString cs_JS_Y_SERVO_SWAP =_T("JS_Y_SERVO_SWAP"); +const CString cs_JS_Y_SERVO_KP =_T("JS_Y_SERVO_KP"); +const CString cs_JS_Y_SERVO_KI =_T("JS_Y_SERVO_KI"); +const CString cs_JS_Y_SERVO_KD =_T("JS_Y_SERVO_KD"); +const CString cs_JS_Y_SERVO_IL =_T("JS_Y_SERVO_IL"); +const CString cs_JS_Z_SERVO_SWAP =_T("JS_Z_SERVO_SWAP"); +const CString cs_JS_Z_SERVO_KP =_T("JS_Z_SERVO_KP"); +const CString cs_JS_Z_SERVO_KI =_T("JS_Z_SERVO_KI"); +const CString cs_JS_Z_SERVO_KD =_T("JS_Z_SERVO_KD"); +const CString cs_JS_Z_SERVO_IL =_T("JS_Z_SERVO_IL"); +const CString cs_JS_ZM_SERVO_SWAP =_T("JS_ZM_SERVO_SWAP"); +const CString cs_JS_ZM_SERVO_KP =_T("JS_ZM_SERVO_KP"); +const CString cs_JS_ZM_SERVO_KI =_T("JS_ZM_SERVO_KI"); +const CString cs_JS_ZM_SERVO_KD =_T("JS_ZM_SERVO_KD"); +const CString cs_JS_ZM_SERVO_IL =_T("JS_ZM_SERVO_IL"); +const CString cs_TB_X_SERVO_ACC =_T("TB_X_SERVO_ACC"); +const CString cs_TB_X_SERVO_VEL =_T("TB_X_SERVO_VEL"); +const CString cs_TB_X_SERVO_KP =_T("TB_X_SERVO_KP" ); +const CString cs_TB_X_SERVO_KI =_T("TB_X_SERVO_KI"); +const CString cs_TB_X_SERVO_KD =_T("TB_X_SERVO_KD"); +const CString cs_TB_X_SERVO_IL =_T("TB_X_SERVO_IL"); +const CString cs_TB_X_SERVO_SWAP =_T("TB_X_SERVO_SWAP"); +const CString cs_TB_Y_SERVO_ACC =_T("TB_Y_SERVO_ACC"); +const CString cs_TB_Y_SERVO_VEL =_T("TB_Y_SERVO_VEL"); +const CString cs_TB_Y_SERVO_KP =_T("TB_Y_SERVO_KP"); +const CString cs_TB_Y_SERVO_KI =_T("TB_Y_SERVO_KI"); +const CString cs_TB_Y_SERVO_KD =_T("TB_Y_SERVO_KD"); +const CString cs_TB_Y_SERVO_IL =_T("TB_Y_SERVO_IL"); +const CString cs_TB_Y_SERVO_SWAP =_T("TB_Y_SERVO_SWAP"); +const CString cs_AG_X_SERVO_ACC =_T("AG_X_SERVO_ACC"); +const CString cs_AG_X_SERVO_VEL =_T("AG_X_SERVO_VEL"); +const CString cs_AG_X_SERVO_KP =_T("AG_X_SERVO_KP"); +const CString cs_AG_X_SERVO_KI =_T("AG_X_SERVO_KI"); +const CString cs_AG_X_SERVO_KD =_T("AG_X_SERVO_KD"); +const CString cs_AG_X_SERVO_IL =_T("AG_X_SERVO_IL"); +const CString cs_AG_Y_SERVO_ACC =_T("AG_Y_SERVO_ACC"); +const CString cs_AG_Y_SERVO_VEL =_T("AG_Y_SERVO_VEL"); +const CString cs_AG_Y_SERVO_KP =_T("AG_Y_SERVO_KP"); +const CString cs_AG_Y_SERVO_KI =_T("AG_Y_SERVO_KI"); +const CString cs_AG_Y_SERVO_KD =_T("AG_Y_SERVO_KD"); +const CString cs_AG_Y_SERVO_IL =_T("AG_Y_SERVO_IL"); +const CString cs_AG_Z_SERVO_ACC =_T("AG_Z_SERVO_ACC"); +const CString cs_AG_Z_SERVO_VEL =_T("AG_Z_SERVO_VEL"); +const CString cs_AG_Z_SERVO_KP =_T("AG_Z_SERVO_KP"); +const CString cs_AG_Z_SERVO_KI =_T("AG_Z_SERVO_KI"); +const CString cs_AG_Z_SERVO_KD =_T("AG_Z_SERVO_KD"); +const CString cs_AG_Z_SERVO_IL =_T("AG_Z_SERVO_IL"); +const CString cs_AG_ZM_SERVO_ACC =_T("AG_ZM_SERVO_ACC"); +const CString cs_AG_ZM_SERVO_VEL =_T("AG_ZM_SERVO_VEL"); +const CString cs_AG_ZM_SERVO_KP =_T("AG_ZM_SERVO_KP"); +const CString cs_AG_ZM_SERVO_KI =_T("AG_ZM_SERVO_KI"); +const CString cs_AG_ZM_SERVO_IL =_T("AG_ZM_SERVO_IL"); +const CString cs_AG_ZM_SERVO_KD =_T("AG_ZM_SERVO_KD"); +const CString cs_MAX_ZOOM_COUNTS =_T("MAX_ZOOM_COUNTS"); +const CString cs_ZOOM_COUNT_TOLERANCE =_T("ZOOM_COUNT_TOLERANCE"); // 10 +const CString cs_Zoom_Lens_Magnification_Calibration_Table =_T("Zoom Lens Magnification Calibration Table"); +const CString cs_X_SCALE_FACTOR =_T("X_SCALE_FACTOR"); +const CString cs_Y_SCALE_FACTOR =_T("Y_SCALE_FACTOR"); +const CString cs_Z_SCALE_FACTOR =_T("Z_SCALE_FACTOR"); +const CString cs_XY_SCALE_FACTOR =_T("XY_SCALE_FACTOR"); +const CString cs_XZ_SCALE_FACTOR =_T("XZ_SCALE_FACTOR"); +const CString cs_YZ_SCALE_FACTOR =_T("YZ_SCALE_FACTOR"); +const CString cs_X_LOW_FOV_INCHES =_T("X_LOW_FOV_INCHES"); +const CString cs_X_HIGH_FOV_INCHES =_T("X_HIGH_FOV_INCHES"); +const CString cs_Y_LOW_FOV_INCHES =_T("Y_LOW_FOV_INCHES"); +const CString cs_Y_HIGH_FOV_INCHES =_T("Y_HIGH_FOV_INCHES"); +const CString cs_EDGE_CONTRAST_THRESHOLD =_T("EDGE_CONTRAST_THRESHOLD"); +const CString cs_EDGE_X_SLOPE =_T("EDGE_X_SLOPE"); +const CString cs_EDGE_Y_SLOPE =_T("EDGE_Y_SLOPE"); +const CString cs_EDGE_X_OFFSET =_T("EDGE_X_OFFSET"); +const CString cs_EDGE_Y_OFFSET =_T("EDGE_Y_OFFSET"); +const CString cs_EDGE_IS_CALIBRATED =_T("EDGE_IS_CALIBRATED"); +const CString cs_EDGE_AUTO_FOV =_T("EDGE_AUTO_FOV"); +const CString cs_EDGE_RELATIVE_MAG =_T("EDGE_RELATIVE_MAG"); +const CString cs_EDGE_ZOOM_RATIO =_T("EDGE_ZOOM_RATIO"); +const CString cs_EDGE_FRAME_AVERAGES =_T("EDGE_FRAME_AVERAGES"); +const CString cs_EDGE_AUTO_REMEASURE =_T("EDGE_AUTO_REMEASURE"); +const CString cs_EDGE_TARGET_SIZE =_T("EDGE_TARGET_SIZE"); +const CString cs_OPTICS_TUBE =_T("OPTICS_TUBE"); +const CString cs_OPTICS_LENS =_T("OPTICS_LENS"); +const CString cs_X_STAGE_TRAVEL =_T("X_STAGE_TRAVEL"); +const CString cs_Y_STAGE_TRAVEL =_T("Y_STAGE_TRAVEL"); +const CString cs_Z_STAGE_TRAVEL =_T("Z_STAGE_TRAVEL"); +const CString cs_WARN_TRAVEL_EXCEEDED =_T("WARN_TRAVEL_EXCEEDED"); +const CString cs_BACK_LIGHT_OFFSET =_T("BACK_LIGHT_OFFSET"); +const CString cs_RING_LIGHT_OFFSET =_T("RING_LIGHT_OFFSET"); +const CString cs_AUX_LIGHT_OFFSET =_T("AUX_LIGHT_OFFSET"); +const CString cs_X_SERVO_PRE_VEL =_T("X_SERVO_PRE_VEL"); +const CString cs_Y_SERVO_PRE_VEL =_T("Y_SERVO_PRE_VEL"); +const CString cs_Z_SERVO_PRE_VEL =_T("Z_SERVO_PRE_VEL"); +const CString cs_ZM_SERVO_PRE_VEL =_T("ZM_SERVO_PRE_VEL"); +const CString cs_X_SERVO_XCESS_PERR =_T("X_SERVO_XCESS_PERR"); +const CString cs_Y_SERVO_XCESS_PERR =_T("Y_SERVO_XCESS_PERR"); +const CString cs_Z_SERVO_XCESS_PERR =_T("Z_SERVO_XCESS_PERR"); +const CString cs_ZM_SERVO_XCESS_PERR =_T("ZM_SERVO_XCESS_PERR"); +const CString cs_AG_X_POS_WIN =_T("AG_X_POS_WIN"); +const CString cs_AG_Y_POS_WIN =_T("AG_Y_POS_WIN"); +const CString cs_AG_Z_POS_WIN =_T("AG_Z_POS_WIN"); +const CString cs_AG_ZM_POS_WIN =_T("AG_ZM_POS_WIN"); +const CString cs_X_SCALE_SWAP =_T("X_SCALE_SWAP"); +const CString cs_Y_SCALE_SWAP =_T("Y_SCALE_SWAP"); +const CString cs_Z_SCALE_SWAP =_T("Z_SCALE_SWAP"); +const CString cs_SECOND_X_SCALE_SWAP =_T("SECOND_X_SCALE_SWAP"); +const CString cs_SECOND_Y_SCALE_SWAP =_T("SECOND_Y_SCALE_SWAP"); +const CString cs_SECOND_Z_SCALE_SWAP =_T("SECOND_Z_SCALE_SWAP"); +const CString cs_SECOND_X_SCALE_FACTOR =_T("SECOND_X_SCALE_FACTOR"); +const CString cs_SECOND_Y_SCALE_FACTOR =_T("SECOND_Y_SCALE_FACTOR"); +const CString cs_SECOND_Z_SCALE_FACTOR =_T("SECOND_Z_SCALE_FACTOR"); + +const CString cs_SENSOR_TYPE =_T("SENSOR_TYPE"); // 1 +const CString cs_SENSOR_CAPTURE_RANGE =_T("SENSOR_CAPTURE_RANGE"); // 500 +const CString cs_CENTER_X_OFFSET =_T("CENTER_X_OFFSET"); // -4.547296 +const CString cs_CENTER_Y_OFFSET =_T("CENTER_Y_OFFSET"); // -0.021848 +const CString cs_CENTER_Z_OFFSET =_T("CENTER_Z_OFFSET"); // +0.493055 +const CString cs_SCAN_SPEED_VALUE =_T("SCAN_SPEED_VALUE"); // 100 +const CString cs_FOCUS_RETRIES =_T("FOCUS_RETRIES"); // 3 +const CString cs_FOCUS_AVERAGE =_T("FOCUS_AVERAGE"); // 5 +const CString cs_LASER_CAL_SCAN_TRIES =_T("LASER_CAL_SCAN_TRIES"); // 5 +const CString cs_LASER_CAL_ROUGH_BACKOFF =_T("LASER_CAL_ROUGH_BACKOFF"); // +0.100000 +const CString cs_LASER_CAL_FINE_BACKOFF =_T("LASER_CAL_FINE_BACKOFF"); // +0.010000 +const CString cs_LASER_CAL_ROUGH_SPACING =_T("LASER_CAL_ROUGH_SPACING"); // +0.001000000000 +const CString cs_LASER_CAL_FINE_SPACING =_T("LASER_CAL_FINE_SPACING"); // +0.000400000000 +const CString cs_LASER_CAL_THRESHOLD_VALUE =_T("LASER_CAL_THRESHOLD_VALUE"); // 15 +const CString cs_LASER_CAL_MAX_EXPOSURE_TIME =_T("LASER_CAL_MAX_EXPOSURE_TIME"); // 75 +const CString cs_LASER_CAL_BOX_WIDTH =_T("LASER_CAL_BOX_WIDTH"); // 0.750702 +const CString cs_LASER_CAL_BOX_HEIGHT =_T("LASER_CAL_BOX_HEIGHT"); // 0.750571 +const CString cs_LASER_CAL_STRONG_EDGE_SIZE =_T("LASER_CAL_STRONG_EDGE_SIZE"); // 60 +const CString cs_LASER_CAL_STRONG_EDGE_CONTRAST =_T("LASER_CAL_STRONG_EDGE_CONTRAST"); // 1 +const CString cs_LASER_CAL_FOCUS_BOX_SIZE =_T(" LASER_CAL_FOCUS_BOX_SIZE"); // 60 +const CString cs_CONFIRM_LASER_DEPLOYMENT =_T("CONFIRM_LASER_DEPLOYMENT"); // 1 +const CString cs_LASER_MECHANISM_TYPE =_T("LASER_MECHANISM_TYPE"); // 2 + +//added for 2000 + +const CString cs_USE_SECOND_X_SCALE =_T("USE_SECOND_X_SCALE"); +const CString cs_USE_SECOND_Y_SCALE =_T("USE_SECOND_Y_SCALE"); +const CString cs_USE_SECOND_Z_SCALE =_T("USE_SECOND_Z_SCALE"); // +const CString cs_DUAL_X_SCALE_SEPARATION =_T("DUAL_X_SCALE_SEPARATION"); // 24.083779 +const CString cs_DUAL_Y_SCALE_SEPARATION =_T("DUAL_Y_SCALE_SEPARATION"); // 24.100315 +const CString cs_DUAL_Z_SCALE_SEPARATION =_T("DUAL_Z_SCALE_SEPARATION"); // 15.550000 +const CString cs_OFFSET_X_LIMIT =_T("OFFSET_X_LIMIT"); +const CString cs_OFFSET_Y_LIMIT =_T("OFFSET_Y_LIMIT"); +const CString cs_OFFSET_Z_LIMIT =_T("OFFSET_Z_LIMIT"); +const CString cs_FORCE_STAGE_INIT =_T("FORCE_STAGE_INIT"); +const CString cs_FORCE_MAGNETIC_LIMITS_X =_T("FORCE_MAGNETIC_LIMITS_X"); // 0 +const CString cs_FORCE_MAGNETIC_LIMITS_Y =_T("FORCE_MAGNETIC_LIMITS_Y"); // 0 +const CString cs_FORCE_MAGNETIC_LIMITS_Z =_T("FORCE_MAGNETIC_LIMITS_Z"); // 0 +const CString cs_JS_X_NEG_PRELIM_OFFSET =_T("JS_X_NEG_PRELIM_OFFSET"); +const CString cs_JS_Y_NEG_PRELIM_OFFSET =_T("JS_Y_NEG_PRELIM_OFFSET"); +const CString cs_JS_Z_NEG_PRELIM_OFFSET =_T("JS_Z_NEG_PRELIM_OFFSET"); +const CString cs_JS_ZM_NEG_PRELIM =_T("JS_ZM_NEG_PRELIM"); +const CString cs_JS_X_POS_PRELIM_OFFSET =_T("JS_X_POS_PRELIM_OFFSET"); +const CString cs_JS_Y_POS_PRELIM_OFFSET =_T("JS_Y_POS_PRELIM_OFFSET"); +const CString cs_JS_Z_POS_PRELIM_OFFSET =_T("JS_Z_POS_PRELIM_OFFSET"); +const CString cs_JS_ZM_POS_PRELIM =_T("JS_ZM_POS_PRELIM"); +const CString cs_AG_X_NEG_PRELIM_OFFSET =_T("AG_X_NEG_PRELIM_OFFSET"); +const CString cs_AG_Y_NEG_PRELIM_OFFSET =_T("AG_Y_NEG_PRELIM_OFFSET"); +const CString cs_AG_Z_NEG_PRELIM_OFFSET =_T("AG_Z_NEG_PRELIM_OFFSET"); +const CString cs_AG_ZM_NEG_PRELIM =_T("AG_ZM_NEG_PRELIM"); +const CString cs_AG_X_POS_PRELIM_OFFSET =_T("AG_X_POS_PRELIM_OFFSET"); +const CString cs_AG_Y_POS_PRELIM_OFFSET =_T("AG_Y_POS_PRELIM_OFFSET"); +const CString cs_AG_Z_POS_PRELIM_OFFSET =_T("AG_Z_POS_PRELIM_OFFSET"); +const CString cs_AG_ZM_POS_PRELIM =_T("AG_ZM_POS_PRELIM"); +const CString cs_AG_MIN_MOVE_TIME =_T("AG_MIN_MOVE_TIME"); + +// HW settle cfg strings +const CString cs_EDGE_RETRY_TIMEOUT_X =_T("EDGE_RETRY_TIMEOUT_X"); +const CString cs_EDGE_RETRY_TIMEOUT_Y =_T("EDGE_RETRY_TIMEOUT_Y"); +const CString cs_EDGE_RETRY_TIMEOUT_Z =_T("EDGE_RETRY_TIMEOUT_Z"); +const CString cs_EDGE_RETRY_TIMEOUT_MAG =_T("EDGE_RETRY_TIMEOUT_MAG"); +const CString cs_EDGE_RETRY_BANDWIDTH_X =_T("EDGE_RETRY_BANDWIDTH_X"); +const CString cs_EDGE_RETRY_BANDWIDTH_Y =_T("EDGE_RETRY_BANDWIDTH_Y"); +const CString cs_EDGE_RETRY_BANDWIDTH_Z =_T("EDGE_RETRY_BANDWIDTH_Z"); +const CString cs_EDGE_RETRY_BANDWIDTH_MAG =_T("EDGE_RETRY_BANDWIDTH_MAG"); +const CString cs_EDGE_RETRY_COUNT_X =_T("EDGE_RETRY_COUNT_X"); +const CString cs_EDGE_RETRY_COUNT_Y =_T("EDGE_RETRY_COUNT_Y"); +const CString cs_EDGE_RETRY_COUNT_Z =_T("EDGE_RETRY_COUNT_Z"); +const CString cs_EDGE_RETRY_COUNT_MAG =_T("EDGE_RETRY_COUNT_MAG"); +const CString cs_MM_XY_PIXEL_MOTION_TOLERANCE =_T("MM_XY_PIXEL_MOTION_TOLERANCE"); +const CString cs_MM_Z_INCH_MOTION_TOLERANCE =_T("MM_Z_INCH_MOTION_TOLERANCE"); +const CString cs_MM_ZOOM_PERCENT_MOTION_TOLERANCE =_T("MM_ZOOM_PERCENT_MOTION_TOLERANCE"); +const CString cs_LIGHT_SETTLE_TIME =_T("LIGHT_SETTLE_TIME"); +const CString cs_BACK_LIGHT_MAPPING =_T("BACK_LIGHT_MAPPING"); +const CString cs_RING_LIGHT_MAPPING =_T("RING_LIGHT_MAPPING"); +const CString cs_AUX_LIGHT_MAPPING =_T("AUX_LIGHT_MAPPING"); +const CString cs_GRID_LIGHT_MAPPING =_T("GRID_LIGHT_MAPPING"); + +const CString cs_JS_X_SERVO_KDD = _T("JS_X_SERVO_KDD"); +const CString cs_JS_X_SERVO_KSD = _T("JS_X_SERVO_KSD"); +const CString cs_JS_X_SERVO_AFF = _T("JS_X_SERVO_AFF"); +const CString cs_JS_X_SERVO_VFF = _T("JS_X_SERVO_VFF"); +const CString cs_JS_Y_SERVO_KDD = _T("JS_Y_SERVO_KDD"); +const CString cs_JS_Y_SERVO_KSD = _T("JS_Y_SERVO_KSD"); +const CString cs_JS_Y_SERVO_AFF = _T("JS_Y_SERVO_AFF"); +const CString cs_JS_Y_SERVO_VFF = _T("JS_Y_SERVO_VFF"); +const CString cs_JS_Z_SERVO_KDD = _T("JS_Z_SERVO_KDD"); +const CString cs_JS_Z_SERVO_KSD = _T("JS_Z_SERVO_KSD"); +const CString cs_JS_Z_SERVO_AFF = _T("JS_Z_SERVO_AFF"); +const CString cs_JS_Z_SERVO_VFF = _T("JS_Z_SERVO_VFF"); +const CString cs_TB_X_SERVO_KDD = _T("TB_X_SERVO_KDD"); +const CString cs_TB_X_SERVO_KSD = _T("TB_X_SERVO_KSD"); +const CString cs_TB_X_SERVO_AFF = _T("TB_X_SERVO_AFF"); +const CString cs_TB_X_SERVO_VFF = _T("TB_X_SERVO_VFF"); +const CString cs_TB_Y_SERVO_KDD = _T("TB_Y_SERVO_KDD"); +const CString cs_TB_Y_SERVO_KSD = _T("TB_Y_SERVO_KSD"); +const CString cs_TB_Y_SERVO_AFF = _T("TB_Y_SERVO_AFF"); +const CString cs_TB_Y_SERVO_VFF = _T("TB_Y_SERVO_VFF"); +const CString cs_AG_X_SERVO_KDD = _T("AG_X_SERVO_KDD"); +const CString cs_AG_X_SERVO_KSD = _T("AG_X_SERVO_KSD"); +const CString cs_AG_X_SERVO_AFF = _T("AG_X_SERVO_AFF"); +const CString cs_AG_X_SERVO_VFF = _T("AG_X_SERVO_VFF"); +const CString cs_AG_X_SERVO_PID_SWAP = _T("AG_X_SERVO_PID_SWAP"); +const CString cs_AG_Y_SERVO_KDD = _T("AG_Y_SERVO_KDD"); +const CString cs_AG_Y_SERVO_KSD = _T("AG_Y_SERVO_KSD"); +const CString cs_AG_Y_SERVO_AFF = _T("AG_Y_SERVO_AFF"); +const CString cs_AG_Y_SERVO_VFF = _T("AG_Y_SERVO_VFF"); +const CString cs_AG_Y_SERVO_PID_SWAP = _T("AG_Y_SERVO_PID_SWAP"); +const CString cs_AG_Z_SERVO_KDD = _T("AG_Z_SERVO_KDD"); +const CString cs_AG_Z_SERVO_KSD = _T("AG_Z_SERVO_KSD"); +const CString cs_AG_Z_SERVO_AFF = _T("AG_Z_SERVO_AFF"); +const CString cs_AG_Z_SERVO_VFF = _T("AG_Z_SERVO_VFF"); +const CString cs_AG_Z_SERVO_PID_SWAP = _T("AG_Z_SERVO_PID_SWAP"); +const CString cs_AG_ZM_SERVO_PID_SWAP = _T("AG_ZM_SERVO_PID_SWAP"); +const CString cs_TP_AP_X_SERVO_ACC = _T("TP_AP_X_SERVO_ACC"); +const CString cs_TP_AP_X_SERVO_VEL = _T("TP_AP_X_SERVO_VEL"); +const CString cs_TP_AP_X_SERVO_KP = _T("TP_AP_X_SERVO_KP"); +const CString cs_TP_AP_X_SERVO_KI = _T("TP_AP_X_SERVO_KI"); +const CString cs_TP_AP_X_SERVO_KD = _T("TP_AP_X_SERVO_KD"); +const CString cs_TP_AP_X_SERVO_IL = _T("TP_AP_X_SERVO_IL"); +const CString cs_TP_AP_X_SERVO_KDD = _T("TP_AP_X_SERVO_KDD"); +const CString cs_TP_AP_X_SERVO_KSD = _T("TP_AP_X_SERVO_KSD"); +const CString cs_TP_AP_X_SERVO_AFF = _T("TP_AP_X_SERVO_AFF"); +const CString cs_TP_AP_X_SERVO_VFF = _T("TP_AP_X_SERVO_VFF"); +const CString cs_TP_AP_X_SERVO_PID_SWAP = _T("TP_AP_X_SERVO_PID_SWAP"); + +const CString cs_TP_AP_Y_SERVO_ACC = _T("TP_AP_Y_SERVO_ACC"); +const CString cs_TP_AP_Y_SERVO_VEL = _T("TP_AP_Y_SERVO_VEL"); +const CString cs_TP_AP_Y_SERVO_KP = _T("TP_AP_Y_SERVO_KP"); +const CString cs_TP_AP_Y_SERVO_KI = _T("TP_AP_Y_SERVO_KI"); +const CString cs_TP_AP_Y_SERVO_KD = _T("TP_AP_Y_SERVO_KD"); +const CString cs_TP_AP_Y_SERVO_IL = _T("TP_AP_Y_SERVO_IL"); +const CString cs_TP_AP_Y_SERVO_KDD = _T("TP_AP_Y_SERVO_KDD"); +const CString cs_TP_AP_Y_SERVO_KSD = _T("TP_AP_Y_SERVO_KSD"); +const CString cs_TP_AP_Y_SERVO_AFF = _T("TP_AP_Y_SERVO_AFF"); +const CString cs_TP_AP_Y_SERVO_VFF = _T("TP_AP_Y_SERVO_VFF"); +const CString cs_TP_AP_Y_SERVO_PID_SWAP = _T("TP_AP_Y_SERVO_PID_SWAP"); + +const CString cs_TP_AP_Z_SERVO_ACC = _T("TP_AP_Z_SERVO_ACC"); +const CString cs_TP_AP_Z_SERVO_VEL = _T("TP_AP_Z_SERVO_VEL"); +const CString cs_TP_AP_Z_SERVO_KP = _T("TP_AP_Z_SERVO_KP"); +const CString cs_TP_AP_Z_SERVO_KI = _T("TP_AP_Z_SERVO_KI"); +const CString cs_TP_AP_Z_SERVO_KD = _T("TP_AP_Z_SERVO_KD"); +const CString cs_TP_AP_Z_SERVO_IL = _T("TP_AP_Z_SERVO_IL"); +const CString cs_TP_AP_Z_SERVO_KDD = _T("TP_AP_Z_SERVO_KDD"); +const CString cs_TP_AP_Z_SERVO_KSD = _T("TP_AP_Z_SERVO_KSD"); +const CString cs_TP_AP_Z_SERVO_AFF = _T("TP_AP_Z_SERVO_AFF"); +const CString cs_TP_AP_Z_SERVO_VFF = _T("TP_AP_Z_SERVO_VFF"); +const CString cs_TP_AP_Z_SERVO_PID_SWAP = _T("TP_AP_Z_SERVO_PID_SWAP"); + +const CString cs_TP_UNFREEZE_DIST = _T("TP_UNFREEZE_DIST"); // 0.150000 +const CString cs_TP_DO_ARC_MOTION = _T("TP_DO_ARC_MOTION"); // 1 +const CString cs_TP_ARC_X_SERVO_ACC = _T("TP_ARC_X_SERVO_ACC"); // 0 +const CString cs_TP_ARC_Y_SERVO_ACC = _T("TP_ARC_Y_SERVO_ACC"); // 0 +const CString cs_TP_ARC_Z_SERVO_ACC = _T("TP_ARC_Z_SERVO_ACC"); // 0 +const CString cs_TP_ARC_X_SERVO_VEL = _T("TP_ARC_X_SERVO_VEL"); // 0 +const CString cs_TP_ARC_Y_SERVO_VEL = _T("TP_ARC_Y_SERVO_VEL"); // 0 +const CString cs_TP_ARC_Z_SERVO_VEL = _T("TP_ARC_Z_SERVO_VEL"); // 0 + +const CString cs_X_BREAK_THRESHOLD = _T("X_BREAK_THRESHOLD"); // 0 +const CString cs_Y_BREAK_THRESHOLD = _T("Y_BREAK_THRESHOLD"); // 0 +const CString cs_Z_BREAK_THRESHOLD = _T("Z_BREAK_THRESHOLD"); // 0 +const CString cs_ZM_BREAK_THRESHOLD = _T("ZM_BREAK_THRESHOLD"); // 0 +const CString cs_X_BREAK_TICKS = _T("X_BREAK_TICKS"); // 0 +const CString cs_Y_BREAK_TICKS = _T("Y_BREAK_TICKS"); // 0 +const CString cs_Z_BREAK_TICKS = _T("Z_BREAK_TICKS"); // 0 +const CString cs_ZM_BREAK_TICKS = _T("ZM_BREAK_TICKS"); // 0 + +const CString cs_TP_DOCKING_X_SERVO_ACC = _T("TP_DOCKING_X_SERVO_ACC"); // 7500 +const CString cs_TP_DOCKING_Y_SERVO_ACC = _T("TP_DOCKING_Y_SERVO_ACC"); // 7500 +const CString cs_TP_DOCKING_Z_SERVO_ACC = _T("TP_DOCKING_Z_SERVO_ACC"); // 7500 +const CString cs_TP_DOCKING_X_SERVO_VEL = _T("TP_DOCKING_X_SERVO_VEL"); // 238450 +const CString cs_TP_DOCKING_Y_SERVO_VEL = _T("TP_DOCKING_Y_SERVO_VEL"); // 238450 +const CString cs_TP_DOCKING_Z_SERVO_VEL = _T("TP_DOCKING_Z_SERVO_VEL"); // 238450 +const CString cs_X_NEG_LIM_POSITION_KEEP_ENABLE = _T("X_NEG_LIM_POSITION_KEEP_ENABLE"); // 0 +const CString cs_X_POS_LIM_POSITION_KEEP_ENABLE = _T("X_POS_LIM_POSITION_KEEP_ENABLE"); // 0 +const CString cs_Y_NEG_LIM_POSITION_KEEP_ENABLE = _T("Y_NEG_LIM_POSITION_KEEP_ENABLE"); // 0 +const CString cs_Y_POS_LIM_POSITION_KEEP_ENABLE = _T("Y_POS_LIM_POSITION_KEEP_ENABLE"); // 0 +const CString cs_Z_NEG_LIM_POSITION_KEEP_ENABLE = _T("Z_NEG_LIM_POSITION_KEEP_ENABLE"); // 0 +const CString cs_Z_POS_LIM_POSITION_KEEP_ENABLE = _T("Z_POS_LIM_POSITION_KEEP_ENABLE"); // 0 + +const CString cs_ROTARY_SLOW_VELOCITY = _T("ROTARY_SLOW_VELOCITY"); // 24 +const CString cs_ROTARY_MEDIUM_VELOCITY = _T("ROTARY_MEDIUM_VELOCITY"); // 48 +const CString cs_ROTARY_FAST_VELOCITY = _T("ROTARY_FAST_VELOCITY"); // 96 +const CString cs_PRIMARY_ROTARY_SERVO_KP = _T("PRIMARY_ROTARY_SERVO_KP"); // 16 +const CString cs_PRIMARY_ROTARY_SERVO_KI = _T("PRIMARY_ROTARY_SERVO_KI "); // 2000 +const CString cs_PRIMARY_ROTARY_SERVO_KIC = _T("PRIMARY_ROTARY_SERVO_KIC"); // 16000 +const CString cs_PRIMARY_ROTARY_SERVO_KDD = _T("PRIMARY_ROTARY_SERVO_KDD"); // 16 +const CString cs_PRIMARY_ROTARY_SERVO_IL = _T("PRIMARY_ROTARY_SERVO_IL"); // 500 +const CString cs_PRIMARY_ROTARY_SERVO_KSP = _T("PRIMARY_ROTARY_SERVO_KSP"); // 8 +const CString cs_PRIMARY_ROTARY_SERVO_KSD = _T("PRIMARY_ROTARY_SERVO_KSD"); // 16 +const CString cs_PRIMARY_ROTARY_XCESS_PERR = _T("PRIMARY_ROTARY_XCESS_PERR"); // 0 +const CString cs_PRIMARY_ROTARY_TRAJECTORY_FILTER = _T("PRIMARY_ROTARY_TRAJECTORY_FILTER"); // 4 +const CString cs_SECONDARY_ROTARY_SERVO_KP = _T("SECONDARY_ROTARY_SERVO_KP"); // 20 +const CString cs_SECONDARY_ROTARY_SERVO_KI = _T("SECONDARY_ROTARY_SERVO_KI "); // 2000 +const CString cs_SECONDARY_ROTARY_SERVO_KIC = _T("SECONDARY_ROTARY_SERVO_KIC"); // 16000 +const CString cs_SECONDARY_ROTARY_SERVO_KDD = _T("SECONDARY_ROTARY_SERVO_KDD"); // 16 +const CString cs_SECONDARY_ROTARY_SERVO_IL = _T("SECONDARY_ROTARY_SERVO_IL"); // 500 +const CString cs_SECONDARY_ROTARY_SERVO_KSP = _T("SECONDARY_ROTARY_SERVO_KSP"); // 8 +const CString cs_SECONDARY_ROTARY_SERVO_KSD = _T("SECONDARY_ROTARY_SERVO_KSD"); // 16 +const CString cs_SECONDARY_ROTARY_XCESS_PERR = _T("SECONDARY_ROTARY_XCESS_PERR"); // 0 +const CString cs_SECONDARY_ROTARY_TRAJECTORY_FILTER = _T("SECONDARY_ROTARY_TRAJECTORY_FILTER"); // 2 + +const CString cs_X_POS_KEEP_PARAMS_ENABLE = _T("X_POS_KEEP_PARAMS_ENABLE"); // 0 +const CString cs_X_POS_KEEP_POS_WIN = _T("X_POS_KEEP_POS_WIN"); // 0.000500 +const CString cs_X_POS_KEEP_KP = _T("X_POS_KEEP_KP"); // 1 +const CString cs_X_POS_KEEP_KPF = _T("X_POS_KEEP_KPF"); // 0.0000 +const CString cs_X_POS_KEEP_KI = _T("X_POS_KEEP_KI"); // 0 +const CString cs_X_POS_KEEP_KIF = _T("X_POS_KEEP_KIF"); // 0.0000 +const CString cs_X_POS_KEEP_KD = _T("X_POS_KEEP_KD"); // 0 +const CString cs_X_POS_KEEP_IL = _T("X_POS_KEEP_IL"); // 10000 +const CString cs_X_POS_KEEP_KDD = _T("X_POS_KEEP_KDD"); // 0 +const CString cs_X_POS_KEEP_PARAM_10 = _T("X_POS_KEEP_PARAM_10"); // 0 +const CString cs_X_POS_KEEP_PARAM_11 = _T("X_POS_KEEP_PARAM_11"); // 0 +const CString cs_X_POS_KEEP_PARAM_12 = _T("X_POS_KEEP_PARAM_12"); // 0 +const CString cs_X_POS_KEEP_KSD = _T("X_POS_KEEP_KSD"); // 0 +const CString cs_X_POS_KEEP_KSP = _T("X_POS_KEEP_KSP"); // 0 +const CString cs_Y_POS_KEEP_PARAMS_ENABLE = _T("Y_POS_KEEP_PARAMS_ENABLE"); // 0 +const CString cs_Y_POS_KEEP_POS_WIN = _T("Y_POS_KEEP_POS_WIN"); // 0.000500 +const CString cs_Y_POS_KEEP_KP = _T("Y_POS_KEEP_KP"); // 1 +const CString cs_Y_POS_KEEP_KPF = _T("Y_POS_KEEP_KPF"); // 0.0000 +const CString cs_Y_POS_KEEP_KI = _T("Y_POS_KEEP_KI"); // 0 +const CString cs_Y_POS_KEEP_KIF = _T("Y_POS_KEEP_KIF"); // 0.0000 +const CString cs_Y_POS_KEEP_KD = _T("Y_POS_KEEP_KD"); // 0 +const CString cs_Y_POS_KEEP_IL = _T("Y_POS_KEEP_IL"); // 10000 +const CString cs_Y_POS_KEEP_KDD = _T("Y_POS_KEEP_KDD"); // 0 +const CString cs_Y_POS_KEEP_PARAM_10 = _T("Y_POS_KEEP_PARM_10"); // 0 +const CString cs_Y_POS_KEEP_PARAM_11 = _T("Y_POS_KEEP_PARM_11"); // 0 +const CString cs_Y_POS_KEEP_PARAM_12 = _T("Y_POS_KEEP_PARM_12"); // 0 +const CString cs_Y_POS_KEEP_KSD = _T("Y_POS_KEEP_KSD"); // 0 +const CString cs_Y_POS_KEEP_KSP = _T("Y_POS_KEEP_KSP"); // 0 +const CString cs_Z_POS_KEEP_PARAMS_ENABLE = _T("Z_POS_KEEP_PARAMS_ENABLE"); // 0 +const CString cs_Z_POS_KEEP_POS_WIN = _T("Z_POS_KEEP_POS_WIN"); // 0.000500 +const CString cs_Z_POS_KEEP_KP = _T("Z_POS_KEEP_KP"); // 1 +const CString cs_Z_POS_KEEP_KPF = _T("Z_POS_KEEP_KPF"); // 0.0000 +const CString cs_Z_POS_KEEP_KI = _T("Z_POS_KEEP_KI"); // 0 +const CString cs_Z_POS_KEEP_KIF = _T("Z_POS_KEEP_KIF"); // 0.0000 +const CString cs_Z_POS_KEEP_KD = _T("Z_POS_KEEP_KD"); // 0 +const CString cs_Z_POS_KEEP_IL = _T("Z_POS_KEEP_IL"); // 10000 +const CString cs_Z_POS_KEEP_KDD = _T("Z_POS_KEEP_KDD"); // 0 +const CString cs_Z_POS_KEEP_PARAM_10 = _T("Z_POS_KEEP_PARAM_10"); // 0 +const CString cs_Z_POS_KEEP_PARAM_11 = _T("Z_POS_KEEP_PARAM_11"); // 0 +const CString cs_Z_POS_KEEP_PARAM_12 = _T("Z_POS_KEEP_PARAM_12"); // 0 +const CString cs_Z_POS_KEEP_KSD = _T("Z_POS_KEEP_KSD"); // 0 +const CString cs_Z_POS_KEEP_KSP = _T("Z_POS_KEEP_KSP"); // 0 + +const CString cs_X_INDEX_OFFSET = _T("X_INDEX_OFFSET"); +const CString cs_Y_INDEX_OFFSET = _T("Y_INDEX_OFFSET"); +const CString cs_Z_INDEX_OFFSET = _T("Z_INDEX_OFFSET"); + +const CString USE_SECOND_X_INDEX_PULSE = _T("USE_SECOND_X_INDEX_PULSE"); // 0 +const CString USE_SECOND_Y_INDEX_PULSE = _T("USE_SECOND_Y_INDEX_PULSE"); // 0 +const CString USE_SECOND_Z_INDEX_PULSE = _T("USE_SECOND_Z_INDEX_PULSE"); // 0 +const CString SECOND_X_INDEX_OFFSET = _T("SECOND_X_INDEX_OFFSET"); // 0.000000000000 +const CString SECOND_Y_INDEX_OFFSET = _T("SECOND_Y_INDEX_OFFSET"); // 0.000000000000 +const CString SECOND_Z_INDEX_OFFSET = _T("SECOND_Z_INDEX_OFFSET"); // 0.000000000000 +const CString DUAL_X_INDEX_PULSE_SQUARENESS_THRESHOLD = _T("DUAL_X_INDEX_PULSE_SQUARENESS_THRESHOLD"); // 0.000000000000 +const CString DUAL_Y_INDEX_PULSE_SQUARENESS_THRESHOLD = _T("DUAL_Y_INDEX_PULSE_SQUARENESS_THRESHOLD"); // 0.000000000000 +const CString DUAL_Z_INDEX_PULSE_SQUARENESS_THRESHOLD = _T("DUAL_Z_INDEX_PULSE_SQUARENESS_THRESHOLD"); // 0.000000000000 + +const CString MACHINE_DATUM_AZIMUTH = _T("MACHINE_DATUM_AZIMUTH"); // 0.000000 +const CString MACHINE_DATUM_ELEVATION = _T("MACHINE_DATUM_ELEVATION"); // 0.000000 +const CString MACHINE_DATUM_SPIN = _T("MACHINE_DATUM_SPIN"); // 0.000000 + +const CString X_MACHINE_OFFSET = _T("X_MACHINE_OFFSET"); // 0.000000000000 +const CString Y_MACHINE_OFFSET = _T("Y_MACHINE_OFFSET"); // 0.000000000000 +const CString Z_MACHINE_OFFSET = _T("Z_MACHINE_OFFSET"); // 0.000000000000 +const CString XY_SQUARE_FACTOR = _T("XY_SQUARE_FACTOR"); // 0.000000000000 +const CString XZ_SQUARE_FACTOR = _T("XZ_SQUARE_FACTOR"); // 0.000000000000 +const CString YZ_SQUARE_FACTOR = _T("YZ_SQUARE_FACTOR"); // 0.000000000000 + +const CString cs_AG_X_ROLLOFF = _T("AG_X_ROLLOFF"); +const CString cs_AG_Y_ROLLOFF = _T("AG_Y_ROLLOFF"); +const CString cs_AG_Z_ROLLOFF = _T("AG_Z_ROLLOFF"); +const CString cs_AG_ZM_ROLLOFF = _T("AG_ZM_ROLLOFF"); +const CString cs_AG_X_KSP = _T("AG_X_KSP"); +const CString cs_AG_Y_KSP = _T("AG_Y_KSP"); +const CString cs_AG_Z_KSP = _T("AG_Z_KSP"); +const CString cs_AG_ZM_KSP = _T("AG_ZM_KSP"); + +const CString cs_AG_X_SHAFT2SCALE = _T("AG_X_SHAFT2SCALE"); +const CString cs_AG_Y_SHAFT2SCALE = _T("AG_Y_SHAFT2SCALE"); +const CString cs_AG_Z_SHAFT2SCALE = _T("AG_Z_SHAFT2SCALE"); +const CString cs_AG_ZM_SHAFT2SCALE = _T("AG_ZM_SHAFT2SCALE"); + +const CString cs_PAN_VIDEO_X = _T("PAN_VIDEO_X"); +const CString cs_PAN_VIDEO_Y = _T("PAN_VIDEO_Y"); +const CString cs_ILL_LENS = _T("ILL_LENS"); +const CString cs_UNK17 = _T("UNK17"); +const CString cs_UNK18 = _T("UNK18"); +const CString cs_DOCKABLE_TOUCH_PROBE = _T("DOCKABLE_TOUCH_PROBE"); + +const CString cs_RING_KNOB_TO_LED_RING = _T("RING_KNOB_TO_LED_RING"); +const CString cs_USE_INDEX_PULSE = _T("USE_INDEX_PULSE"); +const CString cs_USE_PULSED_LIGHT_BOARD = _T("USE_PULSED_LIGHT_BOARD"); +const CString cs_WATT_WATCHER_TIMEOUT = _T("WATT_WATCHER_TIMEOUT"); +const CString cs_LASER_PRESENT = _T("LASER_PRESENT"); // 1 +const CString cs_LASER_STEP = _T("LASER_STEP"); // 10.00 +const CString cs_LASER_TIME = _T("LASER_TIME"); // 0.50 +const CString cs_LASER_OFFSET_Z = _T("LASER_OFFSET_Z"); // 0.020000 +const CString cs_UCC1_PRESENT = _T("UCC1_PRESENT"); // 0 +const CString cs_PH10_PRESENT = _T("PH10_PRESENT"); // 0 + +const CString cs_ROTARY_AZIMUTH_RADIANS = _T("ROTARY_AZIMUTH_RADIANS"); // 0.00544082 +const CString cs_ROTARY_ELEVATION_RADIANS = _T("ROTARY_ELEVATION_RADIANS"); // -0.00011438 +const CString ROTARY_X_INCHES = _T("ROTARY_X_INCHES"); // 6.264264 +const CString ROTARY_Y_INCHES = _T("ROTARY_Y_INCHES"); // 6.470182 +const CString ROTARY_Z_INCHES = _T("ROTARY_Z_INCHES"); // 4.323942 +const CString ROTARY_INDEX_LOCATION = _T("ROTARY_INDEX_LOCATION"); // 0 +const CString ROT2_INDEX_LOCATION = _T("ROT2_INDEX_LOCATION"); // 0 +const CString ROTARY_NEG_LIMIT = _T("ROTARY_NEG_LIMIT"); // -840000 +const CString ROTARY_POS_LIMIT = _T("ROTARY_POS_LIMIT"); // 120000 +const CString ROTARY_LEH_CW_HARD_LIM_ANGLE = _T("ROTARY_LEH_CW_HARD_LIM_ANGLE"); // 95.0000 +const CString ROTARY_LEH_CCW_HARD_LIM_ANGLE = _T("ROTARY_LEH_CCW_HARD_LIM_ANGLE"); // -95.0000 +const CString ROTARY_INDEX2QUAD = _T("ROTARY_INDEX2QUAD"); // 0 +const CString ROT2_INDEX2QUAD = _T("ROT2_INDEX2QUAD"); // 0 +const CString ROT2_AZIMUTH_RADIANS = _T("ROT2_AZIMUTH_RADIANS"); // -1.57000000 +const CString ROT2_ELEVATION_RADIANS = _T("ROT2_ELEVATION_RADIANS"); // 0.00000000 +const CString ROT2_X_INCHES = _T("ROT2_X_INCHES"); // 0.000000 +const CString ROT2_Y_INCHES = _T("ROT2_Y_INCHES"); // 0.000000 +const CString ROT2_Z_INCHES = _T("ROT2_Z_INCHES"); // 0.000000 +const CString ROTARY_CAL_DIAM = _T("ROTARY_CAL_DIAM"); // 0.078740 +const CString ROTARY_CAL_WIDTH = _T("ROTARY_CAL_WIDTH"); // 0.200000 +const CString ROTARY_USE_LIMIT = _T("ROTARY_USE_LIMIT"); // 0 +const CString WITNESS_MODE = _T("WITNESS_MODE"); // 1 +const CString WITNESS_X = _T("WITNESS_X"); // 0.833881 +const CString WITNESS_Y = _T("WITNESS_Y"); // 6.799659 +const CString WITNESS_Z = _T("WITNESS_Z"); // 6.498383 +const CString WITNESS_ZOOM = _T("WITNESS_ZOOM"); // 8495.000000 +const CString WITNESS_REPEATS = _T("WITNESS_REPEATS"); // 3 +const CString WITNESS_BACK = _T("WITNESS_BACK"); // 0 +const CString WITNESS_RING = _T("WITNESS_RING"); // 181 +const CString WITNESS_AUX = _T("WITNESS_AUX"); // 0 +const CString WITNESS_FRAME_INTEGRATION = _T("WITNESS_FRAME_INTEGRATION"); // 1 +const CString WITNESS_SRL_RING_1 = _T("WITNESS_SRL_RING_1"); // 0 +const CString WITNESS_SRL_RING_2 = _T("WITNESS_SRL_RING_2"); // 0 +const CString WITNESS_SRL_RING_3 = _T("WITNESS_SRL_RING_3"); // 0 +const CString WITNESS_SRL_RING_4 = _T("WITNESS_SRL_RING_4"); // 0 +const CString WITNESS_SRL_RING_5 = _T("WITNESS_SRL_RING_5"); // 0 +const CString WITNESS_SRL_RING_6 = _T("WITNESS_SRL_RING_6"); // 0 +const CString WITNESS_SRL_RING_7 = _T("WITNESS_SRL_RING_7"); // 0 +const CString WITNESS_SRL_RING_8 = _T("WITNESS_SRL_RING_8"); // 0 +const CString WITNESS_FOCUS_SIZE_1 = _T("WITNESS_FOCUS_SIZE_1"); // 60 +const CString WITNESS_FOCUS_SIZE_2 = _T("WITNESS_FOCUS_SIZE_2"); // 60 +const CString SPHERE_FOCUS_SIZE_1 = _T("SPHERE_FOCUS_SIZE_1"); // 60 +const CString SPHERE_FOCUS_SIZE_2 = _T("SPHERE_FOCUS_SIZE_2"); // 60 +const CString JOBLOCK_FOCUS_SIZE_1 = _T("JOBLOCK_FOCUS_SIZE_1"); // 60 +const CString JOBLOCK_FOCUS_SIZE_2 = _T("JOBLOCK_FOCUS_SIZE_2"); // 60 +const CString ROTARY_FORCE_HOME = _T("ROTARY_FORCE_HOME"); // 0 + +//const CString cs_MAX_ZOOM_COUNTS = _T("MAX_ZOOM_COUNTS"); + +const long EEPROMBYTES = 0x1FFF; + +enum eFILEWRITEMODE { + eCFGTEXTMODE , + eHEXMODE +}; + +class CSSIData { + +public: + CSSIData() + { + ROTARY_SLOW_VELOCITY = 24; + ROTARY_MEDIUM_VELOCITY = 25; + ROTARY_FAST_VELOCITY = 26; + EDGE_RETRY_TIMEOUT_X = 510; + EDGE_RETRY_TIMEOUT_Y = 500; + EDGE_RETRY_TIMEOUT_Z = 500; + EDGE_RETRY_TIMEOUT_MAG = 500; + EDGE_RETRY_BANDWIDTH_X = 50; + EDGE_RETRY_BANDWIDTH_Y = 50; + EDGE_RETRY_BANDWIDTH_Z = 50; + EDGE_RETRY_BANDWIDTH_MAG = 50; + EDGE_RETRY_COUNT_X = 1; + EDGE_RETRY_COUNT_Y = 1; + EDGE_RETRY_COUNT_Z = 1; + EDGE_RETRY_COUNT_MAG = 1; + MM_XY_PIXEL_MOTION_TOLERANCE = 10; + MM_Z_INCH_MOTION_TOLERANCE = 0.000100; + MM_ZOOM_PERCENT_MOTION_TOLERANCE = 2; + LIGHT_SETTLE_TIME = 30; + BACK_LIGHT_MAPPING = 10753; + RING_LIGHT_MAPPING = 1154; + AUX_LIGHT_MAPPING = 33028; + GRID_LIGHT_MAPPING = 16384; + RING_KNOB_TO_LED_RING = 2; + ROTARY_AZIMUTH_RADIANS = 0.0; + LASER_STEP = 10; + PRIMARY_ROTARY_SERVO_KP = 0; + PRIMARY_ROTARY_SERVO_KI = 0; + PRIMARY_ROTARY_SERVO_KIC = 0; + PRIMARY_ROTARY_SERVO_KDD = 0; + PRIMARY_ROTARY_SERVO_IL = 0; + PRIMARY_ROTARY_SERVO_KSP = 0; + PRIMARY_ROTARY_SERVO_KSD = 0; + PRIMARY_ROTARY_XCESS_PERR = 0; + PRIMARY_ROTARY_TRAJECTORY_FILTER = 0; + SECONDARY_ROTARY_SERVO_KP = 0; + SECONDARY_ROTARY_SERVO_KI = 0; + SECONDARY_ROTARY_SERVO_KIC = 0; + SECONDARY_ROTARY_SERVO_KDD = 0; + SECONDARY_ROTARY_SERVO_IL = 0; + SECONDARY_ROTARY_SERVO_KSP = 0; + SECONDARY_ROTARY_SERVO_KSD = 0; + SECONDARY_ROTARY_XCESS_PERR = 0; + SECONDARY_ROTARY_TRAJECTORY_FILTER = 0; + WATT_WATCHER_TIMEOUT = 19; + + X_POS_KEEP_PARAMS_ENABLE = 0; + X_POS_KEEP_POS_WIN = 0.0; + X_POS_KEEP_KP = 0; + X_POS_KEEP_KPF = 0.0; + X_POS_KEEP_KI = 0; + X_POS_KEEP_KIF = 0.0; + X_POS_KEEP_KD = 0.0; + X_POS_KEEP_IL = 0; + X_POS_KEEP_KDD = 0.0; + X_POS_KEEP_KSD = 0.0; + X_POS_KEEP_KSP = 0.0; + X_POS_KEEP_PARAM_10 = 100; + X_POS_KEEP_PARAM_11 = 127; + X_POS_KEEP_PARAM_12 = 258; + Y_POS_KEEP_PARAMS_ENABLE = 0; + Y_POS_KEEP_POS_WIN = 0.0; + Y_POS_KEEP_KP = 0; + Y_POS_KEEP_KPF = 0.0; + Y_POS_KEEP_KI = 0; + Y_POS_KEEP_KIF = 0.0; + Y_POS_KEEP_KD = 0.0; + Y_POS_KEEP_IL = 0.0; + Y_POS_KEEP_KDD = 0.0; + Y_POS_KEEP_KSD = 0.0; + Y_POS_KEEP_KSP = 0.0; + Y_POS_KEEP_PARAM_10 = 100; + Y_POS_KEEP_PARAM_11 = 127; + Y_POS_KEEP_PARAM_12 = 258; + Z_POS_KEEP_PARAMS_ENABLE = 0; + Z_POS_KEEP_POS_WIN = 0.0; + Z_POS_KEEP_KP = 0; + Z_POS_KEEP_KPF = 0.0; + Z_POS_KEEP_KI = 0; + Z_POS_KEEP_KIF = 0.0; + Z_POS_KEEP_KD = 0.0; + Z_POS_KEEP_IL = 0; + Z_POS_KEEP_KDD = 0.0; + Z_POS_KEEP_KSD = 0.0; + Z_POS_KEEP_KSP = 0.0; + Z_POS_KEEP_PARAM_10 = 30; + Z_POS_KEEP_PARAM_11 = 128; + Z_POS_KEEP_PARAM_12 = 255; + X_BREAK_THRESHOLD = 0; + Y_BREAK_THRESHOLD = 0; + Z_BREAK_THRESHOLD = 0; + ZM_BREAK_THRESHOLD = 0; + + X_BREAK_TICKS = 0; + Y_BREAK_TICKS = 0; + Z_BREAK_TICKS = 0; + ZM_BREAK_TICKS = 0; + + AG_X_UCC_KP = 0; + AG_X_UCC_KI = 0; + AG_Y_UCC_KP = 0; + AG_Y_UCC_KI = 0; + AG_Z_UCC_KP = 0; + AG_Z_UCC_KI = 0; + AG_ZM_UCC_KP = 0; + AG_ZM_UCC_KI = 0; + AG_ZM_SERVO_KP = 0; + AG_ZM_SERVO_KI = 0; + + DSP_CONFIG_AG_X_SERVO_UCC = 0; + DSP_CONFIG_AG_Y_SERVO_UCC = 0; + DSP_CONFIG_AG_Z_SERVO_UCC = 0; + DSP_CONFIG_AG_ZM_SERVO_UCC = 0; + DSP_CONFIG_MOTOR_TYPE = 0; + + DSP_CONFIG_JS_X_SERVO_UNK1 = 1330089; + DSP_CONFIG_JS_X_SERVO_UNK2 = -1284921; + DSP_CONFIG_X_SERVO_UNK1 = 1584089; + DSP_CONFIG_X_SERVO_UNK2 = -1538920; + DSP_CONFIG_JS_Y_SERVO_UNK1 = 702336; + DSP_CONFIG_JS_Y_SERVO_UNK2 =-337534; + DSP_CONFIG_Y_SERVO_UNK1 = 956336; + DSP_CONFIG_Y_SERVO_UNK2 = -591533; + DSP_CONFIG_JS_Z_SERVO_UNK1 = 782984; + DSP_CONFIG_JS_Z_SERVO_UNK2 = -860507; + DSP_CONFIG_Z_SERVO_UNK1 = 1037001; + DSP_CONFIG_Z_SERVO_UNK2 = -1114524; + DSP_CONFIG_JS_ZM_SERVO_UNK1 = 16934; + DSP_CONFIG_JS_ZM_SERVO_UNK2 = 13; + DSP_CONFIG_ZM_SERVO_UNK1 = 16934; + DSP_CONFIG_ZM_SERVO_UNK2 = 13; + + bDSP_SetKeepParameters = FALSE; + bDSP_Process_JS_Unk1 = FALSE; + bDSP_GetCurrentServoParameters = FALSE; + bDSP_SetDefaultServoParameters = FALSE; + bDSP_PreStartController = FALSE; + LASER_PRESENT = 0; // 0 OR 1 + TP_DO_ARC_MOTION = 0; + + LPT = 1; + bLoadSSEEPROM = FALSE; + EEPROMDumpFileTxt = _T("EEPROM_PCDMIS.DAT"); + EEPROMDumpFileHex = _T("EEPROM_PCDMIS.HEX"); + memset(m_EEPROM.EEPROM_Bytes, 0x00, EEPROMBYTES); + + + m_EEPROM.ConfigData.e_TP_JS_SPEED_RATIO = 2; + + }; + + ~CSSIData() + { + }; + +public: + +#pragma pack(1) + union { + BYTE EEPROM_Bytes[EEPROMBYTES]; + struct { + BYTE e_SerialNo[16]; + BYTE e_pad_1[80]; // don't know what this is + double e_X_Non_linear_Correction_table[25]; + double e_Y_Non_linear_Correction_table[25]; + double e_X_Deviation_table[25]; + double e_Y_Deviation_table[25]; + unsigned long e_JS_MAX_VELOCITY_X; // 681288 + unsigned long e_JS_MAX_VELOCITY_Y; // 681288 + unsigned long e_JS_MAX_VELOCITY_Z; // 349524 + unsigned long e_JS_MAX_VELOCITY_ZM; // 98304 + unsigned short e_JS_X_SERVO_SWAP; // 1 + unsigned short e_JS_X_SERVO_KP; // 4 + unsigned short e_JS_X_SERVO_KI; // 0 + unsigned short e_JS_X_SERVO_KD; // 0 + unsigned short e_JS_X_SERVO_IL; // 0 + unsigned short e_JS_Y_SERVO_SWAP; // -1 + unsigned short e_JS_Y_SERVO_KP; // 4 + unsigned short e_JS_Y_SERVO_KI; // 0 + unsigned short e_JS_Y_SERVO_KD; // 0 + unsigned short e_JS_Y_SERVO_IL; // 0 + unsigned short e_JS_Z_SERVO_SWAP; // -1 + unsigned short e_JS_Z_SERVO_KP; // 4 + unsigned short e_JS_Z_SERVO_KI; // 0 + unsigned short e_JS_Z_SERVO_KD; // 0 + unsigned short e_JS_Z_SERVO_IL; // 0 + unsigned short e_JS_ZM_SERVO_SWAP; // -1 + unsigned short e_JS_ZM_SERVO_KP; // 100 + unsigned short e_JS_ZM_SERVO_KI; // 0 + unsigned short e_JS_ZM_SERVO_KD; // 0 + unsigned short e_JS_ZM_SERVO_IL; // 0 + unsigned long e_TB_X_SERVO_ACC; // 50000 + unsigned long e_TB_X_SERVO_VEL; // 681288 + unsigned short e_TB_X_SERVO_KP; // 8 + unsigned short e_TB_X_SERVO_KI; // 0 + unsigned short e_TB_X_SERVO_KD; // 0 + unsigned short e_TB_X_SERVO_IL; // 0 + unsigned short e_TB_X_SERVO_SWAP; // 0 + unsigned long e_TB_Y_SERVO_ACC; // 50000 + unsigned long e_TB_Y_SERVO_VEL; // 681288 + unsigned short e_TB_Y_SERVO_KP; // 8 + unsigned short e_TB_Y_SERVO_KI; // 0 + unsigned short e_TB_Y_SERVO_KD; // 0 + unsigned short e_TB_Y_SERVO_IL; // 0 + unsigned short e_TB_Y_SERVO_SWAP; // 0 + unsigned long e_AG_X_SERVO_ACC; // 50000 + unsigned long e_AG_X_SERVO_VEL; // 681288 + unsigned short e_AG_X_SERVO_KP; // 4 + unsigned short e_AG_X_SERVO_KI; // 0 + unsigned short e_AG_X_SERVO_KD; // 0 + unsigned short e_AG_X_SERVO_IL; // 0 + unsigned long e_AG_Y_SERVO_ACC; // 50000 + unsigned long e_AG_Y_SERVO_VEL; // 681288 + unsigned short e_AG_Y_SERVO_KP; // 4 + unsigned short e_AG_Y_SERVO_KI; // 0 + unsigned short e_AG_Y_SERVO_KD; // 0 + unsigned short e_AG_Y_SERVO_IL; // 0 + unsigned long e_AG_Z_SERVO_ACC; // 160000 + unsigned long e_AG_Z_SERVO_VEL; // 349524 + unsigned short e_AG_Z_SERVO_KP; // 4 + unsigned short e_AG_Z_SERVO_KI; // 0 + unsigned short e_AG_Z_SERVO_KD; // 0 + unsigned short e_AG_Z_SERVO_IL; // 0 + unsigned long e_AG_ZM_SERVO_ACC; // 1524 + unsigned long e_AG_ZM_SERVO_VEL; // 98304 + unsigned short e_AG_ZM_SERVO_KP; // 100 + unsigned short e_AG_ZM_SERVO_KI; // 0 + unsigned short e_AG_ZM_SERVO_IL; // 0 + unsigned short e_AG_ZM_SERVO_KD; // 0 + double e_MAX_ZOOM_COUNTS; // 14477.000000 + double e_Zoom_Lens_Magnification_Calibration_Table[101]; + double e_X_SCALE_FACTOR; // 0.000020 + double e_Y_SCALE_FACTOR; // 0.000020 + double e_Z_SCALE_FACTOR; // 0.000020 + double e_XY_SCALE_FACTOR; // 0.000000 + double e_XZ_SCALE_FACTOR; // 0.000000 + double e_YZ_SCALE_FACTOR; // 0.000000 + double e_X_LOW_FOV_INCHES; // 0.536659 + double e_X_HIGH_FOV_INCHES; // 0.091453 + double e_Y_LOW_FOV_INCHES; // 0.542137 + double e_Y_HIGH_FOV_INCHES; // 0.092425 + double e_EDGE_CONTRAST_THRESHOLD; // 1.000000 + double e_EDGE_X_SLOPE; // 1.245098 + double e_EDGE_Y_SLOPE; // 1.000000 + double e_EDGE_X_OFFSET; // -7.500000 + double e_EDGE_Y_OFFSET; // -16.000000 + unsigned short e_EDGE_IS_CALIBRATED; // 0 + unsigned short e_EDGE_AUTO_FOV; // 0 + double e_EDGE_RELATIVE_MAG; // 1.000000 + double e_EDGE_ZOOM_RATIO; // 6.000000 + unsigned short e_EDGE_FRAME_AVERAGES; // 2 + unsigned short e_EDGE_AUTO_REMEASURE; // 1 + unsigned short e_EDGE_TARGET_SIZE; // 30 + unsigned short e_OPTICS_TUBE; // 0 + unsigned short e_OPTICS_LENS; // 0 + double e_X_STAGE_TRAVEL; // 8.000000 + double e_Y_STAGE_TRAVEL; // 6.000000 + double e_Z_STAGE_TRAVEL; // 8.000000 + BYTE e_BACK_LIGHT_OFFSET; // 0 + BYTE e_RING_LIGHT_OFFSET; // 0 + BYTE e_AUX_LIGHT_OFFSET; // 0 + unsigned long e_AG_X_SERVO_PRE_VEL; // 681288 + unsigned long e_AG_Y_SERVO_PRE_VEL; // 681288 + unsigned long e_AG_Z_SERVO_PRE_VEL; // 349524 + unsigned long e_ZM_SERVO_PRE_VEL; // 98304 + short e_X_SERVO_XCESS_PERR; // 0 + short e_Y_SERVO_XCESS_PERR; // 0 + short e_Z_SERVO_XCESS_PERR; // 0 + short e_ZM_SERVO_XCESS_PERR; // 0 + short e_AG_X_POS_WIN; // 2 + short e_AG_Y_POS_WIN; // 2 + short e_AG_Z_POS_WIN; // 2 + short e_AG_ZM_POS_WIN; // 0 + short e_X_SCALE_SWAP; // 1 + short e_Y_SCALE_SWAP; // -1 + short e_Z_SCALE_SWAP; // 1 + short e_SECOND_X_SCALE_SWAP; // 1 + short e_SECOND_Y_SCALE_SWAP; // 1 + double e_SECOND_X_SCALE_FACTOR; // 0.000000 + double e_SECOND_Y_SCALE_FACTOR; // 0.000000 + short e_USE_SECOND_X_SCALE; // 0 + short e_USE_SECOND_Y_SCALE; // 0 + double e_OFFSET_X_LIMIT; // 0.000000 + double e_OFFSET_Y_LIMIT; // 0.000000 + double e_OFFSET_Z_LIMIT; // 0.000000 + short e_FORCE_STAGE_INIT; // 1 + double e_JS_X_NEG_PRELIM_OFFSET; // 0.000000 + double e_JS_Y_NEG_PRELIM_OFFSET; // 0.000000 + double e_JS_Z_NEG_PRELIM_OFFSET; // 0.000000 + double e_JS_ZM_NEG_PRELIM; // 0.000000 + double e_JS_X_POS_PRELIM_OFFSET; // 0.000000 + double e_JS_Y_POS_PRELIM_OFFSET; // 0.000000 + double e_JS_Z_POS_PRELIM_OFFSET; // 0.000000 + double e_JS_ZM_POS_PRELIM; // 0.000000 + double e_AG_X_NEG_PRELIM_OFFSET; // 0.000000 + double e_AG_Y_NEG_PRELIM_OFFSET; // 0.000000 + double e_AG_Z_NEG_PRELIM_OFFSET; // 0.000000 + double e_AG_ZM_NEG_PRELIM; // 0.0000001 + double e_AG_X_POS_PRELIM_OFFSET; // 0.000000 + double e_AG_Y_POS_PRELIM_OFFSET; // 0.000000 + double e_AG_Z_POS_PRELIM_OFFSET; // 0.000000 + double e_AG_ZM_POS_PRELIM; // 0.000000 + double e_AG_MIN_MOVE_TIME; // 0.000000 + + unsigned short e_JS_X_SERVO_KDD; // 0 + unsigned short e_JS_X_SERVO_KSD; // 1000 + unsigned short e_JS_X_SERVO_AFF; // 0 + unsigned short e_JS_X_SERVO_VFF; // 500 + + unsigned short e_JS_Y_SERVO_KDD; // 0 + unsigned short e_JS_Y_SERVO_KSD; // 1000 + unsigned short e_JS_Y_SERVO_AFF; // 0 + unsigned short e_JS_Y_SERVO_VFF; // 500 + + unsigned short e_JS_Z_SERVO_KDD; // 2000 + unsigned short e_JS_Z_SERVO_KSD; // 1000 + unsigned short e_JS_Z_SERVO_AFF; // 0 + unsigned short e_JS_Z_SERVO_VFF; // 500 + + unsigned short e_TB_X_SERVO_KDD; // 0 + unsigned short e_TB_X_SERVO_KSD; // 1000 + unsigned short e_TB_X_SERVO_AFF; // 0 + unsigned short e_TB_X_SERVO_VFF; // 500 + + unsigned short e_TB_Y_SERVO_KDD; // 0 + unsigned short e_TB_Y_SERVO_KSD; // 1000 + unsigned short e_TB_Y_SERVO_AFF; // 0 + unsigned short e_TB_Y_SERVO_VFF; // 500 + + unsigned short e_AG_X_SERVO_KDD; // 0 + unsigned short e_AG_X_SERVO_KSD; // 1000 + unsigned short e_AG_X_SERVO_AFF; // 0 + unsigned short e_AG_X_SERVO_VFF; // 500 + unsigned short e_AG_X_SERVO_PID_SWAP; // 1 + + unsigned short e_AG_Y_SERVO_KDD; // 0 + unsigned short e_AG_Y_SERVO_KSD; // 1000 + unsigned short e_AG_Y_SERVO_AFF; // 0 + unsigned short e_AG_Y_SERVO_VFF; // 500 + unsigned short e_AG_Y_SERVO_PID_SWAP; // 1 + + unsigned short e_AG_Z_SERVO_KDD; // 2000 + unsigned short e_AG_Z_SERVO_KSD; // 1000 + unsigned short e_AG_Z_SERVO_AFF; // 0 + unsigned short e_AG_Z_SERVO_VFF; // 1000 + unsigned short e_AG_Z_SERVO_PID_SWAP; // 0 + + unsigned short e_AG_ZM_SERVO_PID_SWAP; //1 + + unsigned long e_TP_AP_X_SERVO_ACC; //7500 + unsigned long e_TP_AP_X_SERVO_VEL; // 238450 + unsigned short e_TP_AP_X_SERVO_KP; // 0 + unsigned short e_TP_AP_X_SERVO_KI; // 0 + unsigned short e_TP_AP_X_SERVO_KD; // 0 + unsigned short e_TP_AP_X_SERVO_IL; // 0 + unsigned short e_TP_AP_X_SERVO_KDD; // 0 + unsigned short e_TP_AP_X_SERVO_KSD; // 0 + unsigned short e_TP_AP_X_SERVO_AFF; // 0 + unsigned short e_TP_AP_X_SERVO_VFF; // 0 + unsigned short e_TP_AP_X_SERVO_PID_SWAP; //0 + + unsigned long e_TP_AP_Y_SERVO_ACC; //7500 + unsigned long e_TP_AP_Y_SERVO_VEL; // 238450 + unsigned short e_TP_AP_Y_SERVO_KP; // 0 + unsigned short e_TP_AP_Y_SERVO_KI; // 0 + unsigned short e_TP_AP_Y_SERVO_KD; // 0 + unsigned short e_TP_AP_Y_SERVO_IL; // 0 + unsigned short e_TP_AP_Y_SERVO_KDD; // 0 + unsigned short e_TP_AP_Y_SERVO_KSD; // 0 + unsigned short e_TP_AP_Y_SERVO_AFF; // 0 + unsigned short e_TP_AP_Y_SERVO_VFF; // 0 + unsigned short e_TP_AP_Y_SERVO_PID_SWAP; //0 + + unsigned long e_TP_AP_Z_SERVO_ACC; //7500 + unsigned long e_TP_AP_Z_SERVO_VEL; // 238450 + unsigned short e_TP_AP_Z_SERVO_KP; // 0 + unsigned short e_TP_AP_Z_SERVO_KI; // 0 + unsigned short e_TP_AP_Z_SERVO_KD; // 0 + unsigned short e_TP_AP_Z_SERVO_IL; // 0 + unsigned short e_TP_AP_Z_SERVO_KDD; // 0 + unsigned short e_TP_AP_Z_SERVO_KSD; // 0 + unsigned short e_TP_AP_Z_SERVO_AFF; // 0 + unsigned short e_TP_AP_Z_SERVO_VFF; // 0 + unsigned short e_TP_AP_Z_SERVO_PID_SWAP; //0 + + unsigned short e_TP_JS_SPEED_RATIO; // 2 + unsigned short e_DOCKABLE_TOUCH_PROBE; // 2 + + double e_X_INDEX_OFFSET; // 1.503326743391 + double e_Y_INDEX_OFFSET; // 5.563602257609 + double e_Z_INDEX_OFFSET; // 1.175433201424 + + unsigned short e_USE_INDEX_PULSE; //1 + unsigned short e_AG_X_ROLLOFF; //2 + unsigned short e_AG_Y_ROLLOFF; //2 + unsigned short e_AG_Z_ROLLOFF; //0 + unsigned short e_AG_ZM_ROLLOFF; //0 + unsigned short e_AG_X_KSP; //100 + unsigned short e_AG_Y_KSP; //100 + unsigned short e_AG_Z_KSP; //0 + unsigned short e_AG_ZM_KSP; //0 + + double e_AG_X_SHAFT2SCALE; // 0.38100 + double e_AG_Y_SHAFT2SCALE; // 0.3800 + double e_AG_Z_SHAFT2SCALE; // 0.00 + double e_AG_ZM_SHAFT2SCALE; // 0.00 + unsigned short e_SECOND_Z_SCALE_SWAP; //0 + double e_SECOND_Z_SCALE_FACTOR; //0 + unsigned short e_USE_SECOND_Z_SCALE; //0 + unsigned short e_PAN_VIDEO_X; //0 + unsigned short e_PAN_VIDEO_Y; //0 + unsigned short e_ILL_LENS; //0 + double e_AG_X_SERVO_LOW_ACC_DIST; // 0.000000000000 + double e_AG_Y_SERVO_LOW_ACC_DIST; // 0.000000000000 + double e_AG_Z_SERVO_LOW_ACC_DIST; // 0.000000000000 + double e_JS_X_SERVO_KPF; // 0.000000000000 + double e_JS_X_SERVO_KIF; // 0.000000000000 + double e_JS_Y_SERVO_KPF; // 0.000000000000 + double e_JS_Y_SERVO_KIF; // 0.000000000000 + double e_JS_Z_SERVO_KPF; // 0.000000000000 + double e_JS_Z_SERVO_KIF; // 0.000000000000 + double e_JS_ZM_SERVO_KPF; // 0.000000000000 + double e_JS_ZM_SERVO_KIF; // 0.000000000000 + double e_TB_X_SERVO_KPF; // 0.000000000000 + double e_TB_X_SERVO_KIF; // 0.000000000000 + double e_TB_Y_SERVO_KPF; // 0.000000000000 + double e_TB_Y_SERVO_KIF; // 0.000000000000 + double e_AG_X_SERVO_KPF; // 0.000000000000 + double e_AG_X_SERVO_KIF; // 0.000000000000 + double e_AG_Y_SERVO_KPF; // 0.000000000000 + double e_AG_Y_SERVO_KIF; // 0.000000000000 + double e_AG_Z_SERVO_KPF; // 0.000000000000 + double e_AG_Z_SERVO_KIF; // 0.000000000000 + double e_AG_ZM_SERVO_KPF; // 0.000000000000 + double e_AG_ZM_SERVO_KIF; // 0.000000000000 + } + ConfigData; + }m_EEPROM; + + int Read_EEPROM_From_File(eFILEWRITEMODE eMode, CString FileName); + int Read_CSG_Config_File(CString FileName); + int ParseLineArrayData(CString csDataStr, CString csToken, long lMaxCnt, double *DataArray ); + int Write_EEPROM_To_File(eFILEWRITEMODE eMode, CString FileName); + int Hex_Diff_To_File(CSSIData *pDataDiff1,CSSIData *pDataDiff2, CString FileName); + + void Get_Cfg_Filename(CString &FileName); + void Get_Laser_Cfg_Filename(CString &FileName); + void Get_RegToFile_Cfg_Filename(CString &FileName); + + void ExtractAppPath(CString &Path) + { + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } else { // not a complete path + Path=""; + }; + }; + + void GetAppPath(CString &Path) + { + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return; + }; + unsigned short slack_bytes[200]; + unsigned short BACK_LIGHT_MAPPING; // 10753 + unsigned short RING_LIGHT_MAPPING; // 1154 + unsigned short AUX_LIGHT_MAPPING; // 33028 + unsigned short GRID_LIGHT_MAPPING; // 16384 + unsigned short RING_KNOB_TO_LED_RING; // 2 + unsigned short ROTARY_SLOW_VELOCITY; + unsigned short ROTARY_MEDIUM_VELOCITY; // 48 + unsigned short ROTARY_FAST_VELOCITY; // 96 + unsigned short PRIMARY_ROTARY_SERVO_KP; // 16 + unsigned short PRIMARY_ROTARY_SERVO_KI; // 2000 + unsigned short PRIMARY_ROTARY_SERVO_KIC; // 16000 + unsigned short PRIMARY_ROTARY_SERVO_KDD; // 16 + unsigned short PRIMARY_ROTARY_SERVO_IL; // 500 + unsigned short PRIMARY_ROTARY_SERVO_KSP; // 8 + unsigned short PRIMARY_ROTARY_SERVO_KSD; // 16 + unsigned short PRIMARY_ROTARY_XCESS_PERR; // 0 + unsigned short PRIMARY_ROTARY_TRAJECTORY_FILTER; // 4 + unsigned short SECONDARY_ROTARY_SERVO_KP; // 20 + unsigned short SECONDARY_ROTARY_SERVO_KI; // 2000 + unsigned short SECONDARY_ROTARY_SERVO_KIC; // 16000 + unsigned short SECONDARY_ROTARY_SERVO_KDD; // 16 + unsigned short SECONDARY_ROTARY_SERVO_IL; // 500 + unsigned short SECONDARY_ROTARY_SERVO_KSP; // 8 + unsigned short SECONDARY_ROTARY_SERVO_KSD; // 16 + unsigned short SECONDARY_ROTARY_XCESS_PERR; // 0 + unsigned short SECONDARY_ROTARY_TRAJECTORY_FILTER; // 2 + + long EDGE_RETRY_TIMEOUT_X; //300 + long EDGE_RETRY_TIMEOUT_Y; //300 + long EDGE_RETRY_TIMEOUT_Z; //300 + long EDGE_RETRY_TIMEOUT_MAG; //300 + long EDGE_RETRY_BANDWIDTH_X; //50 + long EDGE_RETRY_BANDWIDTH_Y; //50 + long EDGE_RETRY_BANDWIDTH_Z; //50 + long EDGE_RETRY_BANDWIDTH_MAG; //50 + long EDGE_RETRY_COUNT_X; //1 + long EDGE_RETRY_COUNT_Y; //1 + long EDGE_RETRY_COUNT_Z; //1 + long EDGE_RETRY_COUNT_MAG; //1 + long MM_XY_PIXEL_MOTION_TOLERANCE; //10 + double MM_Z_INCH_MOTION_TOLERANCE; //0.000100 + long MM_ZOOM_PERCENT_MOTION_TOLERANCE; //2 + long LIGHT_SETTLE_TIME; //30 + double ROTARY_AZIMUTH_RADIANS; + unsigned short LASER_PRESENT; // 0 OR 1 + unsigned short TP_DO_ARC_MOTION; + unsigned short WATT_WATCHER_TIMEOUT; + unsigned short LASER_STEP; // 10 + + unsigned short X_POS_KEEP_PARAMS_ENABLE; // 0 + double X_POS_KEEP_POS_WIN; // 0.000500 + unsigned short X_POS_KEEP_KP; // 1 + double X_POS_KEEP_KPF; // 0.0000 + unsigned short X_POS_KEEP_KI; // 0 + double X_POS_KEEP_KIF; // 0.0000 + double X_POS_KEEP_KD; // 0 + unsigned short X_POS_KEEP_IL; // 10000 + double X_POS_KEEP_KDD; // 0 + double X_POS_KEEP_KSD; // 0 + double X_POS_KEEP_KSP; // 0 + unsigned short X_POS_KEEP_PARAM_10; // 0 + unsigned short X_POS_KEEP_PARAM_11; // 0 + unsigned short X_POS_KEEP_PARAM_12; // 0 + + unsigned short Y_POS_KEEP_PARAMS_ENABLE; // 0 + double Y_POS_KEEP_POS_WIN; // 0.000500 + unsigned short Y_POS_KEEP_KP; // 1 + double Y_POS_KEEP_KPF; // 0.0000 + unsigned short Y_POS_KEEP_KI; // 0 + double Y_POS_KEEP_KIF; // 0.0000 + double Y_POS_KEEP_KD; // 0 + double Y_POS_KEEP_IL; // 10000 + double Y_POS_KEEP_KDD; // 0 + double Y_POS_KEEP_KSD; // 0 + double Y_POS_KEEP_KSP; // 0 + unsigned short Y_POS_KEEP_PARAM_10; // 0 + unsigned short Y_POS_KEEP_PARAM_11; // 0 + unsigned short Y_POS_KEEP_PARAM_12; // 0 + + unsigned short Z_POS_KEEP_PARAMS_ENABLE; // 0 + double Z_POS_KEEP_POS_WIN; // 0.000500 + unsigned short Z_POS_KEEP_KP; // 1 + double Z_POS_KEEP_KPF; // 0.0000 + unsigned short Z_POS_KEEP_KI; // 0 + double Z_POS_KEEP_KIF; // 0.0000 + double Z_POS_KEEP_KD; // 0 + unsigned short Z_POS_KEEP_IL; // 10000 + double Z_POS_KEEP_KDD; // 0 + double Z_POS_KEEP_KSD; // 0 + double Z_POS_KEEP_KSP; // 0 + unsigned short Z_POS_KEEP_PARAM_10; // 0 + unsigned short Z_POS_KEEP_PARAM_11; // 0 + unsigned short Z_POS_KEEP_PARAM_12; // 0 + + unsigned short X_BREAK_THRESHOLD; + unsigned short Y_BREAK_THRESHOLD; + unsigned short Z_BREAK_THRESHOLD; + unsigned short ZM_BREAK_THRESHOLD; + + int X_BREAK_TICKS; + int Y_BREAK_TICKS; + int Z_BREAK_TICKS; + int ZM_BREAK_TICKS; + + int AG_X_UCC_KP; + int AG_X_UCC_KI; + int AG_Y_UCC_KP; + int AG_Y_UCC_KI; + int AG_Z_UCC_KP; + int AG_Z_UCC_KI; + int AG_ZM_UCC_KP; + int AG_ZM_UCC_KI; + int AG_ZM_SERVO_KP; + int AG_ZM_SERVO_KI; + + WORD DSP_CONFIG_Poll_Init_Value1; + WORD DSP_CONFIG_Poll_Init_Value2; + WORD DSP_CONFIG_AG_X_SERVO_UCC; + WORD DSP_CONFIG_AG_Y_SERVO_UCC; + WORD DSP_CONFIG_AG_Z_SERVO_UCC; + WORD DSP_CONFIG_AG_ZM_SERVO_UCC; + WORD DSP_CONFIG_MOTOR_TYPE; + long DSP_CONFIG_JS_X_SERVO_UNK1; + long DSP_CONFIG_JS_X_SERVO_UNK2; + long DSP_CONFIG_X_SERVO_UNK1; + long DSP_CONFIG_X_SERVO_UNK2; + long DSP_CONFIG_JS_Y_SERVO_UNK1; + long DSP_CONFIG_JS_Y_SERVO_UNK2; + long DSP_CONFIG_Y_SERVO_UNK1; + long DSP_CONFIG_Y_SERVO_UNK2; + long DSP_CONFIG_JS_Z_SERVO_UNK1; + long DSP_CONFIG_JS_Z_SERVO_UNK2; + long DSP_CONFIG_Z_SERVO_UNK1; + long DSP_CONFIG_Z_SERVO_UNK2; + long DSP_CONFIG_JS_ZM_SERVO_UNK1; + long DSP_CONFIG_JS_ZM_SERVO_UNK2; + long DSP_CONFIG_ZM_SERVO_UNK1; + long DSP_CONFIG_ZM_SERVO_UNK2; + + WORD DSP_CONFIG_LightsAuxAddrH; + WORD DSP_CONFIG_UnkAddr_RingMap_01; + WORD DSP_CONFIG_UnkAddr_RingMap_02; + WORD DSP_CONFIG_PrehitRetractDistAddr2; + + // END of block from hardware.cfg that is not in EEPROM + + // The following tags control whether a function should run based on the + // dsp_pcdmis.cfg file There is one such file per machine + // accompanying this file is the dsp.var.comm.txt which further defines + // the detail communication data. + BOOL bDSP_SetKeepParameters; + BOOL bDSP_GetCurrentServoParameters; + BOOL bDSP_SetDefaultServoParameters; + BOOL bDSP_PreStartController; + BOOL bDSP_Process_JS_Unk1; + BOOL bDSP_Pre_Download_MicroCode; + BOOL bDSP_Post_Download_MicroCode; + + short LPT; + BOOL bLoadSSEEPROM; + CString EEPROMDumpFileTxt; + CString EEPROMDumpFileHex; +}; + +#endif // !defined(_SSI_SSIDATA__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiStatus.h b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiStatus.h new file mode 100644 index 0000000..edaca3b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/SsiStatus.h @@ -0,0 +1,46 @@ +// Proto.h: interface for the CProto class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SSISTATUS_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) +#define AFX_SSISTATUS_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +enum SSI_STATUS { + SSI_STATUS_NORMAL = 0, + SSI_STATUS_DATALINK_ERROR, + SSI_STATUS_SETUP_ASYNC_CONTEXT_ERROR, + SSI_STATUS_MV_COMMAND_TIMEOUT, + SSI_STATUS_MV_COMMAND_BUSY, + SSI_STATUS_REPLAY_FILE_ERROR, + SSI_STATUS_MV_CONFIG_FILE_NOT_FOUND, + SSI_STATUS_MV_HOMING_TIMEOUT, + SSI_STATUS_ERROR +}; + +enum SSI_STATUS_MOTION { + SSI_STATUS_MOTION_NORMAL = 0, + SSI_STATUS_MOTION_STALLED, + SSI_STATUS_MOTION_LIMIT_REACHED, + SSI_STATUS_MOTION_TIMEOUT, + SSI_STATUS_MOTION_INVALID_PARAMETERS, + SSI_STATUS_UNKNOWN_ERROR, + SSI_STATUS_SO7_CONFIG_FILE_NOT_FOUND, + SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR, + SSI_STATUS_MOTION_REPLAY_FILE_ERROR, + SSI_STATUS_MOTION_DATALINK_ERROR +}; + +enum SSI_STATUS_SMARTMOTOR { + SSI_STATUS_SMARTMOTOR_NORMAL = 0, + SSI_STATUS_SMARTMOTOR_COMMERR, + SSI_STATUS_SMARTMOTOR_UNKNOWN_ERROR, + SSI_STATUS_SMARTMOTOR_LIMIT_REACHED, + SSI_STATUS_SMARTMOTOR_TIMEOUT, + SSI_STATUS_SMARTMOTOR_INVALID_PARAMETERS, + SSI_STATUS_SMARTMOTOR_DATALINK_ERROR +}; + +#endif // !defined(AFX_PROTO_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/logger.h b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/logger.h new file mode 100644 index 0000000..0bd5cc4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/MicroVu/logger.h @@ -0,0 +1,56 @@ +#if !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_) +#define LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_ + +#include +#include +#include +#include +#include +#include +#include + +const long LOGINIT = 0x0001; +const long LOGACTIONS = 0x0002; +const long LOGCOMM = 0x0004; +const long LOGFLUSH = 0x0008; + +class CLogger +{ +public: + + CLogger() + { + m_File = NULL; + CString Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + m_FileName=Path + _T("\\Mv_SSILog.txt"); + m_lLogMask=0; + }; + ~CLogger() + { + if (m_File) + fclose(m_File); + }; + + void Send(LPCTSTR, ...); + void SendAndFlush(LPCTSTR, ...); + void SendAndFlushPerMode(LPCTSTR, ...); + CString m_FileName; + long m_lLogMask; + FILE *m_File; + _TCHAR m_Str[20000]; + _TCHAR m_Str2[20000]; +}; + +#endif // !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMD_H.h b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMD_H.h new file mode 100644 index 0000000..e5063c4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMD_H.h @@ -0,0 +1,350 @@ +enum FUN_CMD +{ + +CT_FUN, +CT_MOTOR, +CT_SCALE, +CT_LIGHT, +CT_INT, +CT_DATA + +}; + +enum MOTOR_CMD +{ + +CT_MOVEX, + +CT_MOVEY, + +CT_MOVEZ, + + +CT_MOVETOX, +CT_MOVETOY, +CT_MOVETOZ, + +CT_MOVETOFX, +CT_MOVETOFY, +CT_MOVETOFZ, + +CT_MOVETOSX, +CT_MOVETOSY, +CT_MOVETOSZ, + +CT_MOVETOAX, +CT_MOVETOAY, +CT_MOVETOAZ, + +CT_MOVETOASX, +CT_MOVETOASY, +CT_MOVETOASZ, + +CT_MOVETOAFX, +CT_MOVETOAFY, +CT_MOVETOAFZ, + +CT_RESETXYZ, +CT_RESETX, +CT_RESETY, +CT_RESETZ, + +CT_STOPA, +CT_STOPX, +CT_STOPY, +CT_STOPZ, + +CT_STOPFA, +CT_STOPFX, +CT_STOPFY, +CT_STOPFZ, + +CT_SET_SPEEDX, + + +CT_SET_SPEEDY, + + +CT_SET_SPEEDZ, + +CT_READ_SPEEDX, +CT_READ_SPEEDY, +CT_READ_SPEEDZ, + +CT_SET_PRECISIONX, +CT_SET_PRECISIONY, +CT_SET_PRECISIONZ, + +CT_SET_DEFAULTX, +CT_SET_DEFAULTY, +CT_SET_DEFAULTZ, + +CT_READ_PRECISIONX, +CT_READ_PRECISIONY, +CT_READ_PRECISIONZ, +CT_RESET, + +CT_MOVEV, +CT_MOVETOV, +CT_RESETV, +CT_STOPV, +CT_SET_SPEEDV, +CT_READ_SPEEDV, +CT_SET_DEFAULTV, +CT_TESTV, +CT_TSTOPV, +CT_TEST_STOP, +CT_READ_V, + +CT_M_SPEED, +CT_M_DIS, +CT_M_FRESH, +CT_M_CMD, +CT_M_READ_DAT, +CT_SET_MOTOR_CAL, + +CT_M_SWITCH_START, +CT_M_SWITCH_CLOSE, +CT_M_SWITCH_TOP, +CT_M_SWITCH_BOM, +CT_M_SWITCH_RESET, +CT_M_SWITCH_VALUE, +CT_M_RESET_LEFT, +CT_M_RESET_RIGHT, + +CT_LASE_TIMMER_ON, +CT_LASE_TIMMER_OFF, +CT_M_PROBE_ON, +CT_M_PROBE_OFF, +CT_MOVETOXYZ, +CT_MOVETOXYZ_LASE, +CT_GET_LASE, +CT_MOVETOXYZV, +CT_M_LASE_ON, +CT_M_LASE_OFF, +CT_M_BCL_ON, +CT_M_BCL_OFF, +CT_MOVETOXYZ_JM, +CT_READ_MOTOR_CAL, +CT_END + +}; + +enum SCALE_CMD +{ + +CT_SEC_FLAG, + +CT_SCALEX, +CT_SCALEY, +CT_SCALEZ, + +CT_SECTIONX, +CT_SECTIONY, +CT_SECTIONZ, + +CT_SET_AXISX, +CT_SET_AXISY, +CT_SET_AXISZ, + +CT_SET_SECTIONX, +CT_SET_SECTIONY, +CT_SET_SECTIONZ, + +CT_X_BEGIN, +CT_Y_BEGIN, +CT_Z_BEGIN, + +CT_X_SECTION_END, +CT_Y_SECTION_END, +CT_Z_SECTION_END, + +CT_X_SECTION_DEC, +CT_Y_SECTION_DEC, +CT_Z_SECTION_DEC, + +CT_SET_SECTION_X, +CT_SET_SECTION_Y, +CT_SET_SECTION_Z, + +CT_PROBE_FLAG, +CT_SET_LINE_X, +CT_SET_LINE_Y, +CT_SET_LINE_Z, + +CT_SET_PROBE_LINE, +CT_SET_PROBE_SECTION, +CT_SET_VERNO, +CT_SET_RESET_FLAG, +CT_GET_RESET_FLAG + +}; + +enum LIGHT_CMD +{ + +CT_LIGHT1_SIZE, +CT_LIGHT2_SIZE, +CT_LIGHT3_SIZE, +CT_LIGHT4_SIZE, + +CT_LIGHT1_SWITCH, +CT_LIGHT2_SWITCH, +CT_LIGHT3_SWITCH, +CT_LIGHT4_SWITCH, +CT_LIGHT5_SWITCH, +CT_LIGHT_CMD + +}; + +enum INT_CMD +{ + +CT_STOPMX, +CT_STOPMY, +CT_STOPMZ, +CT_STOPXYZ, + +CT_ENDXYZ, + +CT_SWITCHX, +CT_SWITCHY, +CT_SWITCHZ, + +CT_PROBE, +CT_PROBE_SWITCH, +CT_XYZLASE, +CT_SEND_XYZLASE, +CT_END1 + +}; + +enum PRO_DATA +{ +CT_READ_AXISXYZ, +CT_READ_AXISX, +CT_READ_AXISY, +CT_READ_AXISZ, + +CT_READ_PROBEXYZ, +CT_READ_PROBEX, +CT_READ_PROBEY, +CT_READ_PROBEZ, + +CT_SAVE_MOTORX1, +CT_SAVE_MOTORX2, +CT_SAVE_MOTORX3, +CT_SAVE_MOTORX4, +CT_SAVE_MOTORX5, + +CT_SAVE_MOTORY1, +CT_SAVE_MOTORY2, +CT_SAVE_MOTORY3, +CT_SAVE_MOTORY4, +CT_SAVE_MOTORY5, + +CT_SAVE_MOTORZ1, +CT_SAVE_MOTORZ2, +CT_SAVE_MOTORZ3, +CT_SAVE_MOTORZ4, +CT_SAVE_MOTORZ5, + +CT_READ_MOTORX1, +CT_READ_MOTORX2, +CT_READ_MOTORX3, +CT_READ_MOTORX4, +CT_READ_MOTORX5, + +CT_READ_MOTORY1, +CT_READ_MOTORY2, +CT_READ_MOTORY3, +CT_READ_MOTORY4, +CT_READ_MOTORY5, + +CT_READ_MOTORZ1, +CT_READ_MOTORZ2, +CT_READ_MOTORZ3, +CT_READ_MOTORZ4, +CT_READ_MOTORZ5, + +CT_SAVE_SCALEX, +CT_SAVE_SCALEY, +CT_SAVE_SCALEZ, + +CT_READ_SCALEX, +CT_READ_SCALEY, +CT_READ_SCALEZ, + +CT_SAVE_SECTION_FLAGX, +CT_SAVE_SECTION_FLAGY, +CT_SAVE_SECTION_FLAGZ, + +CT_READ_SECTION_FLAGX, +CT_READ_SECTION_FLAGY, +CT_READ_SECTION_FLAGZ, + +CT_SAVE_PROBE, +CT_READ_PROBE, + +CT_SAVE_SEC_REALX, +CT_SAVE_SEC_INTX, +CT_SAVE_SEC_SCALEX, + +CT_SAVE_SEC_REALY, +CT_SAVE_SEC_INTY, +CT_SAVE_SEC_SCALEY, + +CT_SAVE_SEC_REALZ, +CT_SAVE_SEC_INTZ, +CT_SAVE_SEC_SCALEZ, + +CT_READ_SEC_REALX, +CT_READ_SEC_INTX, +CT_READ_SEC_SCALEX, + +CT_READ_SEC_REALY, +CT_READ_SEC_INTY, +CT_READ_SEC_SCALEY, + +CT_READ_SEC_REALZ, +CT_READ_SEC_INTZ, +CT_READ_SEC_SCALEZ, + +CT_READ_SYSTEM, +CT_READ_XSECTION_INT, +CT_READ_XSECTION_REAL, +CT_READ_XSECTION_SCALE, + +CT_READ_YSECTION_INT, +CT_READ_YSECTION_REAL, +CT_READ_YSECTION_SCALE, + +CT_READ_ZSECTION_INT, +CT_READ_ZSECTION_REAL, +CT_READ_ZSECTION_SCALE, + + +CT_WRITE_SYSTEM, +CT_WRITE_XSECTION_INT, +CT_WRITE_XSECTION_REAL, +CT_WRITE_XSECTION_SCALE, + +CT_WRITE_YSECTION_INT, +CT_WRITE_YSECTION_REAL, +CT_WRITE_YSECTION_SCALE, + +CT_WRITE_ZSECTION_INT, +CT_WRITE_ZSECTION_REAL, +CT_WRITE_ZSECTION_SCALE, + +CT_READ_AXISV, +CT_READ_ADC, +CT_READ_ADC_INDEX, + +CT_PRO_DAT_END, +CT_CLEAR_PROBE_FLAG, + +CT_READ_IO_DAT, +CT_WRITE_IO_DAT + +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.CPP b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.CPP new file mode 100644 index 0000000..5351b4d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.CPP @@ -0,0 +1,272 @@ +#include "stdafx.h" + +#include "cmmio_base.h" +#ifdef _WIN64 +#include "..\..\..\WAI64bit\WAI64bit.h" +#endif + +// added notifying feature to base class CMMIO [7/30/2004] /MP +// - SetCallback(ptr) to establish the feedback path +// then AddReceived will notify if such a ptr was set +// caller receive function is prototyped as function(CString), i.e. Recieved(CString sWhat) + +///////////////////////////////////////////////////////////////////////////// +void CMMIO::Init() +{ + m_RXTempPtr = NULL; + m_RXHead=NULL; + m_RXTail=NULL; + m_SXTempPtr = NULL; + m_SXHead=NULL; + m_SXTail=NULL; + CurrentPointer=0; + m_iNbMsgWaiting=0; + m_terminator='\0'; + m_usesTerminator=FALSE; + m_pReceiveNotify = NULL; +} + +void CMMIO::SetCallback(CMMIO::p_fstr ptr) +{ + m_pReceiveNotify = ptr; +} + +DWORD CMMIO::Send(CString buffer, BOOL needsResponse/*=FALSE*/) +{ + //ZH 12-12-05 EnterCriticalSection(&m_QueueLock); //ZH-122904 + + char LocBuffer[MAX_OUTPUT_BUFFER_SIZE]; + int length = buffer.GetLength (); + if (length >MAX_OUTPUT_BUFFER_SIZE) + { + length = MAX_OUTPUT_BUFFER_SIZE; + } + + unsigned short* ptr = (unsigned short*)buffer.GetBuffer (MAX_OUTPUT_BUFFER_SIZE); + + for (int i=0;iNext; + + // Point the temp pointer at the block + m_RXTempPtr = Free->Buffer; + cnt = Free->Bytes; + // delete the list entry + delete Free; + --m_iNbMsgWaiting; // mp + + // move over the data to the user's buffer + if (NULL != inputBuf) + memcpy (inputBuf, m_RXTempPtr, cnt); + } + + if( m_RXHead == NULL ) + m_RXTail = NULL; + + // All done so out of the CriticalSection + // LeaveCriticalSection( &m_QueueLock ); + + return(cnt); +} + +int CMMIO::AddReceived( const char *Buffer,DWORD Bytes) +{ + DWORD index = 0; //primary buffer index + struct SerialList *Ptr; + static char Buffer2[MAX_RECIEVE_BUFFER_SIZE]; // result buffer + static char* pBuffer2 = &Buffer2[0]; + unsigned char c; + bool bArmed; + /************************************************************************/ + /* Greg Guilbeau - 2011/08/23 */ + /* The following line(s) have been modified to handle x64 conversion */ + /************************************************************************/ + /* int count; */ + INT_PTR count; + static int escape = 0; + static int tilde = 0; + static int tildeseqcount = 0; + + bool bDone = false; + bool bEventRequest = false; + + //TRACE(_T("AddReceived> pBuffer2 = %x\n"),pBuffer2); + // TRACE(_T("Content %s\n"),Buffer); + if (FALSE /*Bytes==0*/) + { + TRACE(_T("CMMIO> Exiting , no real input")); + return TRUE; + } + do + { + bArmed = false; + + for (;indexBuffer = new char[count + 1 ]; + /************************************************************************/ + /* Greg Guilbeau - 2011/08/23 */ + /* The following line(s) have been modified to handle x64 conversion */ + /************************************************************************/ + /* Ptr->Bytes = count; */ +#ifdef _WIN64 + Ptr->Bytes = WAI64bit::to32bit(count,__FILE__,__LINE__); +#else + Ptr->Bytes = count,__FILE__,__LINE__; +#endif + Ptr->Next = NULL; + memcpy( Ptr->Buffer, Buffer2, count ); + Ptr->Buffer[count] = 0; + + memcpy(m_sLastMessage,Buffer2,count); //copy to last message + m_sLastMessage[count]=0; + + if( m_RXTail ) + m_RXTail->Next = Ptr; + else + m_RXHead = Ptr; + m_RXTail = Ptr; + + // All done so out of the CriticalSection + ++m_iNbMsgWaiting; + } + // LeaveCriticalSection( &m_QueueLock ); + pBuffer2=&Buffer2[0]; // reset out buffer + count = 0; + bEventRequest = true; + } + } + while (!bDone); + //TRACE (_T("CMMIO> Done\n")); + + return(TRUE); +} + +void CMMIO::LineReceive(char* s, int nbCharAvail, BOOL ignoreDelimiter /*= FALSE*/) +{ + if (nbCharAvail != -1) + { + //TRACE(_T("LineReceive got %d chars \n"),nbCharAvail); + char c; + for (int i=0 ; iNext; + delete[] Free->Buffer; + delete Free; + } + m_RXHead = NULL; + + // for now we are not using the Transmit list +#if 0 + + while( m_TXHead ) + { + Free = m_TXHead; + m_TXHead = m_TXHead->Next; + delete[] Free->Buffer; + delete Free; + } + m_TXHead = NULL; +#endif + // LeaveCriticalSection( &m_QueueLock ); + return(TRUE); + +} +/////////////////////////////////////////////////////////////////////////////// +// END OF BASE CLASS CMMIO +/////////////////////////////////////////////////////////////////////////////// + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.H b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.H new file mode 100644 index 0000000..43078f7 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_BASE.H @@ -0,0 +1,116 @@ +#ifndef CMMIO_BASE_H +#define CMMIO_BASE_H + +#include +#include + + +#define MAX_OUTPUT_BUFFER_SIZE 2048 +#define MAX_RECIEVE_BUFFER_SIZE 16000 + +// TCP, serial style routines +struct SerialList +{ + struct SerialList *Next; + DWORD Bytes; + int Item; + char *Buffer; +}; + +class CMMIO +{ +private: + // For now we are not using the transmit list + // struct SerialList *m_TXHead; + char m_terminator; + BOOL m_usesTerminator; + char m_InputBuffer[MAX_RECIEVE_BUFFER_SIZE]; + int CurrentPointer; + char m_sLastMessage[MAX_RECIEVE_BUFFER_SIZE]; + + struct SerialList *m_RXHead; + struct SerialList *m_RXTail; + char *m_RXTempPtr; + CString m_LastError; + BOOL m_hasError; + +protected: + CString m_lastErrMsg; + int m_iNbMsgWaiting; + BOOL m_UseBuffferedSend; + CRITICAL_SECTION m_QueueLock; + CRITICAL_SECTION m_ReadLock; + CRITICAL_SECTION m_WriteLock; + + struct SerialList *m_SXHead; + struct SerialList *m_SXTail; + char *m_SXTempPtr; + +protected: + virtual void Init(); + int AddReceived( const char *Buffer,DWORD Bytes); // [7/30/2004] + void Error(CString sErr) { + TRACE(sErr); + m_LastError = sErr; + m_hasError = TRUE; + } + + virtual DWORD Close(); + +public: + CMMIO() + { + InitializeCriticalSection( &m_QueueLock ); // Sean Flynn mutex needs to be initialized prior to attempting to lock otherwise it will core + InitializeCriticalSection( &m_ReadLock ); // initializing here will ensure the mutex is always initialized + InitializeCriticalSection( &m_WriteLock ); + Init(); + }; + + virtual ~CMMIO() + { + DeleteCriticalSection( &m_QueueLock ); // Clean up the mutexes resources when the destructor is called. + DeleteCriticalSection( &m_ReadLock ); + DeleteCriticalSection( &m_WriteLock ); + }; + + virtual DWORD Open() { + return 0; + } + + BOOL getError(CString& sErr) { + BOOL hasError = m_hasError; + if (m_hasError) + { + sErr = m_LastError; + m_hasError = FALSE; + } + return (hasError); + } + + virtual int GetNextReceived(char *inputBuf=NULL); + + virtual int HasNextReceived(void) { + return (m_RXHead ? m_RXHead->Bytes : FALSE); + } + virtual void SetTerminateChar(char ch) { + m_terminator=ch; + m_usesTerminator=TRUE; + } + virtual void LineReceive(char* s, int nbCharAvail, BOOL ignoreDelimiter = FALSE); + virtual CString GetLastErrStr() { + return m_lastErrMsg; + } + + typedef void(*p_fstr)(CString); + void SetCallback(p_fstr); + + virtual DWORD Send(LPCSTR buffer, int l, BOOL needsResponse=FALSE) = 0; // [8/11/2004] + virtual DWORD Send(CString buffer, BOOL needsResponse=FALSE); // [8/11/2004] + + virtual bool IsValid() = 0; // pure virtual function +protected: + p_fstr m_pReceiveNotify; +}; + + +#endif // CMMIO_BASE_H \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.CPP b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.CPP new file mode 100644 index 0000000..cfae9d9 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.CPP @@ -0,0 +1,1203 @@ +#include "stdafx.h" + +#include + +#include "CMMIO_SERIAL.H " + +////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////// +#define LONG_TIMEOUT 5000 + +/* +///////////////////////////////////////////////////////////////////////////// +// Code - Text for debug window +static char Codes[][6] = +{ + "","","","","","","","", + "","","","","","","","","", + "","","","","","","","", + "","","","","","","" +}; +*/ + +///////////////////////////////////////////////////////////////////////////// +// CSerial() : Constructor + +///////////////////////////////////////////////////////////////////////////// +// CSerialTask() : Function to run ReceiveTask() method as a task +// + +unsigned int WINAPI CSerialTask(LPVOID CSerialPtr) +{ + TRACE( TEXT("Serial task has started \n") ); + // Call the ControlTask function in the specified plugin + ((CSerial *)CSerialPtr)->ReceiveTask(); + + TRACE( TEXT("Serial task has completed \n") ); + + _endthreadex(0); + + return(0); +} + +CSerial::CSerial() +{ + // Serial port is not open + m_PortHandle = INVALID_HANDLE_VALUE; + + // Default port settings + m_Port = 1; + m_Baud = CBR_115200; + m_Parity ='N'; + m_Bits = 8; + m_StopBits = 1; + m_HandShake =CS_HANDSHAKE_FOR_SO7; + m_RXTimeout = CS_DEFAULT_RX_TIMEOUT; + m_TXTimeout = CS_DEFAULT_TX_TIMEOUT; + m_iRecvState=FALSE; + m_csRecv=_T(""); + m_iRecvByte=0; + // Everything else set to NULL + m_ThreadHandle = NULL; + //m_TXHead = NULL; + //m_TXTail = NULL; + //m_RXHead = NULL; + //m_RXTail =NULL; + memset( &m_ReceiveOLap, 0, sizeof( OVERLAPPED )); + memset( &m_TransmitOLap, 0, sizeof( OVERLAPPED )); + memset( &m_ReadOLap, 0, sizeof( OVERLAPPED )); + memset( &m_WriteOLap, 0, sizeof( OVERLAPPED )); + + m_hWaitCMMResponse = CreateEvent( NULL, TRUE, FALSE, NULL ); + m_hNewRx = CreateEvent( NULL, TRUE, FALSE, NULL ); // to trigger OnRx + + //m_RXTempPtr = NULL; + m_DebugInPtr = 0; + m_DebugCount = 0; + m_Item = 0; + m_MaxTXRetries = 5; + + /* + // CriticalSection for locking lists + InitializeCriticalSection( &m_QueueLock ); + InitializeCriticalSection( &m_WriteLock ); + InitializeCriticalSection( &m_ReadLock ); + */ + // IsValidBuffer = FALSE; + CurrentPointer = 0; + + m_hWaitCMMResponse = CreateEvent( NULL, TRUE, FALSE, NULL ); + m_hNewRx = CreateEvent( NULL, TRUE, FALSE, NULL ); // to trigger OnRx + // pParent = NULL; +} + + +///////////////////////////////////////////////////////////////////////////// +// ~CSerial() : Destructor - Close the port and free up the CriticalSection + +CSerial::~CSerial() +{ + if( IsOpen( ) ) + { + TRACE(TEXT("Warning : closing serial port in destructor\n")); + Close(); + } + while(GetNextReceived()) + ; // mp 3/3/99 prevents leaks + /* + DeleteCriticalSection( &m_QueueLock ); + DeleteCriticalSection( &m_ReadLock ); + DeleteCriticalSection( &m_WriteLock ); + */ + // close the overlapped io event + CloseHandle( m_ReadOLap.hEvent ); + CloseHandle( m_WriteOLap.hEvent ); + // + CloseHandle( m_hWaitCMMResponse ); + CloseHandle( m_hNewRx); +} + + +///////////////////////////////////////////////////////////////////////////// +// OpenPort() : Opens the serial port using the parameters set by default +// or a call to SetPort + +DWORD CSerial::Open() +{ + CString PortName; + COMMTIMEOUTS CommTimeOut; + int Ok; + unsigned int ThreadID; + + // Ensure the debug window is registered + // RegisterDebugWindow( ); + + // Close the port incase it is already open + Close( ); + + // Start of assuming the worst + Ok = FALSE; + + // Format the file name and open it + // COM opens ports from 1..9 for two-difit ports it's becessary to use \\\\.\\COM +#if 0 + PortName.Format( TEXT("\\\\.\\COM%d"), m_Port ); +#else + PortName.Format( TEXT("COM%d"), m_Port ); +#endif + m_PortHandle = CreateFile( PortName, GENERIC_WRITE | GENERIC_READ, 0, NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + NULL ); + if( IsOpen( ) ) + { + // Setup the port according to the stored parameters + if( ProgramPort( m_Port, m_Baud, m_Parity, m_Bits, m_StopBits, m_HandShake ) ) + { + // Setup the timeouts + CommTimeOut.ReadIntervalTimeout = 25; + CommTimeOut.ReadTotalTimeoutMultiplier = 1; + CommTimeOut.ReadTotalTimeoutConstant = 0; + CommTimeOut.WriteTotalTimeoutMultiplier = 0; + CommTimeOut.WriteTotalTimeoutConstant = m_TXTimeout; + if( SetCommTimeouts( m_PortHandle, &CommTimeOut ) ) + { + // Setup the buffer sizes + if( SetupComm( m_PortHandle, 2048, 2048 ) ) + { + // Setup the event masks for the monitoring task + if( SetCommMask( m_PortHandle, EV_RXCHAR | EV_TXEMPTY | EV_BREAK | + EV_CTS | EV_DSR | EV_ERR | EV_RLSD ) ) + { + // Initialise the Overlapping structures and start the + // monitoring task + m_ReceiveOLap.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + m_TransmitOLap.hEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + m_ThreadHandle = (HANDLE)_beginthreadex( NULL, 0, CSerialTask, this, + 0, &ThreadID ); + //Sleep(1000); + Ok = TRUE; + } + } + } + // clear msg waiting + m_iNbMsgWaiting = 0; + } + + // Things have gone wrong so close the port + if( Ok == FALSE ) + { + TRACE(_T("CmmIO> Port OPEN issue -> CLOSED\n"),Ok); + Close( ); + } + } + TRACE(_T("CmmIO> Port OPEN = %d \n"),Ok); + // Return the state + return( IsOpen( ) ); +} + + +///////////////////////////////////////////////////////////////////////////// +// IsOpen() : returns true if the serial port is open +// + +int CSerial::IsOpen( ) +{ + return( m_PortHandle != INVALID_HANDLE_VALUE ); +} + + +///////////////////////////////////////////////////////////////////////////// +// SetPort() : Store the serial settings. If the port is open then these +// settings are applied now + +int CSerial::SetPort(int Port,int Baud,char Parity,int Bits,int StopBits,int HandShake) +{ + // Use the current settings if the value has the default of 0 + m_Port = Port; + if(Baud == 0) + Baud = m_Baud; + if(Parity == 0) + Parity = m_Parity; + if(Bits == 0) + Bits = m_Bits; + if(StopBits == 0) + StopBits = m_StopBits; + + // If the values are ok then store them + if( ProgramPort( Port, Baud, Parity, Bits, StopBits, HandShake ) ) + { + m_Port = Port; + m_Baud = Baud; + m_Parity = Parity; + m_Bits = Bits; + m_StopBits = StopBits; + m_HandShake = HandShake; + return(TRUE); + } + return(FALSE); +} + + +///////////////////////////////////////////////////////////////////////////// +// GetPortData() : return the current settings +// + +void CSerial::GetPortData(int *Port,int *Baud,char *Parity,int *Bits,int *StopBits,int *HandShake) +{ + // return the requested settings + if( Port ) + *Port = m_Port; + if( m_Baud ) + *Baud = m_Baud; + if( Parity ) + *Parity = m_Parity; + if( Bits ) + *Bits = m_Bits; + if( StopBits ) + *StopBits = m_StopBits; + if( HandShake ) + *HandShake = m_HandShake; +} + + +///////////////////////////////////////////////////////////////////////////// +// ClosePort() : Close the port and shut down the monitoring thread +// + +DWORD CSerial::Close() +{ + //struct SerialList *Free; + HANDLE Port; + + // If the port is open then close it + if( IsOpen( ) ) + { + Port = m_PortHandle; + m_PortHandle = INVALID_HANDLE_VALUE; + CloseHandle( Port ); + if( WaitForSingleObject( m_ThreadHandle, (5 * LONG_TIMEOUT) ) != WAIT_OBJECT_0 ) + TRACE( TEXT("ERR:Serial port thread failed to terminate\n") ); + m_ThreadHandle = NULL; + CloseHandle( m_ReceiveOLap.hEvent ); + CloseHandle( m_TransmitOLap.hEvent ); + } + + CMMIO::Close(); + //ZH + /* + // Delete the contents of the temp rx pointer if any + delete[] m_RXTempPtr; + m_RXTempPtr = NULL; + + // Clear down all internal lists + EnterCriticalSection( &m_QueueLock ); + while( m_RXHead ) + { + Free = m_RXHead; + m_RXHead = m_RXHead->Next; + delete[] Free->Buffer; + delete Free; + } + m_RXHead = NULL; + while( m_TXHead ) + { + Free = m_TXHead; + m_TXHead = m_TXHead->Next; + delete[] Free->Buffer; + delete Free; + } + m_TXHead = NULL; + + LeaveCriticalSection( &m_QueueLock ); + */ + return(TRUE); +} + + +///////////////////////////////////////////////////////////////////////////// +// Send functions // [8/11/2004] +// + +DWORD CSerial::Send(LPCSTR buffer, int l, BOOL /*needsResponse=FALSE*/) +{ + + return ( WritePort ((const char*) buffer, (DWORD) l)); +} +/* +DWORD CSerial::Send(CString buffer) +{ +char LocBuffer[MAX_OUTPUT_BUFFER_SIZE]; +int length = buffer.GetLength (); +if (length >MAX_OUTPUT_BUFFER_SIZE) +{ +length = MAX_OUTPUT_BUFFER_SIZE; +} +unsigned short* ptr = (unsigned short*)buffer.GetBuffer (MAX_OUTPUT_BUFFER_SIZE); +for (int i=0;iBuffer, BytesWritten, 2 ); + OnTransmit( 0, BytesWritten ); + SendBuffer(TRUE); + } + } + */ + if(Events & EV_BREAK) + TRACE(_T("Break detected\n")); + if(Events & EV_CTS) + TRACE(_T("CTS Changed State\n")); + if(Events & EV_DSR) + TRACE(_T("DSR Changed State\n")); + if(Events & EV_ERR) + TRACE(_T("Line error\n")); + if(Events & EV_RLSD) + TRACE(_T("EV_RLSD error\n")); + } + + // Go round while the port is open + } + while( IsOpen( ) ); + +} + +///////////////////////////////////////////////////////////////////////////// +// OnReceive() : Default OnReceive() +// V114 + +void CSerial::OnReceive() +{ + // Dummy OnReceieve if not used + char s[255]={0}; + CStringA csTemp; + s[1]='\0'; + CurrentPointer = 0; + int num=0; + + num = ReadPort(s, 255); + //for (int i=0;i Port was OPEN, ProgramPort done \n")); + } + else + { + TRACE(_T("CmmIO> Port was not OPEN ProgramPort not done \n")); + Ok = TRUE; + } + } + return(Ok); +} + +///////////////////////////////////////////////////////////////////////////// +// OnTransmit() : Default OnTransmit() +// + +void CSerial::OnTransmit(int /*Item*/, DWORD /*Error*/) +{ + // Dummy OnTransmit if not used +} + + +///////////////////////////////////////////////////////////////////////////// +// SetTimeouts() : Sets the rx and tx timeouts +// + +void CSerial::SetTimeouts( int RXTimeout, int TXTimeout ) +{ + COMMTIMEOUTS CommTimeOut; + + // Store the timeouts + m_RXTimeout = RXTimeout; + m_TXTimeout = TXTimeout; + + // If the port is open then configure the port also + // Currently we only use the Fixed timeouts + if( IsOpen( ) ) + { + CommTimeOut.ReadIntervalTimeout = 25; + CommTimeOut.ReadTotalTimeoutMultiplier = 1; + CommTimeOut.ReadTotalTimeoutConstant = 0; + CommTimeOut.WriteTotalTimeoutMultiplier = 0; + CommTimeOut.WriteTotalTimeoutConstant = m_TXTimeout; + SetCommTimeouts( m_PortHandle, &CommTimeOut ); + } +} + + +///////////////////////////////////////////////////////////////////////////// +// AddToDebug() : Add the data to the debug output. State is 1 = rx 2 = tx +// 3 = user + +void CSerial::AddToDebug( const char * /*Ptr*/, DWORD /*BytesToCopy*/, int /*State*/ ) +{ + //ZH +#if 0 + // We are messing with pointers so use the CriticalSection + EnterCriticalSection(&m_QueueLock); + + // If ptr = NULL the change to string containing + if( Ptr == NULL ) + { + BytesToCopy = 0; + //Ptr = _T(""); + Ptr = ""; + } + + // If zero length then use length of string instead + if( BytesToCopy == 0) + BytesToCopy = strlen( Ptr ); + + // If length of data is greater then the debug buffer then just + // use the end of the data + if(BytesToCopy > CS_DEBUG_SIZE) + { + Ptr += BytesToCopy - CS_DEBUG_SIZE; + BytesToCopy = CS_DEBUG_SIZE; + } + + // If the data will wrap around then just copy the first block + if( ( m_DebugInPtr + BytesToCopy ) > CS_DEBUG_SIZE) + { + // Copy data to the end of the debug buffer + memcpy(m_DebugData + m_DebugInPtr, Ptr, CS_DEBUG_SIZE - m_DebugInPtr); + memset(m_DebugState + m_DebugInPtr, State, CS_DEBUG_SIZE - m_DebugInPtr); + m_DebugWnd.AddData( m_DebugData + m_DebugInPtr, + m_DebugState + m_DebugInPtr, + CS_DEBUG_SIZE - m_DebugInPtr ); + + // Move on by the amount copied + Ptr += CS_DEBUG_SIZE - m_DebugInPtr; + BytesToCopy -= CS_DEBUG_SIZE - m_DebugInPtr; + + // Point at the begining of the buffer + m_DebugInPtr = 0; + } + + // Copy the rest into the buffer + memcpy(m_DebugData + m_DebugInPtr, Ptr, BytesToCopy); + memset(m_DebugState + m_DebugInPtr, State, BytesToCopy); + m_DebugWnd.AddData( m_DebugData + m_DebugInPtr, + m_DebugState + m_DebugInPtr, BytesToCopy ); + m_DebugInPtr += BytesToCopy; + m_DebugCount += BytesToCopy; + + // Keep a count of howmany bytes are in the buffer + if( m_DebugCount > CS_DEBUG_SIZE ) + m_DebugCount = CS_DEBUG_SIZE; + + // All done so out of the CriticalSection + LeaveCriticalSection(&m_QueueLock); +#endif +} + + +///////////////////////////////////////////////////////////////////////////// +// FlushPort() : Removes all characters in the serial buffer +// +/* +int CSerial::FlushPort(void) +{ +int TXTimeout,RXTimeout; +char FlushBuffer[256]; +DWORD BytesRead,BytesTotal; +struct SerialList *Free; + +if( IsOpen( ) ) +{ +// We are messing with pointers so use the CriticalSection +EnterCriticalSection(&m_QueueLock); + +// Make a copy of the timeouts and set back to the defaults +RXTimeout = m_RXTimeout; +TXTimeout = m_TXTimeout; +SetTimeouts( 10, 10 ); + +// Read all data from the port +BytesTotal=0; +while( ( BytesRead = ReadPort( FlushBuffer, 256 ) ) == 256 ) +BytesTotal+=BytesRead; +BytesTotal+=BytesRead; + +// Clear the Received list +while(m_RXHead) +{ +Free=m_RXHead; +m_RXHead=m_RXHead->Next; +delete[] Free->Buffer; +delete Free; +} + +// put the timeouts back +SetTimeouts( RXTimeout, TXTimeout ); + +m_iNbMsgWaiting = 0; + +// All done so out of the CriticalSection +LeaveCriticalSection(&m_QueueLock); +} +return(BytesTotal); +} +*/ + +///////////////////////////////////////////////////////////////////////////// +// MaxPort() : +// + +int CSerial::MaxPort() +{ + // return the max port, :-) + return(8); +} + + +///////////////////////////////////////////////////////////////////////////// +// Transmit() : Adds data into a list to be transmitted when possible. +// the function OnTransmit() will be called for each block of +// data sent. +// + +int CSerial::Transmit(const char * /*Buffer*/,DWORD /*Bytes*/) +{ + /* + struct SerialList *Ptr; + int Start; + + // Is the port open + if( IsOpen( ) ) + { + TRACE(_T("CmmIo> Port OPEN ... transmitting %d bytes \n"),Bytes); + // Yes so CriticalSection again + EnterCriticalSection(&m_QueueLock); + // Create a new list entry structure for the block of data + Ptr = new struct SerialList; + Ptr->Buffer = new char[Bytes]; + Ptr->Bytes = Bytes; + Ptr->Next = NULL; + Ptr->Item = m_Item++; + if(Ptr->Item == 0 ) + Ptr->Item = m_Item++; + memcpy( Ptr->Buffer, Buffer, Bytes ); + + // Add it into the list + if( m_TXTail ) + { + Start = FALSE; + m_TXTail->Next = Ptr; + } + else + { + Start = TRUE; + m_TXHead = Ptr; + } + m_TXTail = Ptr; + + // If the list was empty then start sending the data, otherwise + // it will be sentout when the previous data has been sent + if(Start) + SendBuffer(FALSE); + + // All done so out of the CriticalSection + LeaveCriticalSection(&m_QueueLock); + + //return the ID for this block + return( Ptr->Item ); + } + else{ + TRACE(_T("CmmIo> Port NOT OPEN ... FAILED TO TRANSMIT %d bytes \n"),Bytes); + } + */ + + return(0); +} + +///////////////////////////////////////////////////////////////////////////// +// AddReceived() : Helper function, this adds a block of data to a list which +// read back by GetNextReceived() +// + +/* +int CSerial::AddReceived( const char *Buffer,DWORD Bytes) +{ +DWORD index = 0; //primary buffer index +struct SerialList *Ptr; +static char Buffer2[1000]; // result buffer +static char* pBuffer2 = &Buffer2[0]; +unsigned char c; +bool bArmed; +int count; +static int escape = 0; +static int tilde = 0; +static int tildeseqcount = 0; + +bool bDone = false; +bool bEventRequest = false; + +// ATLTRACE("AddReceived> pBuffer2 = %x\n",pBuffer2); +// ATLTRACE("Content %s\n",Buffer); +if (Bytes==0){ +// TRACE("CMMIO> Exiting , no real input"); +return TRUE; +} +do { +bArmed = false; +for (;index0x80 ){ +++ escape; // max will be 1 +// ATLTRACE(" ESCAPE ___>> %d\n",escape); +} + +if( c=='~' ){ +++ tilde; // max = 1 +// ATLTRACE(" TILDE ESC___>> %d\n",tilde); +} + +} +if (index == Bytes) bDone=true; +// else TRACE("\nCMMIO> (Serial)Splitting received stream....\n"); + +// We are messing with pointers so use the CriticalSection +if (bArmed ){ +EnterCriticalSection(&m_QueueLock); +//Allocate a new list and add it in +count = pBuffer2-(&Buffer2[0]); +Ptr = new struct SerialList; +Ptr->Buffer = new char[count + 1 ]; +Ptr->Bytes = count; +Ptr->Next = NULL; +memcpy( Ptr->Buffer, Buffer2, count ); +Ptr->Buffer[count] = 0; + +memcpy(m_sLastMessage,Buffer2,count); //copy to last message +m_sLastMessage[count]=0; + +if( m_RXTail ) +m_RXTail->Next = Ptr; +else +m_RXHead = Ptr; +m_RXTail = Ptr; + +// All done so out of the CriticalSection +++m_iNbMsgWaiting; +LeaveCriticalSection( &m_QueueLock ); +pBuffer2=&Buffer2[0]; // reset out buffer +count = 0; +escape = 0; +//new +tilde = 0; +tildeseqcount = 0; +///n + +bEventRequest = true; +} +} while (!bDone); +// ATLTRACE ("CMMIO> Done\n"); + +//ZH +#if 0 +if(bEventRequest){ +if (!(pParent->m_bNoFireEvent)) { +// ATLTRACE("CmmIO Serial> Setting Event m_hNewRx \n"); +SetEvent(m_hNewRx);// tell the system to fire event if needed... +} +else { +// ATLTRACE("CmmIO Serial> Setting Event pParent->m_hCmmResponded \n"); +// SetEvent(pParent->m_hCmmResponded); +} +} +#endif + +// if(bEventRequest){ +// if (pParent){ +// SetEvent(pParent->m_hCmmResponded); +// } +// } + +// else ATLTRACE("--- AddReceived> Leaving with part of msg in buffer, pBuffer2= %x\n",pBuffer2); +return(TRUE); +} +*/ + +///////////////////////////////////////////////////////////////////////////// +// GetNextReceived() : Helper function, receives messages placed in the queue +// by AddReceievd() +// +//ZH +/* +char *CSerial::GetNextReceived(void) +{ +struct SerialList *Free; + +// If there is a previous block then delete it +delete[] m_RXTempPtr; +m_RXTempPtr = NULL; + +// We are messing with pointers so use the CriticalSection +EnterCriticalSection(&m_QueueLock); + +// If there any more to return +if( m_RXHead ) +{ +Free = m_RXHead; +m_RXHead = m_RXHead->Next; + +// Point the temp pointer at the block +m_RXTempPtr = Free->Buffer; + +// delete the list entry +delete Free; +--m_iNbMsgWaiting; // mp +} +if( m_RXHead == NULL ) +m_RXTail = NULL; + +// All done so out of the CriticalSection +LeaveCriticalSection( &m_QueueLock ); + +return( m_RXTempPtr ); +} +*/ + +///////////////////////////////////////////////////////////////////////////// +// HexToInt() : Helper function, converts the specifed number of bytes from +// ascii hex +// + +int CSerial::HexToInt(char *Data, int Bytes) +{ + int Byte; + int HexChar, Value; + + Value = 0; + for( Byte = 0; Byte < Bytes; Byte++ ) + { + Value <<= 4; + HexChar = *Data++ -= '0'; + if( HexChar > 32 ) + HexChar -= 39; + else if( HexChar > 9 ) + HexChar -= 7; + Value += HexChar; + } + + return( Value ); +} + + +///////////////////////////////////////////////////////////////////////////// +// Private functions +// + +///////////////////////////////////////////////////////////////////////////// +// RegisterDebugWindow() : Registers the window class for the debug window. +// +//ZH +/* +void CSerial::RegisterDebugWindow() +{ +// Register the CSerialRaw window for future use +WNDCLASS wndcls; +memset( &wndcls, 0, sizeof( WNDCLASS ) ); +wndcls.lpfnWndProc = DefWindowProc; +wndcls.hInstance = AfxGetInstanceHandle( ); +wndcls.hCursor = LoadCursor( NULL, IDC_ARROW ); +wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); +wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; +wndcls.lpszClassName = TEXT("CSerial"); +AfxRegisterClass( &wndcls ); +} +*/ + + + +#if 0 +///////////////////////////////////////////////////////////////////////////// +// SendBuffer() : Internal function, this writes the next block of data +// queued to the serial port. + +void CSerial::SendBuffer(int Next) +{ + struct SerialList *Free; + // DWORD BytesWritten; + + // We are messing with pointers so use the CriticalSection + EnterCriticalSection(&m_QueueLock); + + // If we been told to go the next then do it + if(Next && m_TXHead) + { + Free=m_TXHead; + m_TXHead=m_TXHead->Next; + delete[] Free->Buffer; + delete Free; + + } + + // If there is still some data then send it + if(m_TXHead) + // WriteFile(m_PortHandle,m_TXHead->Buffer,m_TXHead->Bytes,&BytesWritten,&m_TransmitOLap); + WritePort(m_TXHead->Buffer,m_TXHead->Bytes); + else + m_TXTail=NULL; + + // All done so out of the CriticalSection + LeaveCriticalSection(&m_QueueLock); +} +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.H b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.H new file mode 100644 index 0000000..2464efc --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/CMMIO_SERIAL.H @@ -0,0 +1,192 @@ +#ifndef CMMIO_SERIAL_H +#define CMMIO_SERIAL_H + +#include +#include +#include "CMMIO_BASE.H " + +//////////////////////////////////////////////////////////////////////////////// +/* +*$!!*************************************************************************** +*$!! MODULE NAME +*$!! Serial.h +*$!! +*$!! DESCRIPTION +*$!! Header file for CSerial. +*$!! +*$!! AUTHOR +*$!! M.J.S.Gooder. +*$!! +*$!! HISTORY +*$!! $Log: /Plugins/BPI/Serial.h $ +*$!! +*$!! 28 19/03/98 14:04 Mgooder +*$!!*************************************************************************** +*/ + + +/////////////////////////////////////////////////////////////////////////////// +// Function for starting serial monitor thread +unsigned int WINAPI CSerialTask(LPVOID CSerialPtr); + +/////////////////////////////////////////////////////////////////////////////// +// Useful serial codes +const char CS_NUL = 0; +const char CS_SOH = 1; +const char CS_STX = 2; +const char CS_ETX = 3; +const char CS_EOT = 4; +const char CS_ENQ = 5; +const char CS_ACK = 6; +const char CS_BEL = 7; +const char CS_LF = 10; +const char CS_DLE = 16; +const char CS_X_ON = 17; +const char CS_X_OFF = 19; +const char CS_NAK = 21; +const char CS_ETB = 23; +const char CS_CAN = 24; +const char CS_ESC = 27; + + +/////////////////////////////////////////////////////////////////////////////// +// Handshake settings +const int CS_HANDSHAKE_RTSCTS = 1; +const int CS_HANDSHAKE_XONXOFF = 2; +const int CS_HANDSHAKE_NONE = 3; +const int CS_HANDSHAKE_RTSCTS_DTRDSR = 4; +const int CS_HANDSHAKE_FOR_SO7 = 5; + + + +/////////////////////////////////////////////////////////////////////////////// +// Debug constants +const int CS_DEBUG_SIZE = 1024; + +/////////////////////////////////////////////////////////////////////////////// +// Timeouts (ms) +const int CS_DEFAULT_RX_TIMEOUT = 25; +const int CS_DEFAULT_TX_TIMEOUT = 1000; + +/////////////////////////////////////////////////////////////////////////////// +// The CSerial class + +class CSerial : public CMMIO +{ + // Construction +public: + CSerial(); + + // Implementation +public: + virtual ~CSerial(); + + // Attributes +public: + + // Operations +public: + // Open the serial port ( if possible ) using the parameters set by SetPort() + DWORD Open(); + // Setup the serial port prior to opening it + int SetPort( int Port, int Baud = 0, char Parity = 0, int Bits = 0, + int StopBits = 0, int HandShake = 0 ); + // Set up the port timeouts + void SetTimeouts( int RXTimeout = CS_DEFAULT_RX_TIMEOUT, + int TXTimeout = CS_DEFAULT_TX_TIMEOUT ); + // Get the serial port settings + void GetPortData( int *Port, int *Baud, char *Parity, int *Bits, + int *StopBits, int *HandShake ); + // Test if the serial port is open + bool IsValid() { + return IsOpen()!=0; + } + int IsOpen( void ); + // Close the serial port + DWORD Close( void ); + // Flush all data in any serial port buffers + int FlushPort( void ); + // Attempt to read the specified number of bytes + DWORD ReadPort( char *Buffer, DWORD Bytes ); + DWORD ReadPort( CString &Buffer, DWORD Bytes ); + // Attempt to write the specified number of bytes + DWORD WritePort( const char *Buffer, DWORD Bytes ); + // Send the specifed number of bytes out when possible + int Transmit( const char *Buffer, DWORD Bytes ); + // Add a block of data to the internal list of receieved blocks + int AddReceived( const char *Buffer, DWORD Bytes ); + // Get the next block of data added with AddReceived() + // char *GetNextReceived( void ); + // Find the maximum port number available + int MaxPort( void ); + // Add text to the debug output + void AddToDebug( const char *Ptr, DWORD BytesToCopy, int State ); + // Attach this serial port to a debug window + //CSerialRaw *AttachWnd( CWnd *Wnd ); + // Convert ascii hex into an int + int HexToInt( char *Data, int Bytes ); + + virtual DWORD Send(LPCSTR buffer, int l, BOOL needsResponse=FALSE); + //virtual DWORD Send(CString what); + + // Called when data is received on the serial port + virtual void OnReceive( void ); + // Called when data has been sent using the Transmit() function + virtual void OnTransmit( int Item, DWORD Error ); + +private: + // Private so no comment :-) + void RegisterDebugWindow(void); + void SendBuffer(int Next); + void ReceiveTask(void); + int ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,int HandShake); + + // Attributes +protected: + int m_RXTimeout; + int m_TXTimeout; + + // Attributes +private: + char m_Parity; + // char m_DebugData[CS_DEBUG_SIZE]; + // char m_DebugState[CS_DEBUG_SIZE]; + // char *m_RXTempPtr; + int m_Port; + int m_Baud; + int m_Bits; + int m_StopBits; + int m_HandShake; + int m_MaxTXRetries; + int m_DebugInPtr; + int m_DebugCount; + int m_Item; + // struct SerialList *m_TXHead; + // struct SerialList *m_TXTail; + // struct SerialList *m_RXHead; + // struct SerialList *m_RXTail; + OVERLAPPED m_ReceiveOLap; + OVERLAPPED m_TransmitOLap; + OVERLAPPED m_ReadOLap; + OVERLAPPED m_WriteOLap; + HANDLE m_PortHandle; + HANDLE m_ThreadHandle; + HANDLE m_ReceiveTaskEvent; + +private: + friend unsigned int WINAPI CSerialTask(LPVOID CSerialPtr); + + //Buffer for incomming commands: + int CurrentPointer; +public: + HANDLE m_hWaitCMMResponse; + HANDLE m_hNewRx; + + // BV Nov 2001: Made public + // CRITICAL_SECTION m_QueueLock; + BOOL m_iRecvState; + CString m_csRecv; + INT m_iRecvByte; +}; + +#endif // CMMIO_SERIAL_H \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/Parameter.bmp b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/Parameter.bmp new file mode 100644 index 0000000..18b2c8f Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/Parameter.bmp differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.cpp b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.cpp new file mode 100644 index 0000000..d5c3d2f --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.cpp @@ -0,0 +1,4212 @@ + + +#include "stdafx.h" +#include "SO7_Proto.h" +#include "math.h" + + + +#define MY_CONFIG 1 +#define MAX_DEVPATH_LENGTH 256 +#define ENDPOINT_TIMEOUT 500 +#define MAX_IN_BUFF_SIZE 1024 + +//***** Static Data ***** +static char *outBuff = NULL; +struct_so7_ep_buff CSO7_Proto::ep_buff[lEPSIZE]; +//================================================================ +int CSO7_Proto::g_hEP8x_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP8x_Thread_Id=NULL; + +//================================================================ +int CSO7_Proto::g_hEP02_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP02_Thread_Id=NULL; +HANDLE CSO7_Proto::g_hEP02_Serial_Mutex; + +//================================================================ +struct_so7_machine CSO7_Proto::g_machine; +usb_dev_handle *CSO7_Proto::g_dev=NULL; +CLogger *CSO7_Proto::g_pLogger; +HANDLE CSO7_Proto::g_hHomedEvent = NULL; +CLogger* g_pLog=NULL; + + +//=========================================================================== +// Worker Thread to serialize EP_S07_02 commands. +//=========================================================================== +unsigned __stdcall CSO7_Proto::g_EP02_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + TRACE0("g_hEP02_Thread in loop set.\n"); + if (g_hEP02_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_02_CMD_IDX]._event,INFINITE); + TRACE0("g_hEP02_Thread obtained event.\n"); + switch (g_hEP02_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING_STATE1: + { + TRACE0("g_hEP02_Thread calling _send_usb_cmd. EP_S07_02; \n"); + _This->_send_usb_cmd(EP_02_CMD_IDX); + TRACE0("g_hEP02_Thread return _send_usb_cmd. EP_S07_02; \n"); + break; + } + case THREAD_RUNNING_STATE2: + { + TRACE0("g_hSerialUsbThread processing _write_usb_data_only();\n"); + _This->_write_usb_data_only(EP_02_CMD_IDX); + TRACE0("g_hSerialUsbThread return from _write_usb_data_only();\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP02_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CSO7_Proto::g_EP8x_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + TRACE0("g_hEP8x_Thread_State in loop set.\n"); + if (g_hEP8x_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_82_DATA_IDX]._event, INFINITE); + TRACE0("g_hEP8x_Thread_State obtained event.\n"); + switch (g_hEP8x_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING_STATE1: + { + _This->_read_data_8x(EP_81_DATA_IDX); + break; + } + case THREAD_RUNNING_STATE2: + { + _This->_read_data_8x(EP_82_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + + +//****************************************************************************** +// Parse the data received based on the index (which EP are we processing). +// The CCmdObj should only have one CMD_STATUS_PROCESSING. +// Update CCmdObj _ep_01_status and _ep_81_status. +// Update _status to CMD_STATUS_COMPLETE when both _ep_01_status and _ep_81_status +// are CMD_STATUS_COMPLETE. +// +//****************************************************************************** +void CSO7_Proto::_process_rcv_transfer_data(int iEP) +{ + switch (iEP) + { + case EP_01_CMD_IDX : + TRACE0("_process_rcv_transfer_data() : Update EP_01_CMD_IDX.\r\n"); + break; + case EP_82_DATA_IDX : // + if (ep_buff[EP_02_CMD_IDX]._save_send_cmd == CT_MOTOR) + { + switch (ep_buff[EP_02_CMD_IDX]._save_send_cmd0) + { + case CT_MOVEX: + _process_SO7_CMD_MOVE_X(); + break; + case CT_MOVEY: + _process_SO7_CMD_MOVE_Y(); + break; + case CT_MOVEZ: + _process_SO7_CMD_MOVE_Z(); + break; + case CT_MOVEV: + _process_SO7_CMD_MOVE_ZM(); + break; + case CT_RESET: + _process_SO7_CMD_MOVE_RESET_XYZ(); + break; + case CT_MOVETOX: + _process_SO7_CMD_MOVE_TO_POS_X(); + break; + case CT_MOVETOY: + _process_SO7_CMD_MOVE_TO_POS_Y(); + break; + case CT_MOVETOZ: + _process_SO7_CMD_MOVE_TO_POS_Z(); + break; + case CT_MOVETOV: + _process_SO7_CMD_MOVE_TO_POS_ZM(); + break; + case CT_MOVETOXYZ: + _process_SO7_CMD_MOVE_TO_POS_XYZ(); + break; + case CT_SET_SPEEDX: + case CT_SET_SPEEDY: + case CT_SET_SPEEDZ: + _process_SO7_CMD_SET_SPEED_PARAMETER(); + break; + case CT_READ_SPEEDX: + _process_SO7_CMD_READ_SPEED_PARAMETERX(); + break; + case CT_READ_SPEEDY: + _process_SO7_CMD_READ_SPEED_PARAMETERY(); + break; + case CT_READ_SPEEDZ: + _process_SO7_CMD_READ_SPEED_PARAMETERZ(); + break; + case CT_SET_PRECISIONX: + case CT_SET_PRECISIONY: + case CT_SET_PRECISIONZ: + _process_SO7_CMD_SET_SPEED_PRECISION(); + break; + case CT_READ_PRECISIONX: + _process_SO7_CMD_READ_SPEED_PRECISIONX(); + break; + case CT_READ_PRECISIONY: + _process_SO7_CMD_READ_SPEED_PRECISIONY(); + break; + case CT_READ_PRECISIONZ: + _process_SO7_CMD_READ_SPEED_PRECISIONZ(); + break; + case CT_SET_MOTOR_CAL: + _process_SO7_CMD_SET_SPEED_MOTOR_WHEELBASE_PARAMETER(); + break; + case CT_READ_MOTOR_CAL: + _process_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER(); + break; + break; + case CT_TEST_STOP: + _process_SO7_CMD_READ_ZOOM_MOTION_STATUS(); + break; + default: + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_02_CMD_IDX]._save_send_cmd : %X \r\n", ep_buff[EP_02_CMD_IDX]._save_send_cmd); + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_81_DATA_IDX]._buffer[0] : %X \r\n", ep_buff[EP_81_DATA_IDX]._buffer[0]); + break; + }; + } + else if(ep_buff[EP_02_CMD_IDX]._save_send_cmd == CT_DATA) + { + switch (ep_buff[EP_02_CMD_IDX]._save_send_cmd0) + { + case CT_READ_AXISXYZ: + _process_SO7_CMD_READ_AXIS_XYZ(); + break; + case CT_READ_PROBEXYZ: + _process_SO7_CMD_READ_PROBE_XYZ(); + break; + case CT_READ_AXISV: + _process_SO7_CMD_READ_V_DATA(); + break; + default: + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_02_CMD_IDX]._save_send_cmd : %X \r\n", ep_buff[EP_02_CMD_IDX]._save_send_cmd); + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_81_DATA_IDX]._buffer[0] : %X \r\n", ep_buff[EP_81_DATA_IDX]._buffer[0]); + break; + }; + } + else if(ep_buff[EP_02_CMD_IDX]._save_send_cmd == CT_SCALE) + { + switch (ep_buff[EP_02_CMD_IDX]._save_send_cmd0) + { + case CT_GET_RESET_FLAG: + _process_SO7_CMD_GET_GET_RESET_FLAG(); + break; + + default: + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_02_CMD_IDX]._save_send_cmd : %X \r\n", ep_buff[EP_02_CMD_IDX]._save_send_cmd); + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_81_DATA_IDX]._buffer[0] : %X \r\n", ep_buff[EP_81_DATA_IDX]._buffer[0]); + break; + }; + } + else if(ep_buff[EP_02_CMD_IDX]._save_send_cmd == CT_LIGHT) + { + switch (ep_buff[EP_02_CMD_IDX]._save_send_cmd0) + { + case CT_LIGHT1_SWITCH: + case CT_LIGHT2_SWITCH: + case CT_LIGHT3_SWITCH: + case CT_LIGHT4_SWITCH: + case CT_LIGHT1_SIZE: + case CT_LIGHT2_SIZE: + case CT_LIGHT3_SIZE: + case CT_LIGHT4_SIZE: + case CT_LIGHT_CMD: + _process_SO7_CMD_SET_LIGHT(); + break; + default: + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_02_CMD_IDX]._save_send_cmd : %X \r\n", ep_buff[EP_02_CMD_IDX]._save_send_cmd); + TRACE1("_process_rcv_transfer_data() : Unknown ep_buff[EP_81_DATA_IDX]._buffer[0] : %X \r\n", ep_buff[EP_81_DATA_IDX]._buffer[0]); + break; + }; + } + + TRACE0("_process_rcv_transfer_data() : Update EP_82_DATA_IDX status.\r\n"); + break; + case EP_02_CMD_IDX : + TRACE0("_process_rcv_transfer_data() : Update EP_02_CMD_IDX.\r\n"); + break; + case EP_81_DATA_IDX : + _process_SO7_CMD_READ_INTERRUPT_MESSAGE(); + TRACE0("_process_rcv_transfer_data() : Update EP_81_DATA_IDX.\r\n"); + break; + default: + break; + }; +}; + +//=========================================================================== +double CSO7_Proto::ScaleToMM(long lCount, double dResolution) +{ + double dMM = 0.0; + dMM = (lCount* dResolution) /1000 ; + return dMM; +} + +//=========================================================================== +long CSO7_Proto::MMtoScale(double lDistanceMM, double dResolution) +{ + long lCounts(0); + if (dResolution) + lCounts = static_cast (lDistanceMM *1000 / dResolution); + else + ASSERT(0); + return lCounts; +} + +//=========================================================================== +void CSO7_Proto::Trace_EP_Buff(long lIndex) +{ + UCHAR tmp[256]; + CString csTmp; + memcpy(tmp, ep_buff[lIndex]._buffer, ep_buff[lIndex]._size); + csTmp = _T("Trace_EP_Buff _59 "); + for (int ii= 0 ; ii < ep_buff[lIndex]._size ; ++ii) + { + CString csTmpHex; + csTmpHex.Format(_T("%2X"), tmp[ii] ); + csTmp += csTmpHex; + } + TRACE1("_process_SO7_CMD_GET_INDEX_4E() Trace_EP_Buff %s \n", csTmp); +} + +//===================================================================================== +long CSO7_Proto::_4char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[3]; + c_array[1] = cBuff[2]; + c_array[2] = cBuff[1]; + c_array[3] = cBuff[0]; + return(l_value); +} + +//===================================================================================== +long CSO7_Proto::_3char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[2]; + c_array[1] = cBuff[1]; + c_array[2] = cBuff[0]; + return(l_value); +} +//======================================================================== +void CSO7_Proto::_reverse_dword(DWORD *dWord) +{ + BYTE cBuff[4]; + BYTE *dwBuff = (BYTE *)dWord; + for ( int ii = 0 ; ii < 4 ; ++ii ) + cBuff[ii]= dwBuff[ii]; + + dwBuff[0] = cBuff[3]; + dwBuff[1] = cBuff[2]; + dwBuff[2] = cBuff[1]; + dwBuff[3] = cBuff[0]; +} + +//****************************************************************************** +void CSO7_Proto::_scale2inch(unsigned long scale, double &inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +void CSO7_Proto::_inch2scale(unsigned long &scale, double inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +// convert a string of characters into its binary form +void CSO7_Proto::_char2bin(unsigned char *cBuff, BYTE *cBytes, int iLen) +{ + memset(cBytes, 0, MAX_BUFF_SIZE); + for (int i=0;i>8; + Val = MSB|LSB; +} + +//****************************************************************************** +double CSO7_Proto::TimeInSecs(void) +{ + double Secs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPersec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Secs = ((double)HPTicks.QuadPart / HPCounterTicksPersec); + } + else + { + // Use clock with less resolution. + Secs = GetTickCount(); + Secs /= 1000.0; + } + return Secs; +} + +//****************************************************************************** +CSO7_Proto::CSO7_Proto() +{ + ep_buff[EP_01_CMD_IDX]._ep = EP_S07_01; + ep_buff[EP_81_DATA_IDX]._ep = EP_S07_81; + ep_buff[EP_02_CMD_IDX]._ep = EP_S07_02; + ep_buff[EP_82_DATA_IDX]._ep = EP_S07_82; + + for (int i=0;iSend(_T("Construct Cso7_Proto.\r\n")); +}; + +//****************************************************************************** +CSO7_Proto::~CSO7_Proto() +{ + for (int i=0;iSend(_T("Destruct Cso7_Proto.\r\n")); + delete g_pLogger; + g_pLogger = NULL; +} + +#pragma warning(disable:4996) +//============================================================================== +//****************************************************************************** + +SSI_STATUS_MOTION CSO7_Proto::so7_motion_reset_controller_parameter() +{ + for(int i=0;i<5;i++) + { + g_machine.s_machine_config.x_axis._speed_base[i]=0; + g_machine.s_machine_config.x_axis._speed_max[i]=0; + g_machine.s_machine_config.x_axis._speed_start[i]=0; + g_machine.s_machine_config.x_axis._speed_fresh[i]=0; + g_machine.s_machine_config.x_axis._speed_slow_dis[i]=0; + + g_machine.s_machine_config.y_axis._speed_base[i]=0; + g_machine.s_machine_config.y_axis._speed_max[i]=0; + g_machine.s_machine_config.y_axis._speed_start[i]=0; + g_machine.s_machine_config.y_axis._speed_fresh[i]=0; + g_machine.s_machine_config.y_axis._speed_slow_dis[i]=0; + + g_machine.s_machine_config.z_axis._speed_base[i]=0; + g_machine.s_machine_config.z_axis._speed_max[i]=0; + g_machine.s_machine_config.z_axis._speed_start[i]=0; + g_machine.s_machine_config.z_axis._speed_fresh[i]=0; + g_machine.s_machine_config.z_axis._speed_slow_dis[i]=0; + } + g_machine.s_machine_config.x_axis._motor_wheelbase=0; + g_machine.s_machine_config.y_axis._motor_wheelbase=0; + g_machine.s_machine_config.z_axis._motor_wheelbase=0; + g_machine._motor_pulse_num=10000; + + g_machine.s_machine_config.x_axis._motor_precision=0; + g_machine.s_machine_config.y_axis._motor_precision=0; + g_machine.s_machine_config.z_axis._motor_precision=0; + + + + return SSI_STATUS_MOTION_NORMAL; +} +//========================================================================================= +SSI_STATUS_MOTION CSO7_Proto::Save_SevenOcean_Inifile(CString path_and_fileName) +{ + FILE* m_pOutFile; + char *outBuff = NULL; + char tmp; + + _wfopen_s(&m_pOutFile, path_and_fileName, _T("wt")); + if (!m_pOutFile) + { + free(outBuff); + } + else + { + outBuff="[HARDWARE]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_BASE_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_base[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_X1="; + fprintf(m_pOutFile,"%s", outBuff); + tmp= g_machine.s_machine_config.x_axis._speed_max[0]; + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_max[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_start[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_fresh[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_X1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._speed_slow_dis[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_base[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.x_axis._speed_max[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_start[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_fresh[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_X2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._speed_slow_dis[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + outBuff="SPEED_BASE_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte) g_machine.s_machine_config.x_axis._speed_base[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_max[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_start[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_fresh[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_X3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._speed_slow_dis[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_base[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_max[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_start[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_fresh[3]); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_SLOW_X4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._speed_slow_dis[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_base[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.x_axis._speed_max[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_start[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.x_axis._speed_fresh[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_X5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._speed_slow_dis[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_base[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_max[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_start[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_fresh[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Y1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._speed_slow_dis[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_base[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_max[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_start[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_fresh[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Y2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._speed_slow_dis[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_base[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_max[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_start[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_fresh[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Y3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._speed_slow_dis[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_base[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_max[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_start[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_fresh[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Y4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._speed_slow_dis[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.y_axis._speed_base[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.y_axis._speed_max[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_start[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.y_axis._speed_fresh[4]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Y5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._speed_slow_dis[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_base[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_max[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_start[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_fresh[0]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Z1="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._speed_slow_dis[0]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_base[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_max[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_start[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_fresh[1]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Z2="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._speed_slow_dis[1]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_base[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_max[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_start[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_fresh[2]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Z3="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._speed_slow_dis[2]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_base[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_MAX_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_max[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_START_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_start[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_FRESH_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_fresh[3]); + fprintf(m_pOutFile, "\n"); + outBuff="SPEED_SLOW_Z4="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._speed_slow_dis[3]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="SPEED_BASE_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_base[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_MAX_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", (byte)g_machine.s_machine_config.z_axis._speed_max[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_START_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_start[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_FRESH_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",(byte)g_machine.s_machine_config.z_axis._speed_fresh[4]); + fprintf(m_pOutFile, "\n"); + + outBuff="SPEED_SLOW_Z5="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._speed_slow_dis[4]); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_MOTOR_PRECISION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._motor_precision); + fprintf(m_pOutFile, "\n"); + + + outBuff="Y_MOTOR_PRECISION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._motor_precision); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_MOTOR_PRECISION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._motor_precision); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_MOTOR_WHEELBASE="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.x_axis._motor_wheelbase); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_MOTOR_WHEELBASE="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.y_axis._motor_wheelbase); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_MOTOR_WHEELBASE="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f",g_machine.s_machine_config.z_axis._motor_wheelbase); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="MOTOR_PULSE_NUM="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d",g_machine._motor_pulse_num); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + //===========worktable===================== + + outBuff="[WORKTABLE]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + outBuff="X_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_SCALE_RESOLUTION="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._scale_resolution); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_NEG_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._neg_working_limit); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + outBuff="X_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.x_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Y_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.y_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + + outBuff="Z_POS_WORKING_LIMIT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.3f", g_machine.s_machine_config.z_axis._pos_working_limit); + fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile,"%s", ";\n"); + + fclose(m_pOutFile); + + } + return SSI_STATUS_MOTION_NORMAL; +} +//****************************************************************************** +//log file shows the machine speed data +SSI_STATUS_MOTION CSO7_Proto::Load_SevenOcean_Inifile(CString cso7IniFile) +{ + FILE *hConfigFile = NULL; + char szLine[MAX_BUFF_SIZE]; + char *token = NULL; + char seps[] = " =,\t\n"; + char cTemp[20]={0}; + CString csSO7ConfigFile =cso7IniFile;//csAppPath+_T("\\so7_config.ini"); + _wfopen_s(&hConfigFile,csSO7ConfigFile,_T("rt")); + if(hConfigFile) + { + while (!feof(hConfigFile)) + { + fgets(szLine,MAX_BUFF_SIZE,hConfigFile);//read a line + if((szLine[0]!=';')&&(strlen(szLine)>2)) + { + token = strtok(szLine,seps); + // X1 + if(!_stricmp(token,"SPEED_BASE_X1"))//SPEED_BASE_X1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_base[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_X1"))//SPEED_FRESH_X1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_fresh[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_X1"))//SPEED_START_X1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_start[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_X1"))//SPEED_MAX_X1 + { + token = strtok( NULL, seps); + // temp=token; + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_max[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_X1"))//SPEED_SLOW_X1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_slow_dis[0]=atof(cTemp); + } + } + // X2 + else if(!_stricmp(token,"SPEED_BASE_X2"))//SPEED_BASE_X2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_base[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_X2"))//SPEED_FRESH_X2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_fresh[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_X2"))//SPEED_START_X2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_start[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_X2"))//SPEED_MAX_X2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_max[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_X2"))//SPEED_SLOW_X2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_slow_dis[1]=atof(cTemp); + } + } + //X3 + else if(!_stricmp(token,"SPEED_BASE_X3"))//SPEED_BASE_X3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_base[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_X3"))//SPEED_FRESH_X3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_fresh[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_X3"))//SPEED_START_X3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_start[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_X3"))//SPEED_MAX_X3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_max[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_X3"))//SPEED_SLOW_X3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_slow_dis[2]=atof(cTemp); + } + } + // X4 + else if(!_stricmp(token,"SPEED_BASE_X4"))//SPEED_BASE_X4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_base[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_X4"))//SPEED_FRESH_X4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_fresh[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_X4"))//SPEED_START_X4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_start[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_X4"))//SPEED_MAX_X4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_max[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_X4"))//SPEED_SLOW_X4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_slow_dis[3]=atof(cTemp); + } + } + //X5 + else if(!_stricmp(token,"SPEED_BASE_X5"))//SPEED_BASE_X5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_base[4]=static_cast(atoi(cTemp)); + + } + } + else if(!_stricmp(token, "SPEED_FRESH_X5"))//SPEED_FRESH_X5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_fresh[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_X5"))//SPEED_START_X5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_start[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_X5"))//SPEED_MAX_X5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_max[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_X5"))//SPEED_SLOW_X5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._speed_slow_dis[4]=atof(cTemp); + } + } + // Y_axis + else if(!_stricmp(token,"SPEED_BASE_Y1"))//SPEED_BASE_Y1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_base[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Y1"))//SPEED_FRESH_Y1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_fresh[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Y1"))//SPEED_START_Y1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_start[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Y1"))//SPEED_MAX_Y1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_max[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Y1"))//SPEED_SLOW_Y1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_slow_dis[0]=atof(cTemp); + } + } + //Y2 + else if(!_stricmp(token,"SPEED_BASE_Y2"))//SPEED_BASE_Y2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_base[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Y2"))//SPEED_FRESH_Y2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_fresh[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Y2"))//SPEED_START_Y2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_start[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Y2"))//SPEED_MAX_Y2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_max[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Y2"))//SPEED_SLOW_Y2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_slow_dis[1]=atof(cTemp); + } + } + //Y3 + else if(!_stricmp(token,"SPEED_BASE_Y3"))//SPEED_BASE_Y3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_base[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Y3"))//SPEED_FRESH_Y3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_fresh[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Y3"))//SPEED_START_Y3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_start[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Y3"))//SPEED_MAX_Y3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_max[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Y3"))//SPEED_SLOW_Y3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_slow_dis[2]=atof(cTemp); + } + } + // Y4 + else if(!_stricmp(token,"SPEED_BASE_Y4"))//SPEED_BASE_Y4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_base[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Y4"))//SPEED_FRESH_Y4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_fresh[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Y4"))//SPEED_START_Y4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_start[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Y4"))//SPEED_MAX_Y4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_max[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Y4"))//SPEED_SLOW_Y4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_slow_dis[3]=atof(cTemp); + } + } + //Y5 + else if(!_stricmp(token,"SPEED_BASE_Y5"))//SPEED_BASE_Y5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_base[4]=static_cast(atoi(cTemp)); + + } + } + else if(!_stricmp(token, "SPEED_FRESH_Y5"))//SPEED_FRESH_Y5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_fresh[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Y5"))//SPEED_START_Y5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_start[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Y5"))//SPEED_MAX_Y5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_max[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Y5"))//SPEED_SLOW_Y5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._speed_slow_dis[4]=atof(cTemp); + } + } + // Z_axis + else if(!_stricmp(token,"SPEED_BASE_Z1"))//SPEED_BASE_Z1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_base[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Z1"))//SPEED_FRESH_Z1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_fresh[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Z1"))//SPEED_START_Z1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_start[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Z1"))//SPEED_MAX_Z1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_max[0]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Z1"))//SPEED_SLOW_Z1 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_slow_dis[0]=atof(cTemp); + } + } + //Z2 + else if(!_stricmp(token,"SPEED_BASE_Z2"))//SPEED_BASE_Z2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_base[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Z2"))//SPEED_FRESH_Z2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_fresh[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Z2"))//SPEED_START_Z2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_start[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Z2"))//SPEED_MAX_Z2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_max[1]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Z2"))//SPEED_SLOW_Z2 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_slow_dis[1]=atof(cTemp); + } + } + //Z3 + else if(!_stricmp(token,"SPEED_BASE_Z3"))//SPEED_BASE_Z3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_base[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Z3"))//SPEED_FRESH_Z3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_fresh[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Z3"))//SPEED_START_Z3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_start[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Z3"))//SPEED_MAX_Z3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_max[2]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Z3"))//SPEED_SLOW_Z3 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_slow_dis[2]=atof(cTemp); + } + } + // Z4 + else if(!_stricmp(token,"SPEED_BASE_Z4"))//SPEED_BASE_Z4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_base[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_FRESH_Z4"))//SPEED_FRESH_Z4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_fresh[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Z4"))//SPEED_START_Z4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_start[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Z4"))//SPEED_MAX_Z4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_max[3]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Z4"))//SPEED_SLOW_Z4 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_slow_dis[3]=atof(cTemp); + } + } + //Z5 + else if(!_stricmp(token,"SPEED_BASE_Z5"))//SPEED_BASE_Z5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_base[4]=static_cast(atoi(cTemp)); + + } + } + else if(!_stricmp(token, "SPEED_FRESH_Z5"))//SPEED_FRESH_Z5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_fresh[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_START_Z5"))//SPEED_START_Z5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_start[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_MAX_Z5"))//SPEED_MAX_Z5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_max[4]=static_cast(atoi(cTemp)); + } + } + else if(!_stricmp(token, "SPEED_SLOW_Z5"))//SPEED_SLOW_Z5 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._speed_slow_dis[4]=atof(cTemp); + } + } + //XZY_MOTOR_PRECISION + else if(!_stricmp(token, "X_MOTOR_PRECISION"))//SET MOTOR PRECISION + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._motor_precision=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_MOTOR_PRECISION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._motor_precision=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_MOTOR_PRECISION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._motor_precision=atof(cTemp); + } + } + else if(!_stricmp(token, "X_MOTOR_WHEELBASE"))//SET MOTOR WHEELBASE + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._motor_wheelbase=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_MOTOR_WHEELBASE")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._motor_wheelbase=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_MOTOR_WHEELBASE")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._motor_wheelbase=atof(cTemp); + } + } + else if(!_stricmp(token, "MOTOR_PULSE_NUM")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine._motor_pulse_num=atoi(cTemp); + } + } + //=====================[WORKTABLE]======================== + else if(!_stricmp(token, "X_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_SCALE_RESOLUTION")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._scale_resolution=atof(cTemp); + } + } + else if(!_stricmp(token, "X_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_NEG_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._neg_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "X_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.x_axis._pos_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Y_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.y_axis._pos_working_limit=atof(cTemp); + } + } + else if(!_stricmp(token, "Z_POS_WORKING_LIMIT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.z_axis._pos_working_limit=atof(cTemp); + } + } + + + + + } + } + fclose(hConfigFile); + } + + return SSI_STATUS_MOTION_NORMAL; +} + +//========================================================================================= +SSI_STATUS_MOTION CSO7_Proto::Save_So7_Config() +{ + FILE* m_pOutFile; + char *outBuff = NULL; + CString csAppPath; + GetAppPath(csAppPath); + CString cFileName=csAppPath+_T("\\so7_config.ini"); + _wfopen_s(&m_pOutFile, cFileName, _T("wt")); + if (!m_pOutFile) + { + free(outBuff); + } + else + { + outBuff="[7OCEANAUTOZOOM]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + + outBuff="ZOOM_PRODUCT_ID="; + fprintf(m_pOutFile,"%s", outBuff); + USES_CONVERSION; + outBuff=T2A(g_machine.s_machine_config.zm_axis._ProductID); + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + + outBuff="ZOOM_COM_PORT="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._ComPort); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_START_DEG="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._StartDegree); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_END_DEG="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._EndDegree); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_ORG_DEG="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._RelativeZeroDegree); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_DEADBAND_DEG="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.6f", g_machine.s_machine_config.zm_axis._Deadband); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_PULSE_PER_DEG="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%.15f", g_machine.s_machine_config.zm_axis._PulseScale); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_READING_INTERVAL_TIME="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._ReadingInterval); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_MOTOR_SPEED_FAST="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._SpeedFast); + fprintf(m_pOutFile, "\n"); + + outBuff="ZOOM_MOTOR_SPEED_SLOW="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.zm_axis._SpeedSlow); + fprintf(m_pOutFile, "\n;\n"); + + outBuff="[HARDWARE]"; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + + outBuff="CLOSE_LOOP_ENABLED="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._EnCloseLoop); + fprintf(m_pOutFile, "\n"); + + outBuff="RETRY_TIMES="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._RetryTimes); + fprintf(m_pOutFile, "\n"); + + outBuff="SHIFT_POSITION_X="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionX); + fprintf(m_pOutFile, "\n"); + + outBuff="SHIFT_POSITION_Y="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionY); + fprintf(m_pOutFile, "\n"); + + outBuff="SHIFT_POSITION_Z="; + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile,"%d", g_machine.s_machine_config.motion._ShiftPositionZ); + fprintf(m_pOutFile, "\n"); + + + fclose(m_pOutFile); + + } + return SSI_STATUS_MOTION_NORMAL; +} +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::Load_So7_Config() +{ + FILE *hConfigFile = NULL; + char szLine[MAX_BUFF_SIZE]; + char *token = NULL; + char seps[] = " =,\t\n"; + char cTemp[30]={0}; + CString csAppPath; + GetAppPath(csAppPath); + CString csSO7ConfigFile =csAppPath+_T("\\so7_config.ini"); + _wfopen_s(&hConfigFile,csSO7ConfigFile,_T("rt")); + if(hConfigFile) + { + while (!feof(hConfigFile)) + { + fgets(szLine,MAX_BUFF_SIZE,hConfigFile);//read a line + if((szLine[0]!=';')&&(strlen(szLine)>2)) + { + token = strtok(szLine,seps); + //==============7OceanAutozoom============================== + + if(!_stricmp(token,"ZOOM_PRODUCT_ID")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._ProductID=cTemp; + } + } + else if(!_stricmp(token,"ZOOM_COM_PORT")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._ComPort=atoi(cTemp); + } + } + else if(!_stricmp(token,"ZOOM_START_DEG")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._StartDegree=atof(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_END_DEG")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._EndDegree=atof(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_ORG_DEG")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._RelativeZeroDegree=atof(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_DEADBAND_DEG")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._Deadband=atof(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_PULSE_PER_DEG")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._PulseScale=atof(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_READING_INTERVAL_TIME")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._ReadingInterval=atoi(cTemp); + } + } + else if (!_stricmp(token,"ZOOM_MOTOR_SPEED_FAST")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._SpeedFast=static_cast(atoi(cTemp)); + } + } + else if (!_stricmp(token,"ZOOM_MOTOR_SPEED_SLOW")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.zm_axis._SpeedSlow=static_cast(atoi(cTemp)); + } + } + //==============Motion===================== + else if(!_stricmp(token,"CLOSE_LOOP_ENABLED")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.motion._EnCloseLoop=atoi(cTemp); + } + } + else if (!_stricmp(token,"RETRY_TIMES")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.motion._RetryTimes=atoi(cTemp); + } + } + else if (!_stricmp(token,"SHIFT_POSITION_X")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.motion._ShiftPositionX=atof(cTemp); + } + } + else if (!_stricmp(token,"SHIFT_POSITION_Y")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.motion._ShiftPositionY=atof(cTemp); + } + } + else if (!_stricmp(token,"SHIFT_POSITION_Z")) + { + token = strtok( NULL, seps); + if (token) + { + strcpy(cTemp,token); + g_machine.s_machine_config.motion._ShiftPositionZ=atof(cTemp); + } + } + + + } + } + fclose(hConfigFile); + } + + return SSI_STATUS_MOTION_NORMAL; +} + + +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::GetAppPath(CString &Path) +{ + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) + { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return SSI_STATUS_MOTION_NORMAL; +}; +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::ExtractAppPath(CString &Path) +{ + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) + { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } + else + { // not a complete path + Path=""; + }; + return SSI_STATUS_MOTION_NORMAL; +}; + +//****************************************************************************** +// Replay the capture file. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_replay_capture(CString s_replay_file) +{ + char *_0x4e00_cmd = "4e00"; + FILE* pInFile; + + _wfopen_s(&pInFile, s_replay_file, _T("r")); + if (pInFile == NULL) + return SSI_STATUS_MOTION_REPLAY_FILE_ERROR; + + char *cData = (char *)malloc(MAX_BUFF_SIZE); + char *inBuff = (char *)malloc(MAX_BUFF_SIZE); + + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + while (!feof(pInFile)) + { + if (*inBuff == '>') + { + if (strstr(inBuff, "0x00000001")) + { + if (!(_strnicmp(inBuff+35, _0x4e00_cmd, 4))) break; + _process_replay_capture_commands(inBuff, pInFile); + } + }; + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + }; + fclose(pInFile); + free(cData); + free(inBuff); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +// Do not send out DCC Home. We can send everything else. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_process_replay_capture_commands(char *inBuff, FILE* pInFile) +{ + char x[3]; + char cSize[9]; + int iSendSize; + int iRcvSize; + + if ( ((*(inBuff+35) == '4')) && (*(inBuff+36) == 'f')) + { + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + return SSI_STATUS_MOTION_NORMAL; + }; + + memset(cSize, 0 , 9); + memcpy(cSize, inBuff+24, 8); + sscanf_s(cSize, "%8x", &iSendSize); // get the length of the transmission + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0, MAX_BUFF_SIZE); + for (int j=0;jnext) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == SEVENOCEAN_VID && dev->descriptor.idProduct == SEVENOCEAN_PID) + { + return usb_open(dev); + } + } + } + return NULL; +} + +//****************************************************************************** +// Send is direct and async. +// The receive thread will receive data and interpret it. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::Init_SO7Usb() +{ + //Set initial state of the machine + g_machine.s_status._machine_running = false; + + + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + UNREFERENCED_PARAMETER(Status); + + int usb_status = NULL; + usb_init(); // initialize the library + usb_status = usb_find_busses(); // find all busses + usb_status = usb_find_devices(); // find all connected devices + g_dev = _open_usb_dev(); + if (!g_dev) + { + MessageBox(NULL, _T("Unable to open device"), _T("Message"), MB_OK); + g_pLogger->SendAndFlushPerMode(_T("Unable to open device %s \r\n"), usb_strerror()); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_set_configuration(g_dev, MY_CONFIG) < 0) + { + MessageBox(NULL, _T("Unable to SET CONFIGURATION"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_claim_interface(g_dev, 0) < 0) + { + usb_close(g_dev); + MessageBox(NULL, _T("Unable to CLAIM DEVICE"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + g_pLogger->SendAndFlushPerMode(_T("Init:Open device succeed .\r\n")); + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_02_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP02_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP02_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Thread_State = THREAD_RUNNING_STATE1; + + // ******************************************************************** + // Prepare and start EP_S07_81 Thread - Use async commit. + // + ep_buff[EP_82_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP8x_Thread_State = THREAD_PAUSED; + g_hEP8x_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP8x_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + + + // ********************************************************************* + g_hHomedEvent = CreateEvent(NULL, // default security attributes + TRUE, // manual reset event object + FALSE, // initial state is signaled + NULL); // unamed object + + + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::Exit_SO7Usb() +{ + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + + g_hEP8x_Thread_State = THREAD_EXIT; + g_hEP02_Thread_State = THREAD_EXIT; + + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + if (g_hEP8x_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP8x_Thread_Id,&dwCode); + Sleep(1); + } + } + + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + if (g_hEP02_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP02_Thread_Id,&dwCode); + Sleep(1); + } + } + + if (g_dev) + { + usb_release_interface(g_dev,0); + usb_close(g_dev); + g_dev = NULL; + } + + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + CloseHandle(ep_buff[EP_82_DATA_IDX]._event); + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + CloseHandle(ep_buff[EP_02_CMD_IDX]._event); + g_hEP02_Thread_State = THREAD_EXIT; + ReleaseMutex(g_hEP02_Serial_Mutex); + CloseHandle(g_hEP02_Serial_Mutex); + + g_pLogger->SendAndFlushPerMode(_T("Exit: Exit_SO7Usb \r\n")); + return Status; +} + + +//****************************************************************************** +// Kick the g_hEP01_Thread_Event to get the g_EP01_Thread going. +// iEP = EP_S07_01 or EP_S07_02 = 0x01 or 0x02 +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_do_single_threaded_usb_comm(int iEP_Base) +{ + TRACE1("=====_do_single_threaded_usb_comm(iEP) g_hEP01_Thread_Event. %x\n", iEP_Base); + while ((ep_buff[iEP_Base]._hProtoPending == TRUE) || (ep_buff[iEP_Base+1]._hProtoPending == TRUE)) + { + ASSERT(0); + Sleep(3); + } + ep_buff[iEP_Base]._hProtoPending = ep_buff[iEP_Base+1]._hProtoPending = TRUE; + TRACE1("=====_do_single_threaded_usb_comm(iEP_Base) SetEvent(g_hEP01_Thread_Event): %X \r\n", ep_buff[iEP_Base]._save_send_cmd); + if (iEP_Base == EP_01_CMD_IDX) + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + else + SetEvent(ep_buff[iEP_Base]._event); + while ((ep_buff[iEP_Base]._hProtoPending == TRUE) || (ep_buff[iEP_Base+1]._hProtoPending == TRUE)) + { + Sleep(3); + } + TRACE1("=====_do_single_threaded_usb_comm(iEP) g_hProtoDoneEvents. %x\n", iEP_Base); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +// This startup just kicks off the EP_S07_81 worker thread. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_start_machine() +{ + g_hEP8x_Thread_State = THREAD_RUNNING_STATE2; + g_machine.s_status._machine_running = true; + g_pLogger->SendAndFlushPerMode(_T("_start_machine\n")); + //so7_motion_probe_on_off_(false); + //so7_motion_fixture_on_off(true); + //so7_motion_fixture_up_down(true); + return SSI_STATUS_MOTION_NORMAL; +}; + +//=============================================================================== +SSI_STATUS_MOTION CSO7_Proto::_shutdown_machine() +{ + g_machine.s_status._machine_running = false; + return SSI_STATUS_MOTION_NORMAL; +}; + + +//=============================================================================== +// iEP_Base : EP_81_DATA_IDX/EP_82_DATA_IDX +// +//=============================================================================== +SSI_STATUS_MOTION CSO7_Proto::_read_data_8x(int iEP_Base) +{ + if (iEP_Base == EP_82_DATA_IDX) + { + TRACE2("_read_data_81() iEP : %X - ep_buff[iEP]._size : %X \r\n", iEP_Base, ep_buff[iEP_Base]._size); + int _ret; + _ret = usb_bulk_read(g_dev, ep_buff[iEP_Base]._ep, (char *)ep_buff[iEP_Base]._buffer,(int) ep_buff[iEP_Base]._size, 5000); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + ep_buff[EP_82_DATA_IDX]._hProtoPending = false; + } + else + { + TRACE1("Read Timeout %xx\n", *((char *)ep_buff[iEP_Base]._buffer)); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_NORMAL; + } + else + { + TRACE2("_read_data_81() iEP : %X - ep_buff[iEP]._size : %X \r\n", iEP_Base, ep_buff[iEP_Base]._size); + int _ret; + _ret = usb_interrupt_read(g_dev, ep_buff[iEP_Base]._ep, (char *)ep_buff[iEP_Base]._buffer,(int) ep_buff[iEP_Base]._size, 20); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + } + else + { + g_machine.InterruptFlag[0] = 0; + TRACE1("There is no data interrupt read from controller. %xx\n", *((char *)ep_buff[iEP_Base]._buffer)); + } + ep_buff[EP_01_CMD_IDX]._hProtoPending = false; + ep_buff[EP_81_DATA_IDX]._hProtoPending = false; + return SSI_STATUS_MOTION_NORMAL; + } +} + +//=============================================================================== +// _send_usb_cmd(iEP) sends data to the corresponding iEP channel. +// iEP = EP_S07_01 / EP_S07_02 EP_S07_01 = 0x01; EP_S07_02 = 0x02; +//=============================================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_usb_cmd(int iEP_Base) +{ + int _ret; + ep_buff[iEP_Base]._save_send_cmd = ep_buff[iEP_Base]._buffer[0]; + ep_buff[iEP_Base]._save_send_cmd0 = ep_buff[iEP_Base]._buffer[1]; + ep_buff[iEP_Base]._save_send_cmd1 = ep_buff[iEP_Base]._buffer[2]; + + TRACE3("_send_usb_cmd() iEP : %X - ep_buff[iEP]._save_send_cmd : %X ._buffer[0] : %X\r\n", iEP_Base, ep_buff[iEP_Base]._save_send_cmd, ep_buff[iEP_Base]._buffer[0]); + + _ret = usb_bulk_write(g_dev, ep_buff[iEP_Base]._ep, (char *)ep_buff[iEP_Base]._buffer,(int) ep_buff[iEP_Base]._size, 50); + if (_ret < 0) + { + TRACE("Write Timeout \n"); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + SetEvent(ep_buff[iEP_Base+1]._event); + ep_buff[iEP_Base]._hProtoPending = false; + return SSI_STATUS_MOTION_NORMAL; +} + +//=============================================================================== +// _write_usb_data_only(iEP) sends data to the corresponding iEP channel.No need to +//process the reap async +// iEP = EP_S07_01 / EP_S07_02 EP_S07_01 = 0x01; EP_S07_02 = 0x02; +//=============================================================================== +SSI_STATUS_MOTION CSO7_Proto::_write_usb_data_only(int iEP_Base) +{ + int _ret; + ep_buff[iEP_Base]._save_send_cmd = ep_buff[iEP_Base]._buffer[0]; + ep_buff[iEP_Base]._save_send_cmd0 = ep_buff[iEP_Base]._buffer[1]; + ep_buff[iEP_Base]._save_send_cmd1 = ep_buff[iEP_Base]._buffer[2]; + + TRACE3("_send_usb_cmd() iEP : %X - ep_buff[iEP]._save_send_cmd : %X ._buffer[0] : %X\r\n", iEP_Base, ep_buff[iEP_Base]._save_send_cmd, ep_buff[iEP_Base]._buffer[0]); + + _ret = usb_bulk_write(g_dev, ep_buff[iEP_Base]._ep, (char *)ep_buff[iEP_Base]._buffer,(int) ep_buff[iEP_Base]._size, 50); + if (_ret < 0) + { + TRACE("Write Timeout \n"); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + ep_buff[iEP_Base]._hProtoPending = false; + ep_buff[iEP_Base+1]._hProtoPending = false; + return SSI_STATUS_MOTION_NORMAL; +} +//================================================================= +// false: probe off ǰ̽ͷΪ⣻true: probe onǰ̽ͷΪӴʽ.// +//================================================================= +SSI_STATUS_MOTION CSO7_Proto::so7_motion_probe_on_off_(bool _bOnOff) +{ + if (_bOnOff) + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_PROBE_ON,0); + else + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_PROBE_OFF,1); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_reset_worktable_lower_left() +{ + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_RESET_LEFT,1); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_reset_worktable_top_right() +{ + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_RESET_RIGHT,1); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_stop_motor_to_get_laser_data() +{ + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_GET_LASE,1); + return SSI_STATUS_MOTION_NORMAL; +}; + +//================================================================= +// false: رռо true: о. // +//================================================================= +SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_on_off(bool _bOnOff) +{ + if (_bOnOff) + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_SWITCH_START,1); + else + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_SWITCH_CLOSE,1); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//================================================================= +// false: о true: о. // +//================================================================= +SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_up_down(bool _bOnOff) +{ + if (_bOnOff) + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_SWITCH_BOM,1); + else + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_M_SWITCH_TOP,1); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//================================================================== +//false: CT_LASE_TIMMER_ON  true: CT_LASE_TIMMER_OFF // +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_laser_on_off(bool _bOnOff) +{ + if (_bOnOff) + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_LASE_TIMMER_OFF,1); + else + _send_cmd_SO7_CMD_COMMON_COMMAND(CT_MOTOR,CT_LASE_TIMMER_ON,1); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//**********************************************************************// +//**********************************************************************// + + +//================================================================== +bool CSO7_Proto::so7_motion_is_homed() +{ + _send_cmd_SO7_CMD_GET_RESET_FLAG(); + if (g_machine.Sys_Reset_Flag == 1) + { + SetEvent(g_hHomedEvent); + return true; + } + else + return false; +}; + +//======================================================================== +// Move the stage left/right until the index location is non-zero +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_Dcc_Home() +{ + //ѯǷλ + _send_cmd_SO7_CMD_GET_RESET_FLAG(); + g_machine.cVerNumber=3; + if (g_machine.Sys_Reset_Flag == 1) + { + _send_cmd_SO7_CMD_SET_VER_NUMBER(); + SetEvent(g_hHomedEvent); + return SSI_STATUS_MOTION_NORMAL; + } + + m_bHomingActive = true; // Tell the world we need to home the stage + + // Home + so7_motion_reset_worktable_lower_left(); + + g_pLogger->SendAndFlushPerMode(_T("so7_motion_reset_worktable_lower_left.\n")); + TRACE0(" - waiting for X,Y,Zm to stop moving\n"); + //======================================== + // Wait until X-Y-Zm stopped moving + INT iRetry(0); + while (g_machine.Sys_Reset_Flag != 1) + { + Sleep(50); + _send_cmd_SO7_CMD_GET_RESET_FLAG(); + iRetry++; + } + g_pLogger->SendAndFlushPerMode(_T("[%d]waiting for X,Y,Zm to stop moving\n"),iRetry); + g_pLogger->SendAndFlushPerMode(_T("Home succeed.\n")); + //_get_xyz_index(g_machine.s_machine_config.x_axis._neg_working_limit,g_machine.s_machine_config.y_axis._neg_working_limit,g_machine.s_machine_config.z_axis._neg_working_limit); + _send_cmd_SO7_CMD_SET_VER_NUMBER(); + m_bHomingActive = false; + SetEvent(g_hHomedEvent); + return SSI_STATUS_MOTION_NORMAL; +} + + +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_startup(double dScaleResolutionX, double dScaleResolutionY, double dScaleResolutionZ) +{ + g_machine.s_machine_config.x_axis._scale_resolution = dScaleResolutionX; + g_machine.s_machine_config.y_axis._scale_resolution = dScaleResolutionY; + g_machine.s_machine_config.z_axis._scale_resolution = dScaleResolutionZ; + _start_machine(); + so7_motion_Dcc_Home(); + + _replay_capture(_T("Replay_Capture")); + return SSI_STATUS_MOTION_NORMAL; +}; +//======================================================================== +// read the configuration from the controller and populate the g_machine +// data structure +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::_get_xyz_index(long & lX, long & lY, long & lZ) +{ + _send_cmd_SO7_CMD_READ_AXIS_XYZ(); + + lX = g_machine.x._scale_pos._long_; + lY = g_machine.y._scale_pos._long_; + lZ = g_machine.z._scale_pos._long_; + + return SSI_STATUS_MOTION_NORMAL; +}; +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_position_xyz(double & dX, double & dY, double & dZ) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + long lX=0, lY=0, lZ=0; + + _send_cmd_SO7_CMD_READ_AXIS_XYZ(); + + lX = g_machine.x._scale_pos._long_; + lY = g_machine.y._scale_pos._long_; + lZ = g_machine.z._scale_pos._long_; + + dX = ScaleToMM(lX, g_machine.s_machine_config.x_axis._scale_resolution); + dY = ScaleToMM(lY, g_machine.s_machine_config.y_axis._scale_resolution); + dZ = ScaleToMM(lZ, g_machine.s_machine_config.z_axis._scale_resolution); + + dX -= g_machine.s_machine_config.x_axis._neg_working_limit; + dY -= g_machine.s_machine_config.y_axis._neg_working_limit; + dZ -= g_machine.s_machine_config.z_axis._neg_working_limit; + + return SSI_STATUS_MOTION_NORMAL; +}; +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + // get the current position + double dXStart, dYStart, dZStart; + so7_motion_get_position_xyz(dXStart, dYStart, dZStart); + + SO7AXISMOVE X; + SO7AXISMOVE Y; + SO7AXISMOVE Z; + + X.dFromMM = dXStart; + X.dToMM = dX; + Y.dFromMM = dYStart; + Y.dToMM = dY; + Z.dFromMM = dZStart; + Z.dToMM = dZ; + + X.from = MMtoScale(dXStart, g_machine.s_machine_config.x_axis._scale_resolution); + X.to = MMtoScale(dX, g_machine.s_machine_config.x_axis._scale_resolution); + Y.from = MMtoScale(dYStart, g_machine.s_machine_config.y_axis._scale_resolution); + Y.to = MMtoScale(dY, g_machine.s_machine_config.y_axis._scale_resolution); + Z.from = MMtoScale(dZStart, g_machine.s_machine_config.z_axis._scale_resolution); + Z.to = MMtoScale(dZ, g_machine.s_machine_config.z_axis._scale_resolution); + + // move the position to make the -X, -Y, -Z position 0,0,0 + //X.to += g_machine.s_machine_config.x_axis._neg_working_limit; + //Y.to += g_machine.s_machine_config.y_axis._neg_working_limit; + //Z.to += g_machine.s_machine_config.z_axis._neg_working_limit; + + //X.from += g_machine.s_machine_config.x_axis._neg_working_limit; + //Y.from += g_machine.s_machine_config.y_axis._neg_working_limit; + //Z.from += g_machine.s_machine_config.z_axis._neg_working_limit; + + g_machine.x._pos_fixed._long_=X.to-X.from; + g_machine.y._pos_fixed._long_=Y.to-Y.from; + g_machine.z._pos_fixed._long_=Z.to-Z.from; + + // _calculate_straightline_motion(g_machine.s_machine_config._dXYZSpeed); + _send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + +#pragma message("Test settle wait comparing the status bit to the scale monitor") + + if (bWait) + { + const long lSleep = 20; + const long lMaxLoopCnt = 5000/lSleep; // use max homing time of 20 seconds + long lLoopCnt = 0; + Sleep(lSleep); + + while (g_machine.InterruptFlag[0]!=CT_STOPXYZ && lLoopCnt < lMaxLoopCnt) + { + Sleep(lSleep); + _send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE(); + ++lLoopCnt; + } + g_machine.InterruptFlag[0]=0; + TRACE1("Presettle Time: %lf\n", TimeInSecs()); + //WaitForSettleXYZZM(); + TRACE1("Postsettle Time: %lf\n", TimeInSecs()); + } + + + return SSI_STATUS_MOTION_NORMAL; +}; + + +//======================================================================== +// This speed setting will be carried out in the next DCC move +// Full Speed -> dPercentSpeed = 100% +// Slow Speed -> dPercentSpeed = 20% +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_speed_xyz(double dPercentSpeed) +{ + g_machine.s_machine_config._dXYZSpeed = dPercentSpeed; + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_speed_xyz(double &dPercentSpeed) +{ + dPercentSpeed = g_machine.s_machine_config._dXYZSpeed; + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_3D_max_speed(double &dMaxSpeed) +{ + double dMaxSpeedX = g_machine.s_machine_config.x_axis._speed_max[0]; + double dMaxSpeedY = g_machine.s_machine_config.y_axis._speed_max[0]; + double dMaxSpeedZ = g_machine.s_machine_config.z_axis._speed_max[0]; + + dMaxSpeed = sqrt(dMaxSpeedX*dMaxSpeedX + dMaxSpeedY*dMaxSpeedY + dMaxSpeedZ*dMaxSpeedZ); + + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::_calculate_straightline_motion(double dSpeedMM) +{ + CString csAppPath; + GetAppPath(csAppPath); + CString csSO7ConfigFile = csAppPath + _T("\\Utility_Config.ini"); + Load_SevenOcean_Inifile(csSO7ConfigFile); + + g_machine.s_machine_config.x_axis._speed_max[0]=static_cast(g_machine.s_machine_config.x_axis._speed_max[0]*dSpeedMM); + g_machine.s_machine_config.y_axis._speed_max[0]=static_cast(g_machine.s_machine_config.y_axis._speed_max[0]*dSpeedMM); + g_machine.s_machine_config.z_axis._speed_max[0]=static_cast(g_machine.s_machine_config.z_axis._speed_max[0]*dSpeedMM); + + _send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,0); + _send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,0); + _send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,0); + return SSI_STATUS_MOTION_NORMAL; +} + +//**********************************************************************// + +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_set_scale_position(long lScale) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + TRACE1("caller set scale position = %X \r\n", lScale); + lScale += g_machine.s_machine_config.zm_axis._neg_working_limit; + g_machine.zm._pos_fixed._long_=(lScale); + _send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_scale_position(long &lScale) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + _send_cmd_SO7_CMD_READ_V_DATA(); + lScale = g_machine.zm._scale_pos._long_; + + return SSI_STATUS_MOTION_NORMAL; +}; + +//================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + + neg_scale_range = g_machine.s_machine_config.zm_axis._neg_working_limit; + pos_scale_range = g_machine.s_machine_config.zm_axis._pos_working_limit; + + TRACE2("Get Scale Range : %X, %X \r\n",neg_scale_range, pos_scale_range); + return SSI_STATUS_MOTION_NORMAL; +}; +//**********************************************************************// +void CSO7_Proto::so7_set_full_ringlight_data(long lIntensity) +{ + g_machine.s_lights_value.segment[0]=static_cast(0xff); + g_machine.s_lights_value.segment[1]=static_cast(0xff); + g_machine.s_lights_value._ring_light=static_cast(lIntensity); + +}; +//========================================================================================= +void CSO7_Proto::so7_set_ringlight_data(long lMaxSize, double *pSegments) +{ + if (pSegments && (lMaxSize == (TWO_RINGS*EIGHT_SEGS))) + { + BYTE cRingSwitchOn=0x01; + BYTE cRingSwitchOff=0xfe; + for (int ii=0 ; ii1) + { + g_machine.s_lights_value.segment[ii] |= (cRingSwitchOn<((pSegments[ii * EIGHT_SEGS + jj])/100.0 * (MAXLIGHTVALUE-1)); + } + else + { + g_machine.s_lights_value.segment[ii] &= (cRingSwitchOff<(dTopPercent* (MAXLIGHTVALUE - 1)/100.0 ))+1; + g_machine.s_lights_value._bottom_light = (static_cast(dBottomPercent*(MAXLIGHTVALUE - 1)/100.0))+1; + g_pLog->SendAndFlushPerMode(_T("dBottomPercent: %f dTopPercent: %f\n"),dBottomPercent,dTopPercent); + g_pLog->SendAndFlushPerMode(_T("so7_light_set_lamp_state bottom: %d top: %d\n"), g_machine.s_lights_value._bottom_light,g_machine.s_lights_value._top_light); + TRACE2("so7_light_set_lamp_state bottom: %d top: %d\n", + g_machine.s_lights_value._bottom_light,g_machine.s_lights_value._top_light); + delete g_pLog; + g_pLog=NULL; + return SSI_STATUS_MOTION_NORMAL; +}; + + + + +//**********************************************************************// +//**********************************************************************// + + +//================================================================================== +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_X(char SpeedGear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVEX; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = SpeedGear; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_Y(char SpeedGear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVEY; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = SpeedGear; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_Z(char SpeedGear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVEZ; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = SpeedGear; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_ZM(char SpeedGear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVEV; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = SpeedGear; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_STOP_MOVE_XYZ() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_STOPA; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x04; + ep_buff[EP_81_DATA_IDX]._size = 0x04; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_RESET_XYZ() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_RESET; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0X00; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_RESET_V() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_TESTV; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_STOP_V() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_STOPV; + + ep_buff[EP_02_CMD_IDX]._size = 0x02; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_X() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVETOX; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=(((g_machine.x._pos_fixed._char_[3])<0x80)?(g_machine.x._pos_fixed._char_[2]):((g_machine.x._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.x._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.x._pos_fixed._char_[0]); + + + ep_buff[EP_02_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Y() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVETOY; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=(((g_machine.y._pos_fixed._char_[3])<0x80)?(g_machine.y._pos_fixed._char_[2]):((g_machine.y._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.y._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.y._pos_fixed._char_[0]); + + + ep_buff[EP_02_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x07; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Z() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVETOZ; + if(g_machine.z._pos_fixed._long_<0) + { + g_machine.z._pos_fixed._long_=-g_machine.z._pos_fixed._long_; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=((g_machine.z._pos_fixed._char_[2])|0x80);//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.z._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.z._pos_fixed._char_[0]); + } + else + { + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=(g_machine.z._pos_fixed._char_[2]);//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.z._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.z._pos_fixed._char_[0]); + } + + + ep_buff[EP_02_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x07; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_ZM() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_MOVETOV; + if(g_machine.zm._pos_fixed._long_<0) + { + g_machine.zm._pos_fixed._long_=-g_machine.zm._pos_fixed._long_; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=((g_machine.zm._pos_fixed._char_[2])|0x80);//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.zm._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.zm._pos_fixed._char_[0]); + } + else + { + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=(g_machine.zm._pos_fixed._char_[2]);//λ + *(ep_buff[EP_02_CMD_IDX]._buffer+3)=(g_machine.zm._pos_fixed._char_[1]); + *(ep_buff[EP_02_CMD_IDX]._buffer+4)=(g_machine.zm._pos_fixed._char_[0]); + } + + ep_buff[EP_02_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x07; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(char ProbeType) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + pSO7_CMD_02->uCmdByte = CT_MOTOR; + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.uSubCmdByte =ProbeType; + + if(g_machine.x._pos_fixed._long_<0) + { + g_machine.x._pos_fixed._long_=-g_machine.x._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[0]=(g_machine.x._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[1]=(g_machine.x._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[2]=(g_machine.x._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[0]=(g_machine.x._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[1]=(g_machine.x._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[2]=(g_machine.x._pos_fixed._char_[0]); + } + + if(g_machine.y._pos_fixed._long_<0) + { + g_machine.y._pos_fixed._long_=-g_machine.y._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[3]=(g_machine.y._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[4]=(g_machine.y._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[5]=(g_machine.y._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[3]=(g_machine.y._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[4]=(g_machine.y._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[5]=(g_machine.y._pos_fixed._char_[0]); + } + + if(g_machine.z._pos_fixed._long_<0) + { + g_machine.z._pos_fixed._long_=-g_machine.z._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[6]=(g_machine.z._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[7]=(g_machine.z._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[8]=(g_machine.z._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[6]=(g_machine.z._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[7]=(g_machine.z._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVE_TO_XYZ.data[8]=(g_machine.z._pos_fixed._char_[0]); + } + + + ep_buff[EP_02_CMD_IDX]._size = 0x0C; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + pSO7_CMD_02->uCmdByte = CT_MOTOR; + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.uSubCmdByte =CT_MOVETOXYZV; + + if(g_machine.x._pos_fixed._long_<0) + { + g_machine.x._pos_fixed._long_=-g_machine.x._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[0]=(g_machine.x._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[1]=(g_machine.x._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[2]=(g_machine.x._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[0]=(g_machine.x._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[1]=(g_machine.x._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[2]=(g_machine.x._pos_fixed._char_[0]); + } + + if(g_machine.y._pos_fixed._long_<0) + { + g_machine.y._pos_fixed._long_=-g_machine.y._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[3]=(g_machine.y._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[4]=(g_machine.y._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[5]=(g_machine.y._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[3]=(g_machine.y._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[4]=(g_machine.y._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[5]=(g_machine.y._pos_fixed._char_[0]); + } + + if(g_machine.z._pos_fixed._long_<0) + { + g_machine.z._pos_fixed._long_=-g_machine.z._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[6]=(g_machine.z._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[7]=(g_machine.z._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[8]=(g_machine.z._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[6]=(g_machine.z._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[7]=(g_machine.z._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[8]=(g_machine.z._pos_fixed._char_[0]); + } + + if(g_machine.zm._pos_fixed._long_<0) + { + g_machine.zm._pos_fixed._long_=-g_machine.z._pos_fixed._long_; + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[6]=(g_machine.zm._pos_fixed._char_[2] | 0x80);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[7]=(g_machine.zm._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[8]=(g_machine.zm._pos_fixed._char_[0]); + + } + else + { + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[9]=(g_machine.zm._pos_fixed._char_[2]);//λ + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[10]=(g_machine.zm._pos_fixed._char_[1]); + pSO7_CMD_02->s_SO7_CMD_MOVETOXYZV.data[11]=(g_machine.zm._pos_fixed._char_[0]); + } + + + ep_buff[EP_02_CMD_IDX]._size = 0x0F; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_AXIS_XYZ() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_DATA; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_AXISXYZ; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x09; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_PROBE_XYZ() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_DATA; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_PROBEXYZ; + *(ep_buff[EP_02_CMD_IDX]._buffer+2)=0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x09; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_V_DATA() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_DATA; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_AXISV; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x03; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_GET_RESET_FLAG() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_SCALE; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_GET_RESET_FLAG; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_GET_FIXTURE_VALUE() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_M_SWITCH_VALUE; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0x00; + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = 0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x04; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_RESET_FLAG() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_SCALE; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_RESET_FLAG; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 0x01; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_LIGHT_SIZE(char subCMD,BYTE LightValue) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_LIGHT; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = subCMD;//CT_LIGHT/1-4/_SIZE or CT_LIGHT/1-4/_SWITCH + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = LightValue-1; + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = 0; + + ep_buff[EP_02_CMD_IDX]._size = 0x04; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + pSO7_CMD_02->uCmdByte = CT_LIGHT; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT.uSubCmdByte =CT_LIGHT_CMD; + + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT.uStartCmdByte =(BYTE)0xA1; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._bottom_light =g_machine.s_lights_value._bottom_light; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._top_light =g_machine.s_lights_value._top_light; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._ring_light =g_machine.s_lights_value._ring_light; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._coaxial_light =g_machine.s_lights_value._coaxial_light; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._spare_light1 =g_machine.s_lights_value._spare_light1; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._outer_ring_light_switch =g_machine.s_lights_value.segment[0]; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT._inner_ring_light_switch =g_machine.s_lights_value.segment[1]; + pSO7_CMD_02->s_SO7_CMD_SET_LIGHT.uEndCmdByte =(BYTE)0xB1; + + ep_buff[EP_02_CMD_IDX]._size = 0x0B; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_VER_NUMBER() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_SCALE; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_VERNO; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = g_machine.cVerNumber; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_CORRECTION_SCALE(char cAxisType) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_SCALE; + + if (cAxisType == 0) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_LINE_X; + else if(cAxisType == 1) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_LINE_Y; + else if(cAxisType == 2) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_LINE_Z; + + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 1; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_SECTION(char cAxisType) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_SCALE; + + if (cAxisType == 0) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SECTION_X; + else if(cAxisType == 1) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SECTION_Y; + else if(cAxisType == 2) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SECTION_Z; + + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 1; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_COMMON_COMMAND(char Cmd,char SubCmd,char Type) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = Cmd; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = SubCmd; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = Type; + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = 0x00; + + ep_buff[EP_02_CMD_IDX]._size = 0x04; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_COMMON_COMMAND_DATA(char Cmd,char SubCmd,char Type,char Data) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = Cmd; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = SubCmd; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = Type; + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = Data; + + ep_buff[EP_02_CMD_IDX]._size = 0x04; + ep_buff[EP_82_DATA_IDX]._size = 0x10; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================= +//xyz_gear=0(slow) 1 2 3(fast); +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_ZOOM_SPEED(char xyz_gear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SPEEDV; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = xyz_gear; + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = g_machine.s_machine_config.zm_axis._speed._char_[1]; + *(ep_buff[EP_02_CMD_IDX]._buffer+4) = g_machine.s_machine_config.zm_axis._speed._char_[0]; + + + ep_buff[EP_02_CMD_IDX]._size = 0x05; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; + +} + + +//============================================================= +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(char axis_type,char xyz_gear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + int iDeceDistance = 0; + + if(axis_type == 0) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SPEEDX; + else if(axis_type == 1) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SPEEDY; + else if(axis_type == 2) + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_SPEEDZ; + + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = xyz_gear+1; + + if(axis_type==0) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = g_machine.s_machine_config.x_axis._speed_base[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+4) = g_machine.s_machine_config.x_axis._speed_fresh[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+5) = g_machine.s_machine_config.x_axis._speed_start[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+6) = g_machine.s_machine_config.x_axis._speed_max[xyz_gear]; + iDeceDistance =(int)((g_machine.s_machine_config.x_axis._speed_slow_dis[xyz_gear] ) * 1000); + } + else if(axis_type==1) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = g_machine.s_machine_config.y_axis._speed_base[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+4) = g_machine.s_machine_config.y_axis._speed_fresh[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+5) = g_machine.s_machine_config.y_axis._speed_start[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+6) = g_machine.s_machine_config.y_axis._speed_max[xyz_gear]; + iDeceDistance =(int)((g_machine.s_machine_config.y_axis._speed_slow_dis[xyz_gear] ) * 1000); + + } + else if(axis_type==2) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+3) = g_machine.s_machine_config.z_axis._speed_base[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+4) = g_machine.s_machine_config.z_axis._speed_fresh[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+5) = g_machine.s_machine_config.z_axis._speed_start[xyz_gear]; + *(ep_buff[EP_02_CMD_IDX]._buffer+6) = g_machine.s_machine_config.z_axis._speed_max[xyz_gear]; + iDeceDistance =(int)((g_machine.s_machine_config.z_axis._speed_slow_dis[xyz_gear] ) * 1000); + + } + *(ep_buff[EP_02_CMD_IDX]._buffer+7) =static_cast(iDeceDistance/1000); + *(ep_buff[EP_02_CMD_IDX]._buffer+7) = *(ep_buff[EP_02_CMD_IDX]._buffer+7) &0x0f; + *(ep_buff[EP_02_CMD_IDX]._buffer+8) = static_cast((iDeceDistance%1000)/100); + *(ep_buff[EP_02_CMD_IDX]._buffer+8) = *(ep_buff[EP_02_CMD_IDX]._buffer+8) & 0x0f; + *(ep_buff[EP_02_CMD_IDX]._buffer+9) = static_cast((iDeceDistance%100)/10); + *(ep_buff[EP_02_CMD_IDX]._buffer+9) = *(ep_buff[EP_02_CMD_IDX]._buffer+9) & 0x0f; + *(ep_buff[EP_02_CMD_IDX]._buffer+10)= static_cast(iDeceDistance%10); + *(ep_buff[EP_02_CMD_IDX]._buffer+10)=*(ep_buff[EP_02_CMD_IDX]._buffer+10) & 0x0f; + + + ep_buff[EP_02_CMD_IDX]._size = 0x0b; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; + +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_SPEED_PRECISION(char axis_type) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + + if(axis_type == 0) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_PRECISIONX; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) =static_cast(g_machine.s_machine_config.x_axis._motor_precision*1000+1); + } + else if(axis_type == 1) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_PRECISIONY; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = static_cast(g_machine.s_machine_config.y_axis._motor_precision*1000+1); + } + else if (axis_type == 2) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_SET_PRECISIONZ; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = static_cast(g_machine.s_machine_config.z_axis._motor_precision*1000+1); + } + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x06; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_SET_MOTOR_SPEED_WHEELBASE_PARAMETER() +{ + + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + float fmotor_wheelbasex(0.0); + float fmotor_wheelbasey(0.0); + float fmotor_wheelbasez(0.0); + + fmotor_wheelbasex=static_cast(((g_machine.s_machine_config.x_axis._scale_resolution)*(g_machine._motor_pulse_num))/(g_machine.s_machine_config.x_axis._motor_wheelbase*1000)); + fmotor_wheelbasey=static_cast(((g_machine.s_machine_config.y_axis._scale_resolution)*(g_machine._motor_pulse_num))/(g_machine.s_machine_config.y_axis._motor_wheelbase*1000)); + fmotor_wheelbasez=static_cast(((g_machine.s_machine_config.z_axis._scale_resolution)*(g_machine._motor_pulse_num))/(g_machine.s_machine_config.z_axis._motor_wheelbase*1000)); + + *(ep_buff[EP_02_CMD_IDX]._buffer)=CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1)=CT_SET_MOTOR_CAL; + memcpy(ep_buff[EP_02_CMD_IDX]._buffer+2,&fmotor_wheelbasex,4); + memcpy(ep_buff[EP_02_CMD_IDX]._buffer+6,&fmotor_wheelbasey,4); + memcpy(ep_buff[EP_02_CMD_IDX]._buffer+10,&fmotor_wheelbasez,4); + + *(ep_buff[EP_02_CMD_IDX]._buffer+14)=0; + + ep_buff[EP_02_CMD_IDX]._size = 0x0f; + ep_buff[EP_82_DATA_IDX]._size = 0x45; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_SPEED_PARAMETER(char axis_type,char xyz_gear) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + + if(axis_type == 0) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_SPEEDX; + } + else if(axis_type == 1) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_SPEEDY; + } + else if (axis_type == 2) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_SPEEDZ; + } + + *(ep_buff[EP_02_CMD_IDX]._buffer+2)= xyz_gear; + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x06; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; + +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_SPEED_PRECISION(char axis_type) +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + + if(axis_type == 0) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_PRECISIONX; + } + else if(axis_type == 1) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_PRECISIONY; + } + else if (axis_type == 2) + { + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_PRECISIONZ; + } + + ep_buff[EP_02_CMD_IDX]._size = 0x02; + ep_buff[EP_82_DATA_IDX]._size = 0x01; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_READ_MOTOR_CAL; + + ep_buff[EP_02_CMD_IDX]._size = 0x02; + ep_buff[EP_82_DATA_IDX]._size = 0x0C; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + + ep_buff[EP_81_DATA_IDX]._size = 0x02; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE1; + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_READ_ZOOM_MOTION_STATUS() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_TEST_STOP; + + ep_buff[EP_02_CMD_IDX]._size = 0x02; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE1; + g_hEP8x_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_OPEN_KEYENCE_LASER() +{ + WaitForSingleObject(g_hEP02_Serial_Mutex, INFINITE); + memset(ep_buff[EP_02_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_02_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_02_CMD_IDX]._buffer+1) = CT_GET_LASE; + *(ep_buff[EP_02_CMD_IDX]._buffer+2) = 1; + + + ep_buff[EP_02_CMD_IDX]._size = 0x03; + ep_buff[EP_82_DATA_IDX]._size = 0x02; + + g_hEP02_Thread_State=THREAD_RUNNING_STATE2; + _do_single_threaded_usb_comm(EP_02_CMD_IDX); + ReleaseMutex(g_hEP02_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_X() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_Y() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_Z() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_ZM() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_RESET_XYZ() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_X() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_Y() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_Z() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_ZM() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_XYZ() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_AXIS_XYZ() +{ + g_machine.x._scale_pos._long_=0; + g_machine.y._scale_pos._long_=0; + g_machine.z._scale_pos._long_=0; + + g_machine.y._scale_pos._char_[2] = *(ep_buff[EP_82_DATA_IDX]._buffer); + g_machine.y._scale_pos._char_[1] = *(ep_buff[EP_82_DATA_IDX]._buffer+1); + g_machine.y._scale_pos._char_[0] = *(ep_buff[EP_82_DATA_IDX]._buffer+2); + g_machine.y._scale_pos._char_[3] = 0; + g_machine.x._scale_pos._char_[2] = *(ep_buff[EP_82_DATA_IDX]._buffer+3); + g_machine.x._scale_pos._char_[1] = *(ep_buff[EP_82_DATA_IDX]._buffer+4); + g_machine.x._scale_pos._char_[0] = *(ep_buff[EP_82_DATA_IDX]._buffer+5); + g_machine.x._scale_pos._char_[3] = 0; + g_machine.z._scale_pos._char_[2] = *(ep_buff[EP_82_DATA_IDX]._buffer+6); + g_machine.z._scale_pos._char_[1] = *(ep_buff[EP_82_DATA_IDX]._buffer+7); + g_machine.z._scale_pos._char_[0] = *(ep_buff[EP_82_DATA_IDX]._buffer+8); + g_machine.z._scale_pos._char_[3] = 0; + + if (g_machine.x._scale_pos._long_ > 8388608) + g_machine.x._scale_pos._long_=g_machine.x._scale_pos._long_-16777216; + + if (g_machine.y._scale_pos._long_ > 8388608) + g_machine.y._scale_pos._long_=g_machine.y._scale_pos._long_-16777216; + + if (g_machine.z._scale_pos._long_ > 8388608) + g_machine.z._scale_pos._long_=g_machine.z._scale_pos._long_-16777216; + + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_PROBE_XYZ() +{ + g_machine.y._scale_probe= _3char2long((unsigned char*)(ep_buff[EP_82_DATA_IDX]._buffer)); + g_machine.x._scale_probe= _3char2long((unsigned char*)(ep_buff[EP_82_DATA_IDX]._buffer+3)); + g_machine.z._scale_probe= _3char2long((unsigned char*)(ep_buff[EP_82_DATA_IDX]._buffer+6)); + + if (g_machine.x._scale_probe > 8388608) + g_machine.x._scale_probe=g_machine.x._scale_probe-16777216; + + if (g_machine.y._scale_probe > 8388608) + g_machine.y._scale_probe=g_machine.y._scale_probe-16777216; + + if (g_machine.z._scale_probe > 8388608) + g_machine.z._scale_probe=g_machine.z._scale_probe-16777216; + + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_V_DATA() +{ + + g_machine.zm._scale_pos._char_[2] = *(ep_buff[EP_82_DATA_IDX]._buffer); + g_machine.zm._scale_pos._char_[1] = *(ep_buff[EP_82_DATA_IDX]._buffer+1); + g_machine.zm._scale_pos._char_[0] = *(ep_buff[EP_82_DATA_IDX]._buffer+2); + g_machine.zm._scale_pos._char_[3] = 0; + + + if (g_machine.zm._scale_pos._long_ > 8388608) + g_machine.zm._scale_pos._long_=g_machine.zm._scale_pos._long_-16777216; + return SSI_STATUS_MOTION_NORMAL; +}; + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_GET_GET_RESET_FLAG() +{ + g_machine.Sys_Reset_Flag=*(ep_buff[EP_82_DATA_IDX]._buffer); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_SET_LIGHT() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_GET_GET_FIXTURE_VALUE() +{ + g_machine.cFixtureFlag = ep_buff[EP_82_DATA_IDX]._buffer[0] & 0x3f; + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_SET_SPEED_MOTOR_WHEELBASE_PARAMETER() +{ + return SSI_STATUS_MOTION_NORMAL; +} +//=============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_SET_SPEED_PARAMETER() +{ + return SSI_STATUS_MOTION_NORMAL; +} +//=============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_SET_SPEED_PRECISION() +{ + return SSI_STATUS_MOTION_NORMAL; +} +//=============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PARAMETERX() +{ + + g_machine.s_machine_config.x_axis._speed_base[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer); + g_machine.s_machine_config.x_axis._speed_fresh[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+1); + g_machine.s_machine_config.x_axis._speed_start[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+2); + g_machine.s_machine_config.x_axis._speed_max[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+3); + g_machine.s_machine_config.x_axis._speed_slow_dis[ep_buff[EP_02_CMD_IDX]._save_send_cmd1] =(static_cast(((((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[4])*256))+((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[5])))/1000; + return SSI_STATUS_MOTION_NORMAL; +} +//=============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PARAMETERZ() +{ + g_machine.s_machine_config.z_axis._speed_base[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer); + g_machine.s_machine_config.z_axis._speed_fresh[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+1); + g_machine.s_machine_config.z_axis._speed_start[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+2); + g_machine.s_machine_config.z_axis._speed_max[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+3); + g_machine.s_machine_config.z_axis._speed_slow_dis[ep_buff[EP_02_CMD_IDX]._save_send_cmd1] =(static_cast(((((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[4])*256))+((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[5])))/1000; + + return SSI_STATUS_MOTION_NORMAL; +} +//=============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PARAMETERY() +{ + g_machine.s_machine_config.y_axis._speed_base[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer); + g_machine.s_machine_config.y_axis._speed_fresh[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+1); + g_machine.s_machine_config.y_axis._speed_start[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+2); + g_machine.s_machine_config.y_axis._speed_max[ep_buff[EP_02_CMD_IDX]._save_send_cmd1]=*(ep_buff[EP_82_DATA_IDX]._buffer+3); + g_machine.s_machine_config.y_axis._speed_slow_dis[ep_buff[EP_02_CMD_IDX]._save_send_cmd1] =(static_cast(((((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[4])*256))+((BYTE)ep_buff[EP_82_DATA_IDX]._buffer[5])))/1000; + return SSI_STATUS_MOTION_NORMAL; +} + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PRECISIONX() +{ + g_machine.s_machine_config.x_axis._motor_precision=(static_cast(ep_buff[EP_82_DATA_IDX]._buffer[0]-1))/1000; + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PRECISIONY() +{ + g_machine.s_machine_config.y_axis._motor_precision=(static_cast(ep_buff[EP_82_DATA_IDX]._buffer[0]-1))/1000; + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_SPEED_PRECISIONZ() +{ + g_machine.s_machine_config.z_axis._motor_precision=(static_cast(ep_buff[EP_82_DATA_IDX]._buffer[0]-1))/1000; + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER() +{ + float fmotor_wheelbasex(0.0); + float fmotor_wheelbasey(0.0); + float fmotor_wheelbasez(0.0); + + memcpy(&fmotor_wheelbasex,ep_buff[EP_82_DATA_IDX]._buffer,4); + g_machine.s_machine_config.x_axis._motor_wheelbase=((g_machine.s_machine_config.x_axis._scale_resolution)*(g_machine._motor_pulse_num))/(fmotor_wheelbasex*1000); + memcpy(&fmotor_wheelbasey,ep_buff[EP_82_DATA_IDX]._buffer+4,4); + g_machine.s_machine_config.y_axis._motor_wheelbase=((g_machine.s_machine_config.y_axis._scale_resolution)*(g_machine._motor_pulse_num))/(fmotor_wheelbasey*1000); + memcpy(&fmotor_wheelbasez,ep_buff[EP_82_DATA_IDX]._buffer+8,4); + g_machine.s_machine_config.z_axis._motor_wheelbase=((g_machine.s_machine_config.z_axis._scale_resolution)*(g_machine._motor_pulse_num))/(fmotor_wheelbasez*1000); + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_ZOOM_MOTION_STATUS() +{ + g_machine.s_status._bIsZMMotionFinished=*(ep_buff[EP_82_DATA_IDX]._buffer); + return SSI_STATUS_MOTION_NORMAL; +} +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_READ_INTERRUPT_MESSAGE() +{ + g_machine.InterruptFlag[0]=*(ep_buff[EP_81_DATA_IDX]._buffer); + g_machine.InterruptFlag[1]=*(ep_buff[EP_81_DATA_IDX]._buffer+1); + return SSI_STATUS_MOTION_NORMAL; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.h b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.h new file mode 100644 index 0000000..f6717da --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/SO7_Proto.h @@ -0,0 +1,433 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef AFX_SO7_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + #define AFX_SO7_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#if _MSC_VER > 1000 + #pragma once +#endif // _MSC_VER > 1000 + +#include "..\Tools\UsbUtility\logger.h" +#include "CMD_H.h" +#include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h" +#include "..\MicroVu\SsiStatus.h" + +#define MAX_BUFF_SIZE 0x200 + +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +#define USB_DEVICE_DESCRIPTOR_TYPE 1 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 2 + +#define THREAD_RUNNING_STATE1 0 +#define THREAD_RUNNING_STATE2 2 +#define THREAD_PAUSED 1 +#define THREAD_EXIT -1 + +// Device configuration and interface id. +#define SO7_USB_CONFIG 1 +#define SO7_USB_INTF 0 + + + +#define EP_S07_01 0x01 +#define EP_S07_02 0x02 +#define EP_S07_03 0x03 +#define EP_S07_81 0x81 +#define EP_S07_82 0x82 +#define EP_S07_84 0x84 + +#define EP_01_CMD_IDX 0 // index to usb buffers +#define EP_81_DATA_IDX 1 // +#define EP_02_CMD_IDX 2 // +#define EP_82_DATA_IDX 3 // +#define EP_03_CMD_IDX 4 // +#define EP_84_DATA_IDX 5 // + +#define lEPSIZE 6 +#define MAXRINGS 5 // for MicroVu Vertex 220 +#define MAXSEGS 8 + +#define TWO_RINGS 2 +#define EIGHT_SEGS 8 +#define FIVE_RINGS 5 + +const long MAX_INTENSITY = 0x3FF; +#define MAXLIGHTVALUE 256 + + +#pragma pack(push) +#pragma pack(1) +//**************************************************************************************************** +// Set the _status to Idle after reply data has been received. +// How to recover? In order to send data, _status must be Idle. If the system is not available +// for 1 second, assume something wrong and treat it as "TimeOut". +// Another way to do this is to lock this structure is to use a mutex to ensure single-threaded +// access. +//**************************************************************************************************** +//==================================================================================================== + +typedef struct s_so7_axis // axis parameters +{ + char _Move_Speed_Gear; + union + { + long _long_; + char _char_[4]; + }_pos_fixed; + union + { + long _long_; + char _char_[4]; + }_scale_pos; + double _d_cur_pos_; + long _scale_probe; + double _dSet_Zero_Pos; + long _lSet_Zero_Pos; +} SO7AXIS; +struct s_so7_axis_config // axis configuration +{ + double _motor_precision;//set precision + double _motor_wheelbase;//set wheelbase + + char _speed_base[5]; + char _speed_fresh[5]; + char _speed_start[5]; + char _speed_max[5]; + double _speed_slow_dis[5]; + + long _scale_range; + double _neg_working_limit; + double _pos_working_limit; + + double _scale_resolution; + bool _bhomed; +}; +struct s_so7_zm_axis_config // zm configuration +{ + int _ComPort; + double _StartDegree; + double _EndDegree; + double _RelativeZeroDegree; + double _Deadband; + int _ReadingInterval; + double _PulseScale; + short _SpeedFast; + short _SpeedSlow; + CString _ProductID; + long _neg_working_limit; + long _pos_working_limit; + double _neg_deg_working_limit; // within the limits + double _pos_deg_working_limit; + + union + { + short _short_; + char _char_[2]; + }_speed; +}; +struct s_so7_machine_interface_config +{ + BOOL _EnCloseLoop; + int _RetryTimes; + double _ShiftPositionX; + double _ShiftPositionY; + double _ShiftPositionZ; +}; + +//====================== +typedef struct s_so7_xyzzm +{ + bool bFast; + long from; + long to; + long speed; + long acc; + long dec; + double dFromMM; + double dToMM; +} SO7AXISMOVE; +//-------------------------------------------------------------------- +// +//-------------------------------------------------------------------- +struct struct_so7_machine +{ // g_machine structure + struct s_machine_config + { + double _dXYZSpeed; + + struct s_so7_axis_config x_axis; + struct s_so7_axis_config y_axis; + struct s_so7_axis_config z_axis; + struct s_so7_zm_axis_config zm_axis; + struct s_so7_machine_interface_config motion; + } s_machine_config; + struct s_status + { + bool _homed; + bool _machine_running; + bool _bXMoving; + bool _bYMoving; + bool _bZMoving; + bool _bZMMoving; + char _bIsZMMotionFinished; + bool _bZMHoming; + bool _bXYZZMIdle; + } s_status; + union { + struct s_lights_value + { + char _top_light; + char _bottom_light; + char _ring_light; + char _coaxial_light; + char _spare_light1; + char segment[TWO_RINGS]; + } s_lights_value; + }; + char cFixtureFlag; + char Light_Size; + char Light_Switch; + char ADC_Number; + int ADC_Value; + char Sys_Reset_Flag; + char cVerNumber; + char InterruptFlag[2]; + int _motor_pulse_num; + + struct s_so7_axis x; + struct s_so7_axis y; + struct s_so7_axis z; + struct s_so7_axis zm; + +}; + +#define SEVENOCEAN_VID 0x4532 +#define SEVENOCEAN_PID 0x5567 + +//**************************************************************************************************** +// Binary SevenOcean command structure, out going +// +//**************************************************************************************************** +#define pSO7_CMD_02 ((s_SO7_CMD_BUFF_02 *) ep_buff[EP_02_CMD_IDX]._buffer) + +struct s_SO7_CMD_BUFF_02 +{ + UCHAR uCmdByte; + union + { + struct + { + BYTE uSubCmdByte; + char data[9]; + }s_SO7_CMD_MOVE_TO_XYZ; + struct + { + BYTE uSubCmdByte; + char data[12]; + }s_SO7_CMD_MOVETOXYZV; + struct + { + BYTE uSubCmdByte; + BYTE uStartCmdByte; + char _bottom_light; + char _top_light; + char _ring_light; + char _coaxial_light; + char _spare_light1; + char _outer_ring_light_switch; + char _inner_ring_light_switch; + BYTE uEndCmdByte; + }s_SO7_CMD_SET_LIGHT; + }; +}; + + +#pragma pack(pop) + +//====================== +struct struct_so7_ep_buff +{ + int _ep; + BYTE _save_send_cmd; + BYTE _save_send_cmd0; + BYTE _save_send_cmd1; + char *_buffer; // MAX_BUFF_SIZE + int _size; + void *_async_context; + BOOL _hProtoPending; + HANDLE _event; +}; + +//====================================================================================== +class CSO7_Proto +{ +public: + // EP 81/82 channel threads. + static int g_hEP8x_Thread_State; + static unsigned __stdcall g_EP8x_Thread(LPVOID pThis); + static HANDLE g_hEP8x_Thread_Id; + + // EP 02channel threads. + static int g_hEP02_Thread_State; + static unsigned __stdcall g_EP02_Thread(LPVOID pThis); + static HANDLE g_hEP02_Thread_Id; + static HANDLE g_hEP02_Serial_Mutex; // EP02 + + static HANDLE g_hHomedEvent; + + // + CSO7_Proto(); + virtual ~CSO7_Proto(); + + // Global Structures + static struct_so7_ep_buff ep_buff[lEPSIZE]; + static struct_so7_machine g_machine; + + + SSI_STATUS_MOTION Init_SO7Usb(); + SSI_STATUS_MOTION Exit_SO7Usb(); + + usb_dev_handle* _open_usb_dev(void); + SSI_STATUS_MOTION _do_single_threaded_usb_comm(int iEP); + + SSI_STATUS_MOTION _read_data_8x(int iEP_Base); + SSI_STATUS_MOTION _send_usb_cmd(int iEP_Base); + SSI_STATUS_MOTION _write_usb_data_only(int iEP_Base); + static void _process_rcv_transfer_data(int iEP); + + static double TimeInSecs(void); + static CLogger* g_pLogger; + static usb_dev_handle *g_dev; + bool m_bHomingActive; + + double ScaleToMM(long lCount, double dResolution); + long MMtoScale(double lDistanceMM, double dResolution); + static void Trace_EP_Buff(long lIndex); + + static void _swap_byte(unsigned short &Val); + static void _reverse_dword(DWORD *); + static void _scale2inch(unsigned long scale, double &inch); + static void _inch2scale(unsigned long &scale, double inch); + static long _4char2long(unsigned char *cBuff); + static long _3char2long(unsigned char *cBuff); + static void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len); + + SSI_STATUS_MOTION _replay_capture(CString cFileName); + SSI_STATUS_MOTION _process_replay_capture_commands(char *inBuff, FILE* pInFile); + SSI_STATUS_MOTION Load_SevenOcean_Inifile(CString csSO7INIFile); + SSI_STATUS_MOTION Save_SevenOcean_Inifile(CString csSO7INIFile); + SSI_STATUS_MOTION Load_So7_Config(); + SSI_STATUS_MOTION Save_So7_Config(); + SSI_STATUS_MOTION GetAppPath(CString &Path); + SSI_STATUS_MOTION ExtractAppPath(CString &Path); + + SSI_STATUS_MOTION so7_motion_startup(double x_scale_resolution, double y_scale_resolution, double z_scale_resolution); + bool so7_motion_is_homed(); + SSI_STATUS_MOTION so7_motion_Dcc_Home(); + SSI_STATUS_MOTION _start_machine(); + SSI_STATUS_MOTION _shutdown_machine(); + SSI_STATUS_MOTION so7_motion_probe_on_off_(bool _bOnOff); + SSI_STATUS_MOTION so7_motion_reset_worktable_lower_left(); + SSI_STATUS_MOTION so7_motion_reset_worktable_top_right(); + SSI_STATUS_MOTION so7_motion_stop_motor_to_get_laser_data(); + SSI_STATUS_MOTION so7_motion_laser_on_off(bool _bOnOff); + SSI_STATUS_MOTION so7_motion_fixture_on_off(bool _bOnOff); + SSI_STATUS_MOTION so7_motion_fixture_up_down(bool _bOnOff); + SSI_STATUS_MOTION so7_motion_reset_controller_parameter(); + + SSI_STATUS_MOTION _get_xyz_index(long & lX, long & lY, long & lZ); + SSI_STATUS_MOTION so7_motion_get_position_xyz(double & dX, double & dY, double & dZ); + SSI_STATUS_MOTION so7_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait); + SSI_STATUS_MOTION so7_motion_set_speed_xyz(double dPercentSpeed); + SSI_STATUS_MOTION so7_motion_get_speed_xyz(double &dPercentSpeed); + SSI_STATUS_MOTION so7_motion_get_3D_max_speed(double &dMaxSpeed); + + SSI_STATUS_MOTION _calculate_straightline_motion(double dSpeedMM); + + SSI_STATUS_MOTION so7_optics_set_scale_position(long lScale); + SSI_STATUS_MOTION so7_optics_get_scale_position(long &lScale); + SSI_STATUS_MOTION so7_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range); + + void so7_set_full_ringlight_data(long lIntensity); + void so7_set_ringlight_data(long lMaxSize, double *pSegments); + + SSI_STATUS_MOTION so7_light_set_light_off(); + SSI_STATUS_MOTION so7_light_set_light(); + SSI_STATUS_MOTION so7_light_set_lamp_state(double dBottomPercent, double dTopPercent); + + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_X(char SpeedGear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_Y(char SpeedGear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_Z(char SpeedGear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_ZM(char SpeedGear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_STOP_MOVE_XYZ(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_RESET_XYZ(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_RESET_V(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_STOP_V(); + + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_X(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_Y(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_Z(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(char ProbeType); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_XYZV(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_AXIS_XYZ(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_PROBE_XYZ(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_V_DATA(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_GET_RESET_FLAG(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_GET_FIXTURE_VALUE(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_RESET_FLAG(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_LIGHT_SIZE(char subCMD,BYTE LightValue); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_VER_NUMBER(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_CORRECTION_SCALE(char cAxisType); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_SECTION(char cAxisType); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_COMMON_COMMAND(char Cmd,char SubCmd,char Type); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_COMMON_COMMAND_DATA(char Cmd,char SubCmd,char Type,char Data); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_ZOOM_SPEED(char xyz_gear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_SPEED_PARAMETER(char axis_type,char xyz_gear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_SPEED_PRECISION(char axis_type); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_SPEED_PARAMETER(char axis_type,char xyz_gear); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_SET_MOTOR_SPEED_WHEELBASE_PARAMETER(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_SPEED_PRECISION(char axis_type); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_READ_ZOOM_MOTION_STATUS(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_OPEN_KEYENCE_LASER(); + + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_X(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_Y(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_Z(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_ZM(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_RESET_XYZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_X(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_Y(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_Z(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_ZM(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_XYZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_AXIS_XYZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_PROBE_XYZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_V_DATA(); + static SSI_STATUS_MOTION _process_SO7_CMD_GET_GET_RESET_FLAG(); + static SSI_STATUS_MOTION _process_SO7_CMD_GET_GET_FIXTURE_VALUE(); + static SSI_STATUS_MOTION _process_SO7_CMD_SET_LIGHT(); + static SSI_STATUS_MOTION _process_SO7_CMD_SET_SPEED_PARAMETER(); + static SSI_STATUS_MOTION _process_SO7_CMD_SET_SPEED_PRECISION(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PARAMETERX(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PARAMETERY(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PARAMETERZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_SET_SPEED_MOTOR_WHEELBASE_PARAMETER(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PRECISIONX(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PRECISIONY(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_SPEED_PRECISIONZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_INTERRUPT_MESSAGE(); + static SSI_STATUS_MOTION _process_SO7_CMD_READ_ZOOM_MOTION_STATUS(); + +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.cpp b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.cpp new file mode 100644 index 0000000..c70fca4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.cpp @@ -0,0 +1,238 @@ +#include "StdAfx.h" +#include +#include +#include "..\Keyence\LkIF.h" +#include "So7_Interface.h " + +#define MAX_STORAGE_DATA_SIZE 65536 + +CSo7_Interface::CSo7_Interface() +{ + m_bIsStorage=FALSE; + m_iSetOutNo=0; + m_StoredDataNumber=0; + m_NeedStorageDataNumber=0; + +} + +CSo7_Interface::~CSo7_Interface() +{ + FreeLibrary(m_hImageDLL); +} +//======================================== +void CSo7_Interface::KeyenceLaserInit(void) +{ + m_hImageDLL=LoadLibrary(_T("Image.dll")); + if(m_hImageDLL) + { + m_pGetCalcData=(pLKIF_GetCalcData)GetProcAddress(m_hImageDLL,"LKIF_GetCalcData"); + m_pDataStorageStart=(pLKIF_DataStorageStart)GetProcAddress(m_hImageDLL,"LKIF_DataStorageStart"); + m_pDataStorageStop=(pLKIF_DataStorageStop)GetProcAddress(m_hImageDLL,"LKIF_DataStorageStop"); + m_pDataStorageInit=(pLKIF_DataStorageInit)GetProcAddress(m_hImageDLL,"LKIF_DataStorageInit"); + m_pDataStorageGetData=(pLKIF_DataStorageGetData)GetProcAddress(m_hImageDLL,"LKIF_DataStorageGetData"); + m_pDataStorageGetStatus=(pLKIF_DataStorageGetStatus)GetProcAddress(m_hImageDLL,"LKIF_DataStorageGetStatus"); + m_pSetDataStorage=(pLKIF_SetDataStorage)GetProcAddress(m_hImageDLL,"LKIF_SetDataStorage"); + + } + +} +//============================================== +void CSo7_Interface::Get_KeyenceLaserData(float *LaserValue1,float *LaserValue2) +{ + *LaserValue1=10; + *LaserValue2=10; + LKIF_FLOATVALUE GetVal1,GetVal2; + if(m_pGetCalcData(&GetVal1,&GetVal2)!=1) + { + return ; + } + switch(GetVal1.FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *LaserValue1=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *LaserValue1=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *LaserValue1=0; + break; + } + default: + { + *LaserValue1=GetVal1.Value; + break; + } + } + + switch(GetVal2.FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *LaserValue2=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *LaserValue2=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *LaserValue2=0; + break; + } + default: + { + *LaserValue2=GetVal2.Value; + break; + } + } +} + +//============================================== +BOOL CSo7_Interface::StartStoreData(int _NeedStorageDataNumber,int _SampleTime) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (!m_bIsStorage) + { + bStatus=m_pDataStorageInit(); + if (_NeedStorageDataNumber<1) + { + _NeedStorageDataNumber=1; + } + else if (_NeedStorageDataNumber>65536) + { + _NeedStorageDataNumber=65536; + } + m_NeedStorageDataNumber=_NeedStorageDataNumber; + + if (_SampleTime<0.4) + { + m_StorageCycle=LKIF_STORAGECYCLE_1; + } + else if (_SampleTime<1) + { + m_StorageCycle=LKIF_STORAGECYCLE_2; + } + else if (_SampleTime<2) + { + m_StorageCycle=LKIF_STORAGECYCLE_5; + } + else if (_SampleTime<4) + { + m_StorageCycle=LKIF_STORAGECYCLE_10; + } + else if (_SampleTime<10) + { + m_StorageCycle=LKIF_STORAGECYCLE_20; + } + else if (_SampleTime<20) + { + m_StorageCycle=LKIF_STORAGECYCLE_50; + } + else if (_SampleTime<40) + { + m_StorageCycle=LKIF_STORAGECYCLE_100; + } + else if (_SampleTime<100) + { + m_StorageCycle=LKIF_STORAGECYCLE_200; + } + else if (_SampleTime<200) + { + m_StorageCycle=LKIF_STORAGECYCLE_500; + } + else + { + m_StorageCycle=LKIF_STORAGECYCLE_1000; + } + bStatus=m_pSetDataStorage(LKIF_TARGETOUT_OUT1,m_NeedStorageDataNumber,m_StorageCycle); + + if (bStatus) + { + bStatus=m_pDataStorageStart(); + } + } + return bStatus; +}; +//============================================== +BOOL CSo7_Interface::StopStoreData() +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (m_bIsStorage) + { + bStatus=m_pDataStorageStop(); + } + return bStatus; +}; +//============================================== +BOOL CSo7_Interface::PauseScanAndGetData(float *GetStorageData,int *GetStorageNumber) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (m_bIsStorage) + { + bStatus=m_pDataStorageStop(); + bStatus=GetStoredData(GetStorageData,GetStorageNumber); + bStatus=m_pDataStorageStart(); + } + else + { + bStatus=GetStoredData(GetStorageData,GetStorageNumber); + } + return bStatus; +}; +//============================================== +BOOL CSo7_Interface::GetStoredData(float *GetStorageData,int *GetStorageNumber) +{ + BOOL bStatus(FALSE); + GetStoreDataStatus(); + if (!m_bIsStorage) + { + LKIF_FLOATVALUE GetStorageValue[MAX_STORAGE_DATA_SIZE]; + bStatus=m_pDataStorageGetData(m_iSetOutNo,m_StoredDataNumber,GetStorageValue,GetStorageNumber); + for(int i=0;i<*GetStorageNumber;i++) + { + switch(GetStorageValue[i].FloatResult) + { + case LKIF_FLOATRESULT_RANGEOVER_P: + { + *GetStorageData++=50; + break; + } + case LKIF_FLOATRESULT_RANGEOVER_N: + { + *GetStorageData++=-50; + break; + } + case LKIF_FLOATRESULT_WAITING: + { + *GetStorageData++=0; + break; + } + default: + { + *GetStorageData++=GetStorageValue[i].Value; + break; + } + } + } + + } + return bStatus; +}; +//============================================== +BOOL CSo7_Interface::GetStoreDataStatus() +{ + BOOL bStatus(FALSE); + bStatus=m_pDataStorageGetStatus(m_iSetOutNo,&m_bIsStorage,&m_StoredDataNumber); + return bStatus; +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.h b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.h new file mode 100644 index 0000000..212628c --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/So7_Interface.h @@ -0,0 +1,60 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef SO7_INTERFACE_H_INCLUDED_ +#define SO7_INTERFACE_H_INCLUDED_ + + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +typedef int (WINAPI* pGetLaserStoredData) (float *GetStorageData,int *GetStorageNumber); +// Starting the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageStart)(void); +// Stopping the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageStop)(void); +// Initializing the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageInit)(void); +// Outputting the Data Storage +typedef BOOL (WINAPI* pLKIF_DataStorageGetData)(IN int OutNo,IN int NumOutBuffer,OUT LKIF_FLOATVALUE *OutBuffer,OUT int *NumReceived); +// Data Storage Accumulation Status Output +typedef BOOL (WINAPI* pLKIF_DataStorageGetStatus)(IN int OutNo,OUT BOOL *IsStorage,OUT int *NumStorageData); +// Set Data Storage +typedef BOOL (WINAPI* pLKIF_SetDataStorage)(IN LKIF_TARGETOUT TargetOut,IN int NumStorage,IN LKIF_STORAGECYCLE StorageCycle); + +//====================================================================================== +class CSo7_Interface +{ +protected: + int m_iSetOutNo; + int m_NeedStorageDataNumber; + LKIF_STORAGECYCLE m_StorageCycle; + HINSTANCE m_hImageDLL; +public: + + CSo7_Interface(); + ~CSo7_Interface(); + + //ȡݵĺָ + pLKIF_GetCalcData m_pGetCalcData; + pLKIF_DataStorageStart m_pDataStorageStart; + pLKIF_DataStorageStop m_pDataStorageStop; + pLKIF_DataStorageInit m_pDataStorageInit; + pLKIF_DataStorageGetData m_pDataStorageGetData; + pLKIF_DataStorageGetStatus m_pDataStorageGetStatus; + pLKIF_SetDataStorage m_pSetDataStorage; + + int m_StoredDataNumber; + BOOL m_bIsStorage; + void KeyenceLaserInit(void); + void Get_KeyenceLaserData(float *LaserValue1,float *LaserValue2); + BOOL StartStoreData(int _NeedStorageDataNumber,int _SampleTime); + BOOL StopStoreData(); + BOOL GetStoreDataStatus(); + BOOL GetStoredData(float *GetStorageData,int *GetStorageNumber); + BOOL PauseScanAndGetData(float *GetStorageData,int *GetStorageNumber); +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Deinterlace.ax b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Deinterlace.ax new file mode 100644 index 0000000..57a58ae Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Deinterlace.ax differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/SDK3000.ocx b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/SDK3000.ocx new file mode 100644 index 0000000..b54a355 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/SDK3000.ocx differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/UtilityDebug.Log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/UtilityDebug.Log new file mode 100644 index 0000000..4372bd8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/UtilityDebug.Log @@ -0,0 +1,413 @@ +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Destruct Csmartmotor_Proto. +Destruct Csmartmotor_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Unable to open device _start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Utility_Config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Utility_Config.ini new file mode 100644 index 0000000..3d3a5af --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/Utility_Config.ini @@ -0,0 +1,114 @@ +[HARDWARE] +SPEED_BASE_X1=2 +SPEED_MAX_X1=0 +SPEED_START_X1=10 +SPEED_FRESH_X1=10 +SPEED_SLOW_X1=0.000 +; +SPEED_BASE_X2=2 +SPEED_MAX_X2=0 +SPEED_START_X2=10 +SPEED_FRESH_X2=10 +SPEED_SLOW_X2=0.000 +; +SPEED_BASE_X3=2 +SPEED_MAX_X3=1 +SPEED_START_X3=10 +SPEED_FRESH_X3=10 +SPEED_SLOW_X3=0.000 +; +SPEED_BASE_X4=1 +SPEED_MAX_X4=0 +SPEED_START_X4=20 +SPEED_FRESH_X4=10 +SPEED_SLOW_X4=0.000 +; +SPEED_BASE_X5=1 +SPEED_MAX_X5=0 +SPEED_START_X5=20 +SPEED_FRESH_X5=10 +SPEED_SLOW_X5=0.000 +; +SPEED_BASE_Y1=5 +SPEED_MAX_Y1=200 +SPEED_START_Y1=30 +SPEED_FRESH_Y1=10 +SPEED_SLOW_Y1=0.600 +; +SPEED_BASE_Y2=3 +SPEED_MAX_Y2=60 +SPEED_START_Y2=10 +SPEED_FRESH_Y2=10 +SPEED_SLOW_Y2=0.200 +; +SPEED_BASE_Y3=1 +SPEED_MAX_Y3=5 +SPEED_START_Y3=3 +SPEED_FRESH_Y3=3 +SPEED_SLOW_Y3=0.100 +; +SPEED_BASE_Y4=5 +SPEED_MAX_Y4=0 +SPEED_START_Y4=50 +SPEED_FRESH_Y4=5 +SPEED_SLOW_Y4=0.000 +; +SPEED_BASE_Y5=5 +SPEED_MAX_Y5=0 +SPEED_START_Y5=80 +SPEED_FRESH_Y5=5 +SPEED_SLOW_Y5=0.000 +; +SPEED_BASE_Z1=5 +SPEED_MAX_Z1=200 +SPEED_START_Z1=50 +SPEED_FRESH_Z1=10 +SPEED_SLOW_Z1=0.500 +; +SPEED_BASE_Z2=5 +SPEED_MAX_Z2=50 +SPEED_START_Z2=10 +SPEED_FRESH_Z2=10 +SPEED_SLOW_Z2=0.100 +; +SPEED_BASE_Z3=5 +SPEED_MAX_Z3=5 +SPEED_START_Z3=5 +SPEED_FRESH_Z3=10 +SPEED_SLOW_Z3=0.000 +; +SPEED_BASE_Z4=5 +SPEED_MAX_Z4=0 +SPEED_START_Z4=50 +SPEED_FRESH_Z4=5 +SPEED_SLOW_Z4=0.000 +; +SPEED_BASE_Z5=5 +SPEED_MAX_Z5=0 +SPEED_START_Z5=80 +SPEED_FRESH_Z5=5 +SPEED_SLOW_Z5=0.000 +; +X_MOTOR_PRECISION=0.019 +Y_MOTOR_PRECISION=0.019 +Z_MOTOR_PRECISION=0.004 +; +X_MOTOR_WHEELBASE=20.000 +Y_MOTOR_WHEELBASE=20.000 +Z_MOTOR_WHEELBASE=1.500 +; +MOTOR_PULSE_NUM=10000 +; +[WORKTABLE] +X_SCALE_RESOLUTION=0.400 +Y_SCALE_RESOLUTION=0.400 +Z_SCALE_RESOLUTION=0.400 +; +X_NEG_WORKING_LIMIT=0.000 +Y_NEG_WORKING_LIMIT=0.000 +Z_NEG_WORKING_LIMIT=0.000 +; +X_POS_WORKING_LIMIT=400.000 +Y_POS_WORKING_LIMIT=300.000 +Z_POS_WORKING_LIMIT=200.000 +; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/comp.dat b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/comp.dat new file mode 100644 index 0000000..27cf9ed --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/comp.dat @@ -0,0 +1,1165 @@ + 129 +50 +0 + 699.900 + -61.899 + -81.900 + 0.000 + -25.445 + 25.585 + 9.978 + 0.000 +12345678 + 0.000 + 0.000 + 0.000 + 0.042614226241 + 0.032710213579 + 0.030881311945 + 0.027495443647 + 0.025396684619 + 0.023583860147 + 0.020295330012 + 0.019659185871 + 0.018088425289 + 0.019750588027 + 0.021647965636 + 0.024621938801 + 0.028757001396 + 0.031166441533 + 0.035494379639 + 0.037220828944 + 0.039870023258 + 0.039832277170 + 0.037390533498 + 0.033907658712 + 0.026466858628 + 0.021808159304 + 0.017197237591 + 0.016736859558 + 0.015472339519 + 0.011294376238 + 0.007621625876 + 0.002561462535 + 0.003443065917 + 0.004884561470 + 0.008904414672 + 0.016416399983 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + -0.038286085363 + -0.037379202095 + -0.036084186164 + -0.034980036995 + -0.033893789113 + -0.032244652782 + -0.030559087030 + -0.028801198401 + -0.027399184062 + -0.025805084206 + -0.024000590864 + -0.022218958195 + -0.020576042017 + -0.019283629043 + -0.017907243319 + -0.017113660494 + -0.016593158965 + -0.015872836192 + -0.015097548554 + -0.014190715429 + -0.013159311062 + -0.011315539492 + -0.009370547669 + -0.007492295511 + -0.005831035057 + -0.004436436304 + -0.002658531720 + -0.000893474635 + 0.001017351566 + 0.002675093540 + 0.004570469170 + 0.007410442642 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.000103824315 + 0.001124526562 + 0.001119261230 + 0.001217732285 + 0.000743149794 + -0.000322057500 + -0.002042393198 + -0.003755826280 + -0.004632461903 + -0.005466107327 + -0.006385172774 + -0.007379407453 + -0.007669045481 + -0.007000946692 + -0.005417608815 + -0.002310249122 + 0.001441489805 + 0.004712079698 + 0.007156053954 + 0.008763097387 + 0.009291885508 + 0.008571788294 + 0.007795165991 + 0.007200068189 + 0.006825644092 + 0.005881168477 + 0.004071565764 + 0.001368364616 + -0.001137648890 + -0.002589898359 + -0.003795358768 + -0.005738136306 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + 0.000009663993 + 0.000007412308 + 0.000007063735 + 0.000006522741 + 0.000007044720 + 0.000008662288 + 0.000011495079 + 0.000014315062 + 0.000015582839 + 0.000016770861 + 0.000018117338 + 0.000019603256 + 0.000019782178 + 0.000018184549 + 0.000014889200 + 0.000008766869 + 0.000001449255 + -0.000004975858 + -0.000009867649 + -0.000013206971 + -0.000014546186 + -0.000013568779 + -0.000012486526 + -0.000011740992 + -0.000011404801 + -0.000010011184 + -0.000007012807 + -0.000002356852 + 0.000001933336 + 0.000004268842 + 0.000006146572 + 0.000009391982 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000107570285 + 0.000082506699 + 0.000067995085 + 0.000051507692 + 0.000037373043 + 0.000024887739 + 0.000015131132 + 0.000008448856 + 0.000006502386 + 0.000008524653 + 0.000016328726 + 0.000031424484 + 0.000054927659 + 0.000086192461 + 0.000120719572 + 0.000151760014 + 0.000171846255 + 0.000176651793 + 0.000166261522 + 0.000143437489 + 0.000113358154 + 0.000081644633 + 0.000052565820 + 0.000028253132 + 0.000007272485 + -0.000007265406 + -0.000011658608 + -0.000003918204 + 0.000012205362 + 0.000029156633 + 0.000041542559 + 0.000056543654 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000016302515 + 0.000022925493 + 0.000014413652 + 0.000009856732 + 0.000005512045 + 0.000001770702 + 0.000002713617 + -0.000003313765 + -0.000002689198 + -0.000007746378 + -0.000009823217 + -0.000012075906 + -0.000013200734 + -0.000003632113 + 0.000004178016 + 0.000021120176 + 0.000028284514 + 0.000031483150 + 0.000029169824 + 0.000020410715 + 0.000018579458 + 0.000008813765 + 0.000003222973 + -0.000010829802 + -0.000020180128 + -0.000019028012 + -0.000017284680 + -0.000005809005 + -0.000005305712 + -0.000000712410 + -0.000003381141 + -0.000007891908 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.001186287432 + -0.000604089787 + -0.000322586204 + 0.000446553294 + 0.001423525301 + 0.002327381209 + 0.003455620234 + 0.004598316739 + 0.005807193665 + 0.007184641454 + 0.008379577067 + 0.009542902054 + 0.010596013343 + 0.011496670040 + 0.012588922735 + 0.013795981451 + 0.015039541799 + 0.016129276024 + 0.017215302149 + 0.018343364751 + 0.019667134192 + 0.021018483058 + 0.022429113355 + 0.023609656754 + 0.024460570987 + 0.025176004073 + 0.025765098279 + 0.026587188480 + 0.027645435251 + 0.028476904511 + 0.029130248662 + 0.029372422792 + 0.029793016745 + 0.030202015705 + 0.030651978935 + 0.031088197381 + 0.031269435211 + 0.031477958559 + 0.031547905158 + 0.031250466693 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.003514424034 + 0.001108328746 + 0.000223622463 + -0.000309558642 + -0.000130739914 + 0.000648789460 + 0.001752342952 + 0.003396538968 + 0.005372034228 + 0.007523029852 + 0.009842949987 + 0.012194713444 + 0.014569909692 + 0.016381497864 + 0.017596183204 + 0.018035259055 + 0.017622804277 + 0.016518845705 + 0.014900415940 + 0.012906344726 + 0.010495876531 + 0.007556945692 + 0.004530418358 + 0.001461203461 + -0.001423010798 + -0.004225049200 + -0.006650587516 + -0.008741058785 + -0.010289615248 + -0.011377273365 + -0.011844263471 + -0.011912027963 + -0.011624885165 + -0.011015771736 + -0.009888590927 + -0.008351226310 + -0.006417430285 + -0.004324503065 + -0.002655315101 + -0.000084275921 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + -0.001165805971 + 0.000308569424 + 0.000257718831 + -0.000356757950 + -0.000741419938 + -0.001601277960 + -0.002930767368 + -0.003923407108 + -0.004586590870 + -0.004772598000 + -0.004003364434 + -0.002053875123 + 0.001476703046 + 0.004776243621 + 0.007636205589 + 0.009926685181 + 0.011527326135 + 0.012868926151 + 0.013535703096 + 0.013817922410 + 0.013786830591 + 0.013013268041 + 0.012254230305 + 0.011447581652 + 0.010870287520 + 0.009614184960 + 0.008231901830 + 0.006301314232 + 0.005026868430 + 0.003948766176 + 0.003372739271 + 0.002712760325 + 0.001931843581 + 0.001194765371 + 0.000462991649 + -0.000196780890 + -0.000574712204 + -0.000588909907 + -0.000482208290 + 0.000003945935 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000005290860 + -0.000001922122 + -0.000000471056 + 0.000000652079 + 0.000002399047 + 0.000001730487 + -0.000000347006 + -0.000002014036 + -0.000002972540 + -0.000002217523 + 0.000001418875 + 0.000008454621 + 0.000019870259 + 0.000029570743 + 0.000038080574 + 0.000044437098 + 0.000048045810 + 0.000050854768 + 0.000051940440 + 0.000052796440 + 0.000053362524 + 0.000051959352 + 0.000050406349 + 0.000048480331 + 0.000047051108 + 0.000044007718 + 0.000040747702 + 0.000036207436 + 0.000032258422 + 0.000028288241 + 0.000025163414 + 0.000021589037 + 0.000017587905 + 0.000013813184 + 0.000010144336 + 0.000006734460 + 0.000003464677 + 0.000000307273 + -0.000001999526 + -0.000005290860 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + 0.000000038384 + -0.000000871186 + -0.000000389114 + 0.000000538647 + 0.000001254175 + 0.000001584652 + 0.000001533109 + 0.000001548269 + 0.000001778693 + 0.000002557891 + 0.000003437141 + 0.000004525592 + 0.000005874787 + 0.000007275524 + 0.000008858174 + 0.000010728855 + 0.000012626823 + 0.000014373196 + 0.000016416695 + 0.000018360142 + 0.000020591618 + 0.000023068679 + 0.000025839833 + 0.000028168331 + 0.000030430126 + 0.000032334158 + 0.000034465582 + 0.000037006312 + 0.000040271666 + 0.000043121650 + 0.000045704827 + 0.000047966623 + 0.000050249642 + 0.000052356811 + 0.000054151694 + 0.000055437219 + 0.000056625723 + 0.000057683855 + 0.000058591066 + 0.000058826880 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000011840262 + 0.000005190301 + 0.000001574258 + -0.000002179231 + -0.000004810918 + -0.000006060060 + -0.000005963039 + -0.000004501665 + -0.000001697160 + 0.000002362551 + 0.000007647148 + 0.000013904984 + 0.000020826806 + 0.000028063945 + 0.000035516349 + 0.000042620085 + 0.000049732916 + 0.000055736073 + 0.000060990351 + 0.000065183465 + 0.000068864189 + 0.000071856672 + 0.000074018414 + 0.000075346386 + 0.000075616224 + 0.000074724847 + 0.000072651029 + 0.000069394771 + 0.000065150115 + 0.000060008017 + 0.000054086721 + 0.000047277079 + 0.000039539677 + 0.000031468766 + 0.000023134080 + 0.000015002531 + 0.000007225714 + 0.000000125011 + -0.000004757692 + -0.000010535141 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + 0.006965165053 + 0.007220317698 + 0.006467551062 + 0.005360098534 + 0.004050383360 + 0.002964378650 + 0.002139191096 + 0.001081938376 + 0.000293285668 + -0.001108944973 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.056073427219 + -0.044993035700 + -0.038466946491 + -0.030448904276 + -0.022309694283 + -0.015400631920 + -0.009288634724 + -0.004368722648 + -0.000785703224 + 0.002970829254 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.000734083463 + 0.002054268699 + 0.001896259650 + 0.001777982547 + 0.001523542708 + 0.001442939406 + 0.001184756414 + 0.000716780038 + 0.000255047794 + -0.000964363419 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + 0.000303135946 + 0.000265436491 + 0.000243708410 + 0.000214024335 + 0.000181611322 + 0.000142168399 + 0.000099284688 + 0.000051892322 + 0.000014426876 + -0.000054549587 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + 0.000011232768 + 0.000012711657 + 0.000009677407 + 0.000007473221 + 0.000006302911 + 0.000006863811 + 0.000006554558 + 0.000004386755 + 0.000001968652 + -0.000007443689 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + 0.000102660986 + 0.000089903450 + 0.000080995071 + 0.000066041769 + 0.000048283966 + 0.000031114349 + 0.000016994819 + 0.000006628773 + -0.000000160649 + 0.000000607431 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/reg.bat b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/reg.bat new file mode 100644 index 0000000..5bd9693 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/reg.bat @@ -0,0 +1,11 @@ +copy Mix.dll %windir%\system32 +copy sdk3000_7130.dll %windir%\system32 +copy Deinterlace.ax %windir%\system32 +copy SDK3000.ocx %windir%\system32 +regsvr32/u/s %windir%\system32\Deinterlace.ax +regsvr32/s %windir%\system32\Deinterlace.ax +regsvr32/u/s %windir%\system32\SDK3000.ocx +regsvr32/s %windir%\system32\SDK3000.ocx +regsvr32/s Comdlg32.ocx +regsvr32/s mscomctl.ocx + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/smartmotor_config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/smartmotor_config.ini new file mode 100644 index 0000000..7cf1953 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/smartmotor_config.ini @@ -0,0 +1,74 @@ +[HARDWARE] +SPEED_X1=10000 +ACCELERATION_X1=50 +DECELERATION_X1=50 +; +SPEED_X2=100000 +ACCELERATION_X2=100 +DECELERATION_X2=100 +; +SPEED_X3=500000 +ACCELERATION_X3=200 +DECELERATION_X3=200 +; +SPEED_X4=1000000 +ACCELERATION_X4=300 +DECELERATION_X4=300 +; +SPEED_X5=0 +ACCELERATION_X5=0 +DECELERATION_X5=0 +; +SPEED_Y1=10000 +ACCELERATION_Y1=50 +DECELERATION_Y1=50 +; +SPEED_Y2=100000 +ACCELERATION_Y2=100 +DECELERATION_Y2=100 +; +SPEED_Y3=500000 +ACCELERATION_Y3=200 +DECELERATION_Y3=200 +; +SPEED_Y4=1000000 +ACCELERATION_Y4=300 +DECELERATION_Y4=300 +; +SPEED_Y5=0 +ACCELERATION_Y5=0 +DECELERATION_Y5=0 +; +SPEED_Z1=10000 +ACCELERATION_Z1=50 +DECELERATION_Z1=50 +; +SPEED_Z2=100000 +ACCELERATION_Z2=100 +DECELERATION_Z2=100 +; +SPEED_Z3=500000 +ACCELERATION_Z3=200 +DECELERATION_Z3=200 +; +SPEED_Z4=1000000 +ACCELERATION_Z4=300 +DECELERATION_Z4=300 +; +SPEED_Z5=0 +ACCELERATION_Z5=0 +DECELERATION_Z5=0 +; +[WORKTABLE] +X_SCALE_RESOLUTION=0.400 +Y_SCALE_RESOLUTION=0.400 +Z_SCALE_RESOLUTION=0.400 +; +X_NEG_WORKING_LIMIT=0.000 +Y_NEG_WORKING_LIMIT=0.000 +Z_NEG_WORKING_LIMIT=0.000 +; +X_POS_WORKING_LIMIT=200.000 +Y_POS_WORKING_LIMIT=200.000 +Z_POS_WORKING_LIMIT=200.000 +; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/so7_config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/so7_config.ini new file mode 100644 index 0000000..8efd0e9 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Debug/so7_config.ini @@ -0,0 +1,18 @@ +[7OCEANAUTOZOOM] +ZOOM_PRODUCT_ID=So7-123456 +ZOOM_COM_PORT=1 +ZOOM_START_DEG=10.000000 +ZOOM_END_DEG=230.000000 +ZOOM_ORG_DEG=360.000000 +ZOOM_DEADBAND_DEG=0.050000 +ZOOM_PULSE_PER_DEG=78.546050203026880 +ZOOM_READING_INTERVAL_TIME=60 +ZOOM_MOTOR_SPEED_FAST=2000 +ZOOM_MOTOR_SPEED_SLOW=800 +; +[HARDWARE] +CLOSE_LOOP_ENABLED=0 +RETRY_TIMES=5 +SHIFT_POSITION_X=0 +SHIFT_POSITION_Y=0 +SHIFT_POSITION_Z=0 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/LOGGER.CPP b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/LOGGER.CPP new file mode 100644 index 0000000..952bb86 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/LOGGER.CPP @@ -0,0 +1,68 @@ +#include "stdafx.h" +#include "Logger.h" +#include +void CLogger::SendAtTime(const char* buffer) +{ + + if (!m_File) + { + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } + if(m_File) + { + CTime _cTime=CTime::GetCurrentTime(); + CString csTime=_cTime.Format("[%m/%d %H:%M] "); + _ftprintf(m_File,_T("%s\r\n"), csTime); + fprintf(m_File,"%s", buffer); + } +} +void CLogger::Send(LPCTSTR format, ...) +{ + if (!m_File) + { + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } + int length = 0; + va_list list; + va_start(list, format); + length = vswprintf_s(m_Str,5000, format, list); + if(m_File) + { + _ftprintf(m_File, m_Str); + } +} +void CLogger::SendAndFlush(LPCTSTR format, ...) +{ + int length = 0; + va_list list; + + va_start(list, format); + length = vswprintf_s(m_Str2,5000, format, list); + Send(m_Str2); + + if(m_File) + { + fclose(m_File); + m_File = NULL; + if(m_FileName.GetLength() > 0) + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } +} + +void CLogger::SendAndFlushPerMode(LPCTSTR format, ...) +{ + int length = 0; + va_list list; + + va_start(list, format); + length = vswprintf_s(m_Str2,5000, format, list); + Send(m_Str2); + + if((m_lLogMask & LOGFLUSH) && m_File) + { + fclose(m_File); + m_File = NULL; + if(m_FileName.GetLength() > 0) + m_File = _wfsopen(m_FileName, _T("at"), _SH_DENYWR); + } +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Proto_Util.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Proto_Util.cpp new file mode 100644 index 0000000..ae0b17d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Proto_Util.cpp @@ -0,0 +1,226 @@ +//============================================================================= +#include "stdafx.h" +#include "SsiStatus.h" +#include "logger.h" +#include "math.h" +#include "Proto_Util.h" + +#define MY_CONFIG 1 +#define MAX_DEVPATH_LENGTH 256 +#define ENDPOINT_TIMEOUT 500 +#define MAX_BUFF_SIZE 1024 + +//=========================================================================== +double CProto_Util::ScaleToMM(long lCount, double dResolution) +{ + double dMM = 0.0; + dMM = lCount * dResolution; + return dMM; +} + +//=========================================================================== +long CProto_Util::MMtoScale(double lDistanceMM, double dResolution) +{ + long lCounts = 0; + if (dResolution) + lCounts = (long) (lDistanceMM / dResolution); + else + ASSERT(0); + return lCounts; +} + +//===================================================================================== +long CProto_Util::_4char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[3]; + c_array[1] = cBuff[2]; + c_array[2] = cBuff[1]; + c_array[3] = cBuff[0]; + return(l_value); +} + +//======================================================================== +void CProto_Util::_reverse_dword(DWORD *dWord) +{ + BYTE cBuff[4]; + BYTE *dwBuff = (BYTE *)dWord; + for ( int ii = 0 ; ii < 4 ; ++ii ) + cBuff[ii]= dwBuff[ii]; + + dwBuff[0] = cBuff[3]; + dwBuff[1] = cBuff[2]; + dwBuff[2] = cBuff[1]; + dwBuff[3] = cBuff[0]; +} + +//****************************************************************************** +void CProto_Util::_scale2inch(unsigned long scale, double &inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +void CProto_Util::_inch2scale(unsigned long &scale, double inch) +{ + UNREFERENCED_PARAMETER(scale); + UNREFERENCED_PARAMETER(inch); +} + +//****************************************************************************** +// convert a string of characters into its binary form +void CProto_Util::_char2bin(unsigned char *cBuff, BYTE *cBytes, int iLen) +{ + memset(cBytes, 0, MAX_BUFF_SIZE); + for (int i=0;i>8; + Val = MSB|LSB; +} + +//****************************************************************************** +double CProto_Util::TimeInSecs(void) +{ + double Secs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPersec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Secs = ((double)HPTicks.QuadPart / HPCounterTicksPersec); + } + else + { + // Use clock with less resolution. + Secs = GetTickCount(); + Secs /= 1000.0; + } + return Secs; +} + +//****************************************************************************** +CProto_Util::CProto_Util() +{ + g_pLogger = new CLogger(_T("\\UtilityDebug.Log")); +}; + +//****************************************************************************** +CProto_Util::~CProto_Util() +{ + delete g_pLogger; + g_pLogger = NULL; +} + +#pragma warning(disable:4996) + +//****************************************************************************** +// Send is direct and async. +// The receive thread will receive data and interpret it. +//****************************************************************************** +SSI_STATUS CProto_Util::Initialize() +{ + SSI_STATUS Status=SSI_STATUS_NORMAL; + UNREFERENCED_PARAMETER(Status); + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Initialize Usb\n")); + return SSI_STATUS_NORMAL; +} + +//****************************************************************************** +SSI_STATUS CProto_Util::Terminate() +{ + SSI_STATUS Status=SSI_STATUS_NORMAL; + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Exit_MvUsb\n")); + return Status; +} + +//****************************************************************************** +SSI_STATUS CProto_Util::ExtractAppPath(CString &Path) +{ + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) + { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } + else + { // not a complete path + Path=""; + }; + return SSI_STATUS_NORMAL; +}; + +//****************************************************************************** +SSI_STATUS CProto_Util::GetAppPath(CString &Path) +{ + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) + { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return SSI_STATUS_NORMAL; +}; + +void CProto_Util::_ascii2bin(char *cBuff) +{ + char x[3]; + char t[MAX_BUFF_SIZE]; + + int iSize = strlen(cBuff)/2; + memset(t, 0, MAX_BUFF_SIZE); + for (int j=0;jm_lLogMask & LOGACTIONS ) g_pLogger->SendAndFlushPerMode + + #if _MSC_VER > 1000 + #pragma once + #endif // _MSC_VER > 1000 + + #include "logger.h" + #include "SsiStatus.h" + +enum SETTLE_STATUS +{ + NOTSETTLED = 0, + SETTLED, + TIMEDOUT +}; + +// CSettleStageParams and CSettleStage are copied from QVI, but QVI is based on millionths of and inch +// and we will use microns for MV +class CSettleStageParams +{ +public: + CSettleStageParams() + { + EDGE_RETRY_TIMEOUT_X = 800; + EDGE_RETRY_TIMEOUT_Y = 800; + EDGE_RETRY_TIMEOUT_Z = 800; + EDGE_RETRY_TIMEOUT_MAG = 800; + EDGE_RETRY_BANDWIDTH_X = 1; + EDGE_RETRY_BANDWIDTH_Y = 1; + EDGE_RETRY_BANDWIDTH_Z = 1; + EDGE_RETRY_BANDWIDTH_MAG = 1; + EDGE_RETRY_COUNT_X = 1; + EDGE_RETRY_COUNT_Y = 1; + EDGE_RETRY_COUNT_Z = 1; + EDGE_RETRY_COUNT_MAG = 1; + }; + + long EDGE_RETRY_TIMEOUT_X; //300 + long EDGE_RETRY_TIMEOUT_Y; //300 + long EDGE_RETRY_TIMEOUT_Z; //300 + long EDGE_RETRY_TIMEOUT_MAG; //300 + long EDGE_RETRY_BANDWIDTH_X; //50 + long EDGE_RETRY_BANDWIDTH_Y; //50 + long EDGE_RETRY_BANDWIDTH_Z; //50 + long EDGE_RETRY_BANDWIDTH_MAG; //50 + long EDGE_RETRY_COUNT_X; //1 + long EDGE_RETRY_COUNT_Y; //1 + long EDGE_RETRY_COUNT_Z; //1 + long EDGE_RETRY_COUNT_MAG; //1 +}; + +class CSettleStage +{ +public: + CSettleStage(long lAxis, double dStartTime, long lStart, long lDeadband, double dTestIncrSec, double dMaxTimeSec); + enum SETTLE_STATUS Test(double dCurTime, long lCurPos); + +private: + double m_dStartTime; + long m_lStartPos; + long m_lDeadband; + double m_dTestIncrSec; + double m_dMaxTimeSec; + double m_dIncrStartTimeSec; + long m_lAxis; +}; + +//====================================================================================== +class CProto_Util +{ +public: + + double ScaleToMM(long lCount, double dResolution); + long MMtoScale(double lDistanceMM, double dResolution); + + // + CProto_Util(); + virtual ~CProto_Util(); + SSI_STATUS Initialize(); + 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); + SSI_STATUS WaitForSettleXYZZM(); +}; + +#endif +// !defined(AFX_Proto_Util_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_DebugLog.txt b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_DebugLog.txt new file mode 100644 index 0000000..218e335 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_DebugLog.txt @@ -0,0 +1 @@ +Usb Port Initialized. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_SSILog.txt b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_SSILog.txt new file mode 100644 index 0000000..6933eba --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/SO7_SSILog.txt @@ -0,0 +1,5 @@ +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/UtilityDebug.Log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/UtilityDebug.Log new file mode 100644 index 0000000..932310e --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/UtilityDebug.Log @@ -0,0 +1,275 @@ +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. +Construct Cso7_Proto. +Init:Open device succeed . +_start_machine +Exit: Exit_SO7Usb +Destruct Cso7_Proto. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/Utility_Config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/Utility_Config.ini new file mode 100644 index 0000000..2958dcd --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/Utility_Config.ini @@ -0,0 +1,114 @@ +[HARDWARE] +SPEED_BASE_X1=5 +SPEED_MAX_X1=120 +SPEED_START_X1=20 +SPEED_FRESH_X1=10 +SPEED_SLOW_X1=0.500 +; +SPEED_BASE_X2=3 +SPEED_MAX_X2=30 +SPEED_START_X2=10 +SPEED_FRESH_X2=10 +SPEED_SLOW_X2=0.200 +; +SPEED_BASE_X3=1 +SPEED_MAX_X3=5 +SPEED_START_X3=5 +SPEED_FRESH_X3=10 +SPEED_SLOW_X3=0.000 +; +SPEED_BASE_X4=1 +SPEED_MAX_X4=0 +SPEED_START_X4=50 +SPEED_FRESH_X4=5 +SPEED_SLOW_X4=0.000 +; +SPEED_BASE_X5=1 +SPEED_MAX_X5=0 +SPEED_START_X5=80 +SPEED_FRESH_X5=5 +SPEED_SLOW_X5=0.000 +; +SPEED_BASE_Y1=5 +SPEED_MAX_Y1=120 +SPEED_START_Y1=20 +SPEED_FRESH_Y1=10 +SPEED_SLOW_Y1=0.600 +; +SPEED_BASE_Y2=3 +SPEED_MAX_Y2=30 +SPEED_START_Y2=10 +SPEED_FRESH_Y2=10 +SPEED_SLOW_Y2=0.100 +; +SPEED_BASE_Y3=1 +SPEED_MAX_Y3=5 +SPEED_START_Y3=5 +SPEED_FRESH_Y3=10 +SPEED_SLOW_Y3=0.000 +; +SPEED_BASE_Y4=1 +SPEED_MAX_Y4=0 +SPEED_START_Y4=50 +SPEED_FRESH_Y4=5 +SPEED_SLOW_Y4=0.000 +; +SPEED_BASE_Y5=1 +SPEED_MAX_Y5=0 +SPEED_START_Y5=80 +SPEED_FRESH_Y5=5 +SPEED_SLOW_Y5=0.000 +; +SPEED_BASE_Z1=5 +SPEED_MAX_Z1=170 +SPEED_START_Z1=50 +SPEED_FRESH_Z1=10 +SPEED_SLOW_Z1=0.500 +; +SPEED_BASE_Z2=3 +SPEED_MAX_Z2=50 +SPEED_START_Z2=10 +SPEED_FRESH_Z2=10 +SPEED_SLOW_Z2=0.100 +; +SPEED_BASE_Z3=1 +SPEED_MAX_Z3=5 +SPEED_START_Z3=5 +SPEED_FRESH_Z3=10 +SPEED_SLOW_Z3=0.000 +; +SPEED_BASE_Z4=1 +SPEED_MAX_Z4=0 +SPEED_START_Z4=50 +SPEED_FRESH_Z4=5 +SPEED_SLOW_Z4=0.000 +; +SPEED_BASE_Z5=1 +SPEED_MAX_Z5=0 +SPEED_START_Z5=80 +SPEED_FRESH_Z5=5 +SPEED_SLOW_Z5=0.000 +; +X_MOTOR_PRECISION=0.009 +Y_MOTOR_PRECISION=0.004 +Z_MOTOR_PRECISION=0.004 +; +X_MOTOR_WHEELBASE=25.016 +Y_MOTOR_WHEELBASE=25.028 +Z_MOTOR_WHEELBASE=1.875 +; +MOTOR_PULSE_NUM=10000 +; +[WORKTABLE] +X_SCALE_RESOLUTION=0.500 +Y_SCALE_RESOLUTION=0.500 +Z_SCALE_RESOLUTION=0.500 +; +X_NEG_WORKING_LIMIT=0.000 +Y_NEG_WORKING_LIMIT=0.000 +Z_NEG_WORKING_LIMIT=0.000 +; +X_POS_WORKING_LIMIT=400.000 +Y_POS_WORKING_LIMIT=300.000 +Z_POS_WORKING_LIMIT=200.000 +; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/comp.dat b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/comp.dat new file mode 100644 index 0000000..27cf9ed --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/comp.dat @@ -0,0 +1,1165 @@ + 129 +50 +0 + 699.900 + -61.899 + -81.900 + 0.000 + -25.445 + 25.585 + 9.978 + 0.000 +12345678 + 0.000 + 0.000 + 0.000 + 0.042614226241 + 0.032710213579 + 0.030881311945 + 0.027495443647 + 0.025396684619 + 0.023583860147 + 0.020295330012 + 0.019659185871 + 0.018088425289 + 0.019750588027 + 0.021647965636 + 0.024621938801 + 0.028757001396 + 0.031166441533 + 0.035494379639 + 0.037220828944 + 0.039870023258 + 0.039832277170 + 0.037390533498 + 0.033907658712 + 0.026466858628 + 0.021808159304 + 0.017197237591 + 0.016736859558 + 0.015472339519 + 0.011294376238 + 0.007621625876 + 0.002561462535 + 0.003443065917 + 0.004884561470 + 0.008904414672 + 0.016416399983 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + 0.018175423368 + -0.038286085363 + -0.037379202095 + -0.036084186164 + -0.034980036995 + -0.033893789113 + -0.032244652782 + -0.030559087030 + -0.028801198401 + -0.027399184062 + -0.025805084206 + -0.024000590864 + -0.022218958195 + -0.020576042017 + -0.019283629043 + -0.017907243319 + -0.017113660494 + -0.016593158965 + -0.015872836192 + -0.015097548554 + -0.014190715429 + -0.013159311062 + -0.011315539492 + -0.009370547669 + -0.007492295511 + -0.005831035057 + -0.004436436304 + -0.002658531720 + -0.000893474635 + 0.001017351566 + 0.002675093540 + 0.004570469170 + 0.007410442642 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.009424310241 + 0.000103824315 + 0.001124526562 + 0.001119261230 + 0.001217732285 + 0.000743149794 + -0.000322057500 + -0.002042393198 + -0.003755826280 + -0.004632461903 + -0.005466107327 + -0.006385172774 + -0.007379407453 + -0.007669045481 + -0.007000946692 + -0.005417608815 + -0.002310249122 + 0.001441489805 + 0.004712079698 + 0.007156053954 + 0.008763097387 + 0.009291885508 + 0.008571788294 + 0.007795165991 + 0.007200068189 + 0.006825644092 + 0.005881168477 + 0.004071565764 + 0.001368364616 + -0.001137648890 + -0.002589898359 + -0.003795358768 + -0.005738136306 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + -0.007700147572 + 0.000009663993 + 0.000007412308 + 0.000007063735 + 0.000006522741 + 0.000007044720 + 0.000008662288 + 0.000011495079 + 0.000014315062 + 0.000015582839 + 0.000016770861 + 0.000018117338 + 0.000019603256 + 0.000019782178 + 0.000018184549 + 0.000014889200 + 0.000008766869 + 0.000001449255 + -0.000004975858 + -0.000009867649 + -0.000013206971 + -0.000014546186 + -0.000013568779 + -0.000012486526 + -0.000011740992 + -0.000011404801 + -0.000010011184 + -0.000007012807 + -0.000002356852 + 0.000001933336 + 0.000004268842 + 0.000006146572 + 0.000009391982 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000012673058 + 0.000107570285 + 0.000082506699 + 0.000067995085 + 0.000051507692 + 0.000037373043 + 0.000024887739 + 0.000015131132 + 0.000008448856 + 0.000006502386 + 0.000008524653 + 0.000016328726 + 0.000031424484 + 0.000054927659 + 0.000086192461 + 0.000120719572 + 0.000151760014 + 0.000171846255 + 0.000176651793 + 0.000166261522 + 0.000143437489 + 0.000113358154 + 0.000081644633 + 0.000052565820 + 0.000028253132 + 0.000007272485 + -0.000007265406 + -0.000011658608 + -0.000003918204 + 0.000012205362 + 0.000029156633 + 0.000041542559 + 0.000056543654 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000070184607 + 0.000016302515 + 0.000022925493 + 0.000014413652 + 0.000009856732 + 0.000005512045 + 0.000001770702 + 0.000002713617 + -0.000003313765 + -0.000002689198 + -0.000007746378 + -0.000009823217 + -0.000012075906 + -0.000013200734 + -0.000003632113 + 0.000004178016 + 0.000021120176 + 0.000028284514 + 0.000031483150 + 0.000029169824 + 0.000020410715 + 0.000018579458 + 0.000008813765 + 0.000003222973 + -0.000010829802 + -0.000020180128 + -0.000019028012 + -0.000017284680 + -0.000005809005 + -0.000005305712 + -0.000000712410 + -0.000003381141 + -0.000007891908 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.000006013304 + -0.001186287432 + -0.000604089787 + -0.000322586204 + 0.000446553294 + 0.001423525301 + 0.002327381209 + 0.003455620234 + 0.004598316739 + 0.005807193665 + 0.007184641454 + 0.008379577067 + 0.009542902054 + 0.010596013343 + 0.011496670040 + 0.012588922735 + 0.013795981451 + 0.015039541799 + 0.016129276024 + 0.017215302149 + 0.018343364751 + 0.019667134192 + 0.021018483058 + 0.022429113355 + 0.023609656754 + 0.024460570987 + 0.025176004073 + 0.025765098279 + 0.026587188480 + 0.027645435251 + 0.028476904511 + 0.029130248662 + 0.029372422792 + 0.029793016745 + 0.030202015705 + 0.030651978935 + 0.031088197381 + 0.031269435211 + 0.031477958559 + 0.031547905158 + 0.031250466693 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.031370165817 + 0.003514424034 + 0.001108328746 + 0.000223622463 + -0.000309558642 + -0.000130739914 + 0.000648789460 + 0.001752342952 + 0.003396538968 + 0.005372034228 + 0.007523029852 + 0.009842949987 + 0.012194713444 + 0.014569909692 + 0.016381497864 + 0.017596183204 + 0.018035259055 + 0.017622804277 + 0.016518845705 + 0.014900415940 + 0.012906344726 + 0.010495876531 + 0.007556945692 + 0.004530418358 + 0.001461203461 + -0.001423010798 + -0.004225049200 + -0.006650587516 + -0.008741058785 + -0.010289615248 + -0.011377273365 + -0.011844263471 + -0.011912027963 + -0.011624885165 + -0.011015771736 + -0.009888590927 + -0.008351226310 + -0.006417430285 + -0.004324503065 + -0.002655315101 + -0.000084275921 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + 0.001876603594 + -0.001165805971 + 0.000308569424 + 0.000257718831 + -0.000356757950 + -0.000741419938 + -0.001601277960 + -0.002930767368 + -0.003923407108 + -0.004586590870 + -0.004772598000 + -0.004003364434 + -0.002053875123 + 0.001476703046 + 0.004776243621 + 0.007636205589 + 0.009926685181 + 0.011527326135 + 0.012868926151 + 0.013535703096 + 0.013817922410 + 0.013786830591 + 0.013013268041 + 0.012254230305 + 0.011447581652 + 0.010870287520 + 0.009614184960 + 0.008231901830 + 0.006301314232 + 0.005026868430 + 0.003948766176 + 0.003372739271 + 0.002712760325 + 0.001931843581 + 0.001194765371 + 0.000462991649 + -0.000196780890 + -0.000574712204 + -0.000588909907 + -0.000482208290 + 0.000003945935 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000087865606 + -0.000005290860 + -0.000001922122 + -0.000000471056 + 0.000000652079 + 0.000002399047 + 0.000001730487 + -0.000000347006 + -0.000002014036 + -0.000002972540 + -0.000002217523 + 0.000001418875 + 0.000008454621 + 0.000019870259 + 0.000029570743 + 0.000038080574 + 0.000044437098 + 0.000048045810 + 0.000050854768 + 0.000051940440 + 0.000052796440 + 0.000053362524 + 0.000051959352 + 0.000050406349 + 0.000048480331 + 0.000047051108 + 0.000044007718 + 0.000040747702 + 0.000036207436 + 0.000032258422 + 0.000028288241 + 0.000025163414 + 0.000021589037 + 0.000017587905 + 0.000013813184 + 0.000010144336 + 0.000006734460 + 0.000003464677 + 0.000000307273 + -0.000001999526 + -0.000005290860 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + -0.000008377925 + 0.000000038384 + -0.000000871186 + -0.000000389114 + 0.000000538647 + 0.000001254175 + 0.000001584652 + 0.000001533109 + 0.000001548269 + 0.000001778693 + 0.000002557891 + 0.000003437141 + 0.000004525592 + 0.000005874787 + 0.000007275524 + 0.000008858174 + 0.000010728855 + 0.000012626823 + 0.000014373196 + 0.000016416695 + 0.000018360142 + 0.000020591618 + 0.000023068679 + 0.000025839833 + 0.000028168331 + 0.000030430126 + 0.000032334158 + 0.000034465582 + 0.000037006312 + 0.000040271666 + 0.000043121650 + 0.000045704827 + 0.000047966623 + 0.000050249642 + 0.000052356811 + 0.000054151694 + 0.000055437219 + 0.000056625723 + 0.000057683855 + 0.000058591066 + 0.000058826880 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000059761928 + 0.000011840262 + 0.000005190301 + 0.000001574258 + -0.000002179231 + -0.000004810918 + -0.000006060060 + -0.000005963039 + -0.000004501665 + -0.000001697160 + 0.000002362551 + 0.000007647148 + 0.000013904984 + 0.000020826806 + 0.000028063945 + 0.000035516349 + 0.000042620085 + 0.000049732916 + 0.000055736073 + 0.000060990351 + 0.000065183465 + 0.000068864189 + 0.000071856672 + 0.000074018414 + 0.000075346386 + 0.000075616224 + 0.000074724847 + 0.000072651029 + 0.000069394771 + 0.000065150115 + 0.000060008017 + 0.000054086721 + 0.000047277079 + 0.000039539677 + 0.000031468766 + 0.000023134080 + 0.000015002531 + 0.000007225714 + 0.000000125011 + -0.000004757692 + -0.000010535141 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + -0.000017269048 + 0.006965165053 + 0.007220317698 + 0.006467551062 + 0.005360098534 + 0.004050383360 + 0.002964378650 + 0.002139191096 + 0.001081938376 + 0.000293285668 + -0.001108944973 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.002141546434 + -0.056073427219 + -0.044993035700 + -0.038466946491 + -0.030448904276 + -0.022309694283 + -0.015400631920 + -0.009288634724 + -0.004368722648 + -0.000785703224 + 0.002970829254 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.008030427827 + 0.000734083463 + 0.002054268699 + 0.001896259650 + 0.001777982547 + 0.001523542708 + 0.001442939406 + 0.001184756414 + 0.000716780038 + 0.000255047794 + -0.000964363419 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + -0.001462298993 + 0.000303135946 + 0.000265436491 + 0.000243708410 + 0.000214024335 + 0.000181611322 + 0.000142168399 + 0.000099284688 + 0.000051892322 + 0.000014426876 + -0.000054549587 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + -0.000101814930 + 0.000011232768 + 0.000012711657 + 0.000009677407 + 0.000007473221 + 0.000006302911 + 0.000006863811 + 0.000006554558 + 0.000004386755 + 0.000001968652 + -0.000007443689 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + -0.000010195025 + 0.000102660986 + 0.000089903450 + 0.000080995071 + 0.000066041769 + 0.000048283966 + 0.000031114349 + 0.000016994819 + 0.000006628773 + -0.000000160649 + 0.000000607431 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + -0.000008934362 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 + 0.000000000000 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/smartmotor_config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/smartmotor_config.ini new file mode 100644 index 0000000..7cf1953 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/smartmotor_config.ini @@ -0,0 +1,74 @@ +[HARDWARE] +SPEED_X1=10000 +ACCELERATION_X1=50 +DECELERATION_X1=50 +; +SPEED_X2=100000 +ACCELERATION_X2=100 +DECELERATION_X2=100 +; +SPEED_X3=500000 +ACCELERATION_X3=200 +DECELERATION_X3=200 +; +SPEED_X4=1000000 +ACCELERATION_X4=300 +DECELERATION_X4=300 +; +SPEED_X5=0 +ACCELERATION_X5=0 +DECELERATION_X5=0 +; +SPEED_Y1=10000 +ACCELERATION_Y1=50 +DECELERATION_Y1=50 +; +SPEED_Y2=100000 +ACCELERATION_Y2=100 +DECELERATION_Y2=100 +; +SPEED_Y3=500000 +ACCELERATION_Y3=200 +DECELERATION_Y3=200 +; +SPEED_Y4=1000000 +ACCELERATION_Y4=300 +DECELERATION_Y4=300 +; +SPEED_Y5=0 +ACCELERATION_Y5=0 +DECELERATION_Y5=0 +; +SPEED_Z1=10000 +ACCELERATION_Z1=50 +DECELERATION_Z1=50 +; +SPEED_Z2=100000 +ACCELERATION_Z2=100 +DECELERATION_Z2=100 +; +SPEED_Z3=500000 +ACCELERATION_Z3=200 +DECELERATION_Z3=200 +; +SPEED_Z4=1000000 +ACCELERATION_Z4=300 +DECELERATION_Z4=300 +; +SPEED_Z5=0 +ACCELERATION_Z5=0 +DECELERATION_Z5=0 +; +[WORKTABLE] +X_SCALE_RESOLUTION=0.400 +Y_SCALE_RESOLUTION=0.400 +Z_SCALE_RESOLUTION=0.400 +; +X_NEG_WORKING_LIMIT=0.000 +Y_NEG_WORKING_LIMIT=0.000 +Z_NEG_WORKING_LIMIT=0.000 +; +X_POS_WORKING_LIMIT=200.000 +Y_POS_WORKING_LIMIT=200.000 +Z_POS_WORKING_LIMIT=200.000 +; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/so7_config.ini b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/so7_config.ini new file mode 100644 index 0000000..5b99ab5 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Release/so7_config.ini @@ -0,0 +1,18 @@ +[7OCEANAUTOZOOM] +ZOOM_PRODUCT_ID=So7123456 +ZOOM_COM_PORT=1 +ZOOM_START_DEG=6.000000 +ZOOM_END_DEG=226.000000 +ZOOM_ORG_DEG=356.000000 +ZOOM_DEADBAND_DEG=0.050000 +ZOOM_PULSE_PER_DEG=78.546050203026880 +ZOOM_READING_INTERVAL_TIME=60 +ZOOM_MOTOR_SPEED_FAST=2000 +ZOOM_MOTOR_SPEED_SLOW=800 +; +[HARDWARE] +CLOSE_LOOP_ENABLED=0 +RETRY_TIMES=5 +SHIFT_POSITION_X=0 +SHIFT_POSITION_Y=0 +SHIFT_POSITION_Z=0 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/STDAFX.H b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/STDAFX.H new file mode 100644 index 0000000..3bcef16 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/STDAFX.H @@ -0,0 +1,14 @@ +#pragma once +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#include "..\..\..\..\include\stdafx_net.h" + +#define _ATL_APARTMENT_THREADED + +#include +#include // MFC OLE dialog classes + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/SsiStatus.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/SsiStatus.h new file mode 100644 index 0000000..4877a46 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/SsiStatus.h @@ -0,0 +1,25 @@ +// Proto.h: interface for the CProto class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_SSISTATUS_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) +#define AFX_SSISTATUS_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 +enum SSI_STATUS { + SSI_STATUS_NORMAL = 0, + SSI_STATUS_DATALINK_ERROR, + SSI_STATUS_SETUP_ASYNC_CONTEXT_ERROR, + SSI_STATUS_SYNC_READ_ERROR, + SSI_STATUS_SYNC_WRITE_ERROR, + SSI_STATUS_MV_COMMAND_TIMEOUT, + SSI_STATUS_MV_COMMAND_BUSY, + SSI_STATUS_REPLAY_FILE_ERROR, + SSI_STATUS_MV_CONFIG_FILE_NOT_FOUND, + SSI_STATUS_MV_HOMING_TIMEOUT, + SSI_STATUS_ERROR, + SSI_STATUS_INVALID_PARAMETERS +}; +#endif // !defined(AFX_PROTO_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Thumbs.db b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Thumbs.db new file mode 100644 index 0000000..b1a2bbe Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Thumbs.db differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.cpp new file mode 100644 index 0000000..12e944a --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.cpp @@ -0,0 +1,1162 @@ +// AnimaticsUtilityDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "afxdialogex.h" +#include "resource.h" +#include "afxwin.h" +#include "..\..\..\Animatics\Animatics_Proto.h" +#include "ProcessButton.h" +#include "AnimaticsUtilityDlg.h" + +extern SmartMotor_Proto* pSmartMotor_Proto; +// AnimaticsUtilityDlg dialog +CLogger* pAnimaticsLogger=NULL; + +BOOL RepeTestAxisX,RepeTestAxisY,RepeTestAxisZ,bRepeTestDone; +double RepeTestRecordStartPos[3],RepeTestRecordEndPos[3],dRepeTestFromPos,dRepeTestToPos; +//It's for repeatability test.We can judge the motion is "from" or "to" by it; +int RepeTestCnt,iRepeTestInterval,iRepeTestTimes; +//It's for repeatability test.When it is true,test has begun;and When it is false,test has stopped; +bool RepeTestBeginFlag; + +//==================================================== +IMPLEMENT_DYNAMIC(AnimaticsUtilityDlg, CDialog) + + AnimaticsUtilityDlg::AnimaticsUtilityDlg(CWnd* pParent /*=NULL*/) + : CDialog(AnimaticsUtilityDlg::IDD, pParent) +{ + +} + +AnimaticsUtilityDlg::~AnimaticsUtilityDlg() +{ +} + +void AnimaticsUtilityDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_X_LEFT, MoveX_Left); + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT, MoveX_Right); + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_Y_BACK, MoveY_Back); + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT, MoveY_Front); + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN, MoveZ_Down); + DDX_Control(pDX, IDC_BUTTON_ANIMATICS_MOVE_Z_UP, MoveZ_Up); + // + DDX_Control(pDX, IDC_EDIT_ANIMATICS_REPRETEST, RepeTestMsgOut); + + DDX_Text(pDX, IDC_EDIT_REPETEST_DIS_FROM, RepeTestMoveFromDis); + DDX_Text(pDX, IDC_EDIT_REPETEST_DIS_TO, RepeTestMoveToDis); + DDX_Text(pDX, IDC_EDIT_REPETEST_TIMES, RepeTestTimes); + DDX_Text(pDX, IDC_EDIT_REPETEST_INTERVAL, RepeTestInterval); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_CMD, SmartMotorSendCmd); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_CMD_RESPONSE, SmartMotorGetResponse); + + + //=====================X=================== + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_X1, SpeedParameterX[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_X1, AccelParameterX[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_X1, DecelParameterX[0]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_X2, SpeedParameterX[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_X2, AccelParameterX[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_X2, DecelParameterX[1]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_X3, SpeedParameterX[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_X3, AccelParameterX[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_X3, DecelParameterX[2]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_X4, SpeedParameterX[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_X4, AccelParameterX[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_X4, DecelParameterX[3]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_X5, SpeedParameterX[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_X5, AccelParameterX[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_X5, DecelParameterX[4]); + + DDX_Text(pDX, IDC_EDIT_X_SCALE_COEFFICIENT, ScaleResolutionX); + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_X, NegSoftLimitX); + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_X, PosSoftLimitX); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_MOVE_TO_X, MoveToDisX); + //=====================Y=================== + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Y1, SpeedParameterY[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Y1, AccelParameterY[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Y1, DecelParameterY[0]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Y2, SpeedParameterY[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Y2, AccelParameterY[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Y2, DecelParameterY[1]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Y3, SpeedParameterY[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Y3, AccelParameterY[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Y3, DecelParameterY[2]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Y4, SpeedParameterY[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Y4, AccelParameterY[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Y4, DecelParameterY[3]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Y5, SpeedParameterY[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Y5, AccelParameterY[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Y5, DecelParameterY[4]); + + DDX_Text(pDX, IDC_EDIT_Y_SCALE_COEFFICIENT, ScaleResolutionY); + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_Y, NegSoftLimitY); + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_Y, PosSoftLimitY); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_MOVE_TO_Y, MoveToDisY); + //=====================Z=================== + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Z1, SpeedParameterZ[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Z1, AccelParameterZ[0]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Z1, DecelParameterZ[0]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Z2, SpeedParameterZ[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Z2, AccelParameterZ[1]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Z2, DecelParameterZ[1]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Z3, SpeedParameterZ[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Z3, AccelParameterZ[2]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Z3, DecelParameterZ[2]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Z4, SpeedParameterZ[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Z4, AccelParameterZ[3]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Z4, DecelParameterZ[3]); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_SPEED_Z5, SpeedParameterZ[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_ACCEL_Z5, AccelParameterZ[4]); + DDX_Text(pDX, IDC_EDIT_ANIMATICS_DECEL_Z5, DecelParameterZ[4]); + + DDX_Text(pDX, IDC_EDIT_Z_SCALE_COEFFICIENT, ScaleResolutionZ); + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_Z, NegSoftLimitZ); + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_Z, PosSoftLimitZ); + + DDX_Text(pDX, IDC_EDIT_ANIMATICS_MOVE_TO_Z, MoveToDisZ); + //============================================= + + +} + + +BEGIN_MESSAGE_MAP(AnimaticsUtilityDlg, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BUTTON_START_ANIMATICS_MACHINE, &AnimaticsUtilityDlg::OnBnClickedButtonStartAnimaticsMachine) + ON_BN_CLICKED(IDC_BUTTON_STOP_ANIMATICS_MACHINE, &AnimaticsUtilityDlg::OnBnClickedButtonStopAnimaticsMachine) + ON_BN_CLICKED(IDCANCEL, &AnimaticsUtilityDlg::OnBnClickedCancel) + + ON_EN_KILLFOCUS(IDC_EDIT_X_SCALE_COEFFICIENT, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_NEG_WORKLIMIT_X, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_POS_WORKLIMIT_X, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_Y_SCALE_COEFFICIENT, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_NEG_WORKLIMIT_Y, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_POS_WORKLIMIT_Y, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_Z_SCALE_COEFFICIENT, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_NEG_WORKLIMIT_Z, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + ON_EN_KILLFOCUS(IDC_EDIT_POS_WORKLIMIT_Z, &AnimaticsUtilityDlg::OnEnKillfocusEditWorktable) + + ON_BN_CLICKED(IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ, &AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToXyz) + ON_BN_CLICKED(IDC_BUTTON_POS_SET_ZERO, &AnimaticsUtilityDlg::OnBnClickedButtonPosSetZero) + ON_BN_CLICKED(IDC_BUTTON_SAVE_CONFIG, &AnimaticsUtilityDlg::OnBnClickedButtonSaveConfig) + ON_BN_CLICKED(IDC_BUTTON_READ_CONFIG, &AnimaticsUtilityDlg::OnBnClickedButtonReadConfig) + ON_BN_CLICKED(IDC_RADIO_ANIMATICS_SPEED_GEAR_1, &AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear1) + ON_BN_CLICKED(IDC_RADIO_ANIMATICS_SPEED_GEAR_2, &AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear2) + ON_BN_CLICKED(IDC_RADIO_ANIMATICS_SPEED_GEAR_3, &AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear3) + ON_BN_CLICKED(IDC_RADIO_ANIMATICS_SPEED_GEAR_4, &AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear4) + ON_BN_CLICKED(IDC_BUTTON_ANIMATICS_MOVE_TO_X, &AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToX) + ON_BN_CLICKED(IDC_BUTTON_ANIMATICS_MOVE_TO_Y, &AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToY) + ON_BN_CLICKED(IDC_BUTTON_ANIMATICS_MOVE_TO_Z, &AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToZ) + ON_EN_KILLFOCUS(IDC_EDIT_ANIMATICS_CMD, &AnimaticsUtilityDlg::OnEnKillfocusEditAnimaticsCmd) + ON_BN_CLICKED(IDC_BUTTON_BEGIN_REPE_TEST, &AnimaticsUtilityDlg::OnBnClickedButtonBeginRepeTest) + ON_BN_CLICKED(IDC_BUTTON_SAVE_REPETEST, &AnimaticsUtilityDlg::OnBnClickedButtonSaveRepetest) + ON_BN_CLICKED(IDC_BUTTON_ANIMATICS_HOME, &AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsHome) +END_MESSAGE_MAP() + + +// AnimaticsUtilityDlg message handlers + +BOOL AnimaticsUtilityDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + GetDlgItem(IDC_BUTTON_START_ANIMATICS_MACHINE)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_STOP_ANIMATICS_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_READ_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVE_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_UP)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_LEFT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_BACK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_X)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Y)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Z)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVE_REPETEST)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POS_SET_ZERO)->EnableWindow(false); + //=============================================================== + ((CButton *)GetDlgItem(IDC_RADIO_ANIMATICS_SPEED_GEAR_2))->SetCheck(TRUE); + ((CButton *)GetDlgItem(IDC_RADIO_ANIMATICS_CMD_X))->SetCheck(TRUE); + ((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_ABSOLUTE))->SetCheck(TRUE); + //=============================================================== + m_hRed=AfxGetApp()->LoadIcon(IDI_ICON_RED); + m_hGreen=AfxGetApp()->LoadIcon(IDI_ICON_GREEN); + m_hGray=AfxGetApp()->LoadIcon(IDI_ICON_GRAY); + m_hWhite=AfxGetApp()->LoadIcon(IDI_ICON_WHITE); + m_hBlack=AfxGetApp()->LoadIcon(IDI_ICON_BLACK); + //=============================================================== + RepeTestAxisX=FALSE; + RepeTestAxisY=FALSE; + RepeTestAxisZ=FALSE; + bRepeTestDone=TRUE; + dRepeTestFromPos=0.0; + dRepeTestToPos=0.0; + iRepeTestInterval=0; + iRepeTestTimes=0; + RepeTestRecordStartPos[0]=0.0; + RepeTestRecordStartPos[1]=0.0; + RepeTestRecordStartPos[2]=0.0; + RepeTestRecordEndPos[0]=0.0; + RepeTestRecordEndPos[1]=0.0; + RepeTestRecordEndPos[2]=0.0; + RepeTestCnt=-1; + RepeTestBeginFlag=false; + //=============================================================== + MoveToDisX=_T("0.0"); + MoveToDisY=_T("0.0"); + MoveToDisZ=_T("0.0"); + + RepeTestMoveFromDis=_T("0"); + RepeTestMoveToDis=_T("0"); + RepeTestTimes=_T("0"); + RepeTestInterval=_T("0"); + + if (!pAnimaticsLogger) + { + pAnimaticsLogger = new CLogger(_T("\\SmartMotor_DebugLog.txt")); + } + //=============================================================== + return TRUE; // return TRUE unless you set the focus to a control +} + +void AnimaticsUtilityDlg::OnBnClickedButtonStartAnimaticsMachine() +{ + if (pSmartMotor_Proto) + { + pSmartMotor_Proto->_start_machine(); + } + + GetDlgItem(IDC_BUTTON_START_ANIMATICS_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_HOME)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_STOP_ANIMATICS_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_READ_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVE_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_UP)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_LEFT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_BACK)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_X)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Y)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Z)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVE_REPETEST)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_POS_SET_ZERO)->EnableWindow(true); + + GetDlgItem(IDCANCEL)->EnableWindow(false); + SetTimer(1,150,NULL); + ShowParameterOnEdit(); + ShowWorktableEdit(); +} + +void AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsHome() +{ + pSmartMotor_Proto->smartmotor_motion_Dcc_Home(); +} + + +void AnimaticsUtilityDlg::OnBnClickedButtonStopAnimaticsMachine() +{ + KillTimer(1); + KillTimer(3); + pSmartMotor_Proto->_shutdown_machine(); + + GetDlgItem(IDC_BUTTON_START_ANIMATICS_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_STOP_ANIMATICS_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_READ_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVE_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_UP)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_LEFT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_BACK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_X)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Y)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_Z)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVE_REPETEST)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POS_SET_ZERO)->EnableWindow(false); + + GetDlgItem(IDCANCEL)->EnableWindow(true); +} + + + + +void AnimaticsUtilityDlg::OnBnClickedCancel() +{ + if (pSmartMotor_Proto) + { + delete pSmartMotor_Proto; + pSmartMotor_Proto=nullptr; + } + if (pAnimaticsLogger) + { + delete pAnimaticsLogger; + pAnimaticsLogger=nullptr; + } + + CDialog::OnCancel(); +} +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToX() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cMove_to_X=T2A(MoveToDisX); + + pSmartMotor_Proto->g_machine.x._d_move_dis = atof(cMove_to_X); + + if (((CButton *)GetDlgItem(IDC_CHECK_ANIMATICS_REVERSE))->GetCheck()) + { + pSmartMotor_Proto->g_machine.x._d_move_dis = -pSmartMotor_Proto->g_machine.x._d_move_dis; + } + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_ABSOLUTE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOX_ABS(pSmartMotor_Proto->g_machine.x._d_move_dis); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_RELATIVE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOX_REL(pSmartMotor_Proto->g_machine.x._d_move_dis); + } +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToY() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cMove_to_Y=T2A(MoveToDisY); + + pSmartMotor_Proto->g_machine.y._d_move_dis = atof(cMove_to_Y); + + if (((CButton *)GetDlgItem(IDC_CHECK_ANIMATICS_REVERSE))->GetCheck()) + { + pSmartMotor_Proto->g_machine.y._d_move_dis = -pSmartMotor_Proto->g_machine.y._d_move_dis; + } + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_ABSOLUTE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOY_ABS(pSmartMotor_Proto->g_machine.y._d_move_dis); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_RELATIVE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOY_REL(pSmartMotor_Proto->g_machine.y._d_move_dis); + } +} + + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToZ() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cMove_to_Z=T2A(MoveToDisZ); + + pSmartMotor_Proto->g_machine.z._d_move_dis = atof(cMove_to_Z); + + if (((CButton *)GetDlgItem(IDC_CHECK_ANIMATICS_REVERSE))->GetCheck()) + { + pSmartMotor_Proto->g_machine.z._d_move_dis = -pSmartMotor_Proto->g_machine.z._d_move_dis; + } + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_ABSOLUTE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOZ_ABS(pSmartMotor_Proto->g_machine.z._d_move_dis); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_RELATIVE))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOZ_REL(pSmartMotor_Proto->g_machine.z._d_move_dis); + } +} +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonAnimaticsMoveToXyz() +{ + UpdateData(TRUE); + USES_CONVERSION; + + const char* cMove_to_X=T2A(MoveToDisX); + const char* cMove_to_Y=T2A(MoveToDisY); + const char* cMove_to_Z=T2A(MoveToDisZ); + + pSmartMotor_Proto->g_machine.x._d_move_dis = atof(cMove_to_X); + pSmartMotor_Proto->g_machine.y._d_move_dis = atof(cMove_to_Y); + pSmartMotor_Proto->g_machine.z._d_move_dis = atof(cMove_to_Z); + + if (((CButton *)GetDlgItem(IDC_CHECK_ANIMATICS_REVERSE))->GetCheck()) + { + pSmartMotor_Proto->g_machine.x._d_move_dis = -pSmartMotor_Proto->g_machine.x._d_move_dis; + pSmartMotor_Proto->g_machine.y._d_move_dis = -pSmartMotor_Proto->g_machine.y._d_move_dis; + pSmartMotor_Proto->g_machine.z._d_move_dis = -pSmartMotor_Proto->g_machine.z._d_move_dis; + } + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_ABSOLUTE))->GetCheck()) + { + pSmartMotor_Proto->smartmotor_motion_set_position_xyz(pSmartMotor_Proto->g_machine.x._d_move_dis, pSmartMotor_Proto->g_machine.y._d_move_dis, pSmartMotor_Proto->g_machine.z._d_move_dis ,false); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_TO_RELATIVE))->GetCheck()) + { + pSmartMotor_Proto->smartmotor_motion_move_rel_dis_xyz(pSmartMotor_Proto->g_machine.x._d_move_dis, pSmartMotor_Proto->g_machine.y._d_move_dis, pSmartMotor_Proto->g_machine.z._d_move_dis ,false); + } + +} + + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonPosSetZero() +{ + double XPos(0.0),YPos(0.0),ZPos(0.0); + pSmartMotor_Proto->smartmotor_motion_get_position_xyz(XPos,YPos,ZPos); + pSmartMotor_Proto->g_machine.x._lSet_Zero_Pos=pSmartMotor_Proto->g_machine.x._l_cur_pos; + pSmartMotor_Proto->g_machine.x._dSet_Zero_Pos=pSmartMotor_Proto->g_machine.x._d_cur_pos; + pSmartMotor_Proto->g_machine.y._lSet_Zero_Pos=pSmartMotor_Proto->g_machine.y._l_cur_pos; + pSmartMotor_Proto->g_machine.y._dSet_Zero_Pos=pSmartMotor_Proto->g_machine.y._d_cur_pos; + pSmartMotor_Proto->g_machine.z._lSet_Zero_Pos=pSmartMotor_Proto->g_machine.z._l_cur_pos; + pSmartMotor_Proto->g_machine.z._dSet_Zero_Pos=pSmartMotor_Proto->g_machine.z._d_cur_pos; +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonSaveConfig() +{ + ChangeParameterOnEdit(); + pSmartMotor_Proto->SaveSmartMotorConfig(); + +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonReadConfig() +{ + pSmartMotor_Proto->LoadSmartMotorConfig(); + ShowParameterOnEdit(); +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear1() +{ + pSmartMotor_Proto->g_machine.x._Move_Speed_Gear=0; + pSmartMotor_Proto->g_machine.y._Move_Speed_Gear=0; + pSmartMotor_Proto->g_machine.z._Move_Speed_Gear=0; + +} +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear2() +{ + pSmartMotor_Proto->g_machine.x._Move_Speed_Gear=1; + pSmartMotor_Proto->g_machine.y._Move_Speed_Gear=1; + pSmartMotor_Proto->g_machine.z._Move_Speed_Gear=1; +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear3() +{ + pSmartMotor_Proto->g_machine.x._Move_Speed_Gear=2; + pSmartMotor_Proto->g_machine.y._Move_Speed_Gear=2; + pSmartMotor_Proto->g_machine.z._Move_Speed_Gear=2; +} + +//=========================================================== +void AnimaticsUtilityDlg::OnBnClickedRadioAnimaticsSpeedGear4() +{ + pSmartMotor_Proto->g_machine.x._Move_Speed_Gear=3; + pSmartMotor_Proto->g_machine.y._Move_Speed_Gear=3; + pSmartMotor_Proto->g_machine.z._Move_Speed_Gear=3; +} + + + +//=========================================================== +void AnimaticsUtilityDlg::OnEnKillfocusEditAnimaticsCmd() +{ + UpdateData(TRUE); + USES_CONVERSION; + + if (((CButton *)GetDlgItem(IDC_RADIO_ANIMATICS_CMD_X))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_COMM_CMDX(SmartMotorSendCmd); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEX(SmartMotorGetResponse); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_ANIMATICS_CMD_Y))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_COMM_CMDY(SmartMotorSendCmd); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEY(SmartMotorGetResponse); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_ANIMATICS_CMD_Z))->GetCheck()) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_COMM_CMDZ(SmartMotorSendCmd); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_GET_COMM_RESPONSEZ(SmartMotorGetResponse); + } + UpdateData(FALSE); +} + +//================================================================================================ +void AnimaticsUtilityDlg::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + switch(nIDEvent) + { + case 1: + { + if (pSmartMotor_Proto) + { + double XPos(0.0),YPos(0.0),ZPos(0.0); + pSmartMotor_Proto->smartmotor_motion_get_position_xyz(XPos,YPos,ZPos); + PosPulseX.Format(_T("%8ld"),(pSmartMotor_Proto->g_machine.x._l_cur_pos)); + PosPulseY.Format(_T("%8ld"),(pSmartMotor_Proto->g_machine.y._l_cur_pos)); + PosPulseZ.Format(_T("%8ld"),(pSmartMotor_Proto->g_machine.z._l_cur_pos)); + + GetDlgItem(IDC_EDIT_X_POS)->SetWindowText(PosPulseX); + GetDlgItem(IDC_EDIT_Y_POS)->SetWindowText(PosPulseY); + GetDlgItem(IDC_EDIT_Z_POS)->SetWindowText(PosPulseZ); + + PosmmX.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.x._d_cur_pos)); + PosmmY.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.y._d_cur_pos)); + PosmmZ.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.z._d_cur_pos)); + + GetDlgItem(IDC_EDIT_X_POS_MM)->SetWindowText(PosmmX); + GetDlgItem(IDC_EDIT_Y_POS_MM)->SetWindowText(PosmmY); + GetDlgItem(IDC_EDIT_Z_POS_MM)->SetWindowText(PosmmZ); + + PosmmChangedX.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.x._d_cur_pos-pSmartMotor_Proto->g_machine.x._dSet_Zero_Pos)); + PosmmChangedY.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.y._d_cur_pos-pSmartMotor_Proto->g_machine.y._dSet_Zero_Pos)); + PosmmChangedZ.Format(_T("%8.4lf"),(pSmartMotor_Proto->g_machine.z._d_cur_pos-pSmartMotor_Proto->g_machine.z._dSet_Zero_Pos)); + + GetDlgItem(IDC_EDIT_X_POS_MM_CHANGE)->SetWindowText(PosmmChangedX); + GetDlgItem(IDC_EDIT_Y_POS_MM_CHANGE)->SetWindowText(PosmmChangedY); + GetDlgItem(IDC_EDIT_Z_POS_MM_CHANGE)->SetWindowText(PosmmChangedZ); + //==================================================== + if (pSmartMotor_Proto->m_bHomingActive) + { + pSmartMotor_Proto->smartmotor_motion_get_home_status(); + pSmartMotor_Proto->smartmotor_motion_IS_Homed(); + if(pSmartMotor_Proto->g_machine.s_status._bXHomed) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_X))->SetIcon(m_hGreen); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_X))->SetIcon(m_hRed); + } + + if(pSmartMotor_Proto->g_machine.s_status._bYHomed) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_Y))->SetIcon(m_hGreen); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_Y))->SetIcon(m_hRed); + } + if(pSmartMotor_Proto->g_machine.s_status._bZHomed) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_z))->SetIcon(m_hGreen); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_HOME_z))->SetIcon(m_hRed); + } + } + + //==================================================== + pSmartMotor_Proto->smartmotor_motion_get_motion_status(); + if (pSmartMotor_Proto->g_machine.s_status._bXMoving) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_X))->SetIcon(m_hRed); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_X))->SetIcon(m_hGreen); + } + //----------------------------------------------------- + if (pSmartMotor_Proto->g_machine.s_status._bYMoving) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_Y))->SetIcon(m_hRed); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_Y))->SetIcon(m_hGreen); + } + //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.s_status._bZMoving) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_Z))->SetIcon(m_hRed); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOVING_Z))->SetIcon(m_hGreen); + } + //==================================================== + pSmartMotor_Proto->smartmotor_motion_get_status_word(); + //------------------------------------------------------ + ShowMotorStatusX(); + ShowMotorStatusY(); + ShowMotorStatusZ(); + //==================================================== + if(!bRepeTestDone) + { + if (!pSmartMotor_Proto->g_machine.s_status._bXYZMoving) + { + pAnimaticsLogger->SendAndFlush(_T("[Move Done]bRepeTestDone=%d; RepeTestBeginFlag=%d \r\n"),bRepeTestDone,RepeTestBeginFlag); + if(RepeTestBeginFlag) + { + bRepeTestDone=TRUE; + SetTimer(3,iRepeTestInterval,NULL); + } + else + { + bRepeTestDone=TRUE; + MsgX=_T(""); + MsgY=_T(""); + MsgZ=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + } + } + } + break; + } + case 3: + { + if (RepeTestBeginFlag) + { + bRepeTestDone=TRUE; + SmartMotorRepeTest(); + } + else + { + bRepeTestDone=TRUE; + MsgX=_T(""); + MsgY=_T(""); + MsgZ=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + KillTimer(3); + break; + } + } + + CDialog::OnTimer(nIDEvent); +} + +//===================================================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonBeginRepeTest() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTmp; + cTmp=T2A(RepeTestMoveFromDis); + dRepeTestFromPos = atof(cTmp); + + cTmp=T2A(RepeTestMoveToDis); + dRepeTestToPos = atof(cTmp); + + cTmp=T2A(RepeTestTimes); + iRepeTestTimes = atoi(cTmp); + + cTmp=T2A(RepeTestInterval); + iRepeTestInterval = atoi(cTmp); + + if (RepeTestBeginFlag) + { + RepeTestBeginFlag=false; + pSmartMotor_Proto->smartmotor_motion_stop_xyz(); + bRepeTestDone=FALSE; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + else + { + RepeTestBeginFlag=true; + RepeTestCnt=-1; + MsgX=_T(""); + MsgY=_T(""); + MsgZ=_T(""); + GetDlgItem(IDC_EDIT_REPRETEST)->SetWindowTextW(MsgZ); + RepeTestRecordStartPos[0]=0; + RepeTestRecordStartPos[1]=0; + RepeTestRecordStartPos[2]=0; + RepeTestRecordEndPos[0]=0; + RepeTestRecordEndPos[1]=0; + RepeTestRecordEndPos[2]=0; + pAnimaticsLogger->SendAndFlush(_T("[RepeTest] From: %f;To:%f; Times:%d; Interval:%d \r\n"),dRepeTestFromPos,dRepeTestToPos,iRepeTestTimes,iRepeTestInterval); + RepeTestAxisX = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTX))->GetCheck(); + RepeTestAxisY = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTY))->GetCheck(); + RepeTestAxisZ = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTZ))->GetCheck(); + bRepeTestDone=TRUE; + SmartMotorRepeTest(); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Stop")); + } +} +//===================================================================================== +BOOL AnimaticsUtilityDlg::SmartMotorRepeTest() +{ + UpdateData(TRUE); + CString csTemp; + if (RepeTestCnt_send_cmd_SMARTMOTOR_MOVETOX_ABS(dRepeTestFromPos); + } + if (RepeTestAxisY) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOY_ABS(dRepeTestFromPos); + } + if(RepeTestAxisZ) + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOZ_ABS(dRepeTestFromPos); + } + } + else + { + if (RepeTestCnt%2 == 0) + { + if (RepeTestAxisX) + { + MsgX.Format(_T("[%2d] X: From: % .4f "),RepeTestCnt/2+1,pSmartMotor_Proto->g_machine.x._d_cur_pos); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOX_ABS(dRepeTestToPos); + } + if (RepeTestAxisY) + { + MsgY.Format(_T("[%2d] Y: From: % .4f "),RepeTestCnt/2+1,pSmartMotor_Proto->g_machine.y._d_cur_pos); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOY_ABS(dRepeTestToPos); + } + if(RepeTestAxisZ) + { + MsgZ.Format(_T("[%2d] Z: From: % .4f "),RepeTestCnt/2+1,pSmartMotor_Proto->g_machine.z._d_cur_pos); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOZ_ABS(dRepeTestToPos); + } + + } + else if(RepeTestCnt%2 == 1) + { + if (RepeTestAxisX) + { + csTemp.Format(_T("To: % 3.4f \r\n"),pSmartMotor_Proto->g_machine.x._d_cur_pos); + MsgX+=csTemp; + OutputWithScroll(MsgX,RepeTestMsgOut); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOX_ABS(dRepeTestFromPos); + } + if (RepeTestAxisY) + { + csTemp.Format(_T("To: % 3.4f \r\n"),pSmartMotor_Proto->g_machine.y._d_cur_pos); + MsgY+=csTemp; + OutputWithScroll(MsgY,RepeTestMsgOut); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOY_ABS(dRepeTestFromPos); + } + if(RepeTestAxisZ) + { + csTemp.Format(_T("To: % 3.4f \r\n"),pSmartMotor_Proto->g_machine.z._d_cur_pos); + MsgZ+=csTemp; + OutputWithScroll(MsgZ,RepeTestMsgOut); + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVETOZ_ABS(dRepeTestFromPos); + } + } + } + bRepeTestDone=false; + RepeTestCnt++; + } + } + else + { + MsgX=_T(""); + MsgY=_T(""); + MsgZ=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + return TRUE; +} + +//===================================================================================== +void AnimaticsUtilityDlg::OnBnClickedButtonSaveRepetest() +{ + USES_CONVERSION; + UpdateData(TRUE); + + CString FileName; + CString PathName; + FILE* m_pOutFile; + + FileName=_T("RepeTest.txt"); + CString szFilter=_T("TXT Files(*.txt)|*.txt|ALL Files(*.*)|*.*||"); + CFileDialog fdlg(FALSE,_T("INI"),FileName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + + if( fdlg.DoModal()==IDOK) + { + const char* outBuff=NULL; + PathName=fdlg.GetPathName(); + _wfopen_s(&m_pOutFile, PathName, _T("wt")); + if (!m_pOutFile) + { + MessageBox( _T("File name Error."), _T("Message"), MB_OK); + }; + CString MsgOut; + RepeTestMsgOut.GetWindowText(MsgOut); + outBuff=T2A(MsgOut); + fprintf(m_pOutFile,"%s", outBuff); + fclose(m_pOutFile); + } + delete fdlg; +} +//===================================================================================== +//Print message on edit control +void AnimaticsUtilityDlg::OutputWithScroll(const CString &strNewText,CEdit &edtOutput) +{ + CString strOutput; + edtOutput.GetWindowText(strOutput); + strOutput += strNewText; + //if ("/r/n" != strOutput.Right(2)) + //{ + // strOutput += "/r/n"; + //} + int iCount = strOutput.GetLength(); + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strOutput); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); + +} +//================================================================ +void AnimaticsUtilityDlg::ChangeParameterOnEdit() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cSpeedX; + const char* cSpeedY; + const char* cSpeedZ; + + for(INT i=0;i<5;i++) + { + cSpeedX=T2A(SpeedParameterX[i]); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._speed_[i]=atoi(cSpeedX); + cSpeedX=T2A(AccelParameterX[i]); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._accel_[i]=atoi(cSpeedX); + cSpeedX=T2A(DecelParameterX[i]); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._decel_[i]=atoi(cSpeedX); + + + cSpeedY=T2A(SpeedParameterY[i]); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._speed_[i]=atoi(cSpeedY); + cSpeedY=T2A(AccelParameterY[i]); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._accel_[i]=atoi(cSpeedY); + cSpeedY=T2A(DecelParameterY[i]); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._decel_[i]=atoi(cSpeedY); + + cSpeedZ=T2A(SpeedParameterZ[i]); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._speed_[i]=atoi(cSpeedZ); + cSpeedZ=T2A(AccelParameterZ[i]); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._accel_[i]=atoi(cSpeedZ); + cSpeedZ=T2A(DecelParameterZ[i]); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._decel_[i]=atoi(cSpeedZ); + + } + + +} + +//================================================================ +void AnimaticsUtilityDlg::ShowParameterOnEdit() +{ + for(INT i=0;i<5;i++) + { + SpeedParameterX[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.x_axis._speed_[i])); + AccelParameterX[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.x_axis._accel_[i])); + DecelParameterX[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.x_axis._decel_[i])); + + SpeedParameterY[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.y_axis._speed_[i])); + AccelParameterY[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.y_axis._accel_[i])); + DecelParameterY[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.y_axis._decel_[i])); + + SpeedParameterZ[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.z_axis._speed_[i])); + AccelParameterZ[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.z_axis._accel_[i])); + DecelParameterZ[i].Format(_T("%d"),(pSmartMotor_Proto->g_machine.s_machine_config.z_axis._decel_[i])); + + } + + UpdateData(FALSE); +} + +//======================================================== +void AnimaticsUtilityDlg::OnEnKillfocusEditWorktable() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTmp; + + cTmp=T2A(ScaleResolutionX); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._scale_resolution=atof(cTmp); + cTmp=T2A(NegSoftLimitX); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._neg_working_limit=atof(cTmp); + cTmp=T2A(PosSoftLimitX); + pSmartMotor_Proto->g_machine.s_machine_config.x_axis._pos_working_limit=atof(cTmp); + + cTmp=T2A(ScaleResolutionY); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._scale_resolution=atof(cTmp); + cTmp=T2A(NegSoftLimitY); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._neg_working_limit=atof(cTmp); + cTmp=T2A(PosSoftLimitY); + pSmartMotor_Proto->g_machine.s_machine_config.y_axis._pos_working_limit=atof(cTmp); + + cTmp=T2A(ScaleResolutionZ); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._scale_resolution=atof(cTmp); + cTmp=T2A(NegSoftLimitZ); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._neg_working_limit=atof(cTmp); + cTmp=T2A(PosSoftLimitZ); + pSmartMotor_Proto->g_machine.s_machine_config.z_axis._pos_working_limit=atof(cTmp); +} +//======================================================== +void AnimaticsUtilityDlg::ShowWorktableEdit() +{ + + ScaleResolutionX.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + NegSoftLimitX.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.x_axis._neg_working_limit); + PosSoftLimitX.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.x_axis._pos_working_limit); + + ScaleResolutionY.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + NegSoftLimitY.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.y_axis._neg_working_limit); + PosSoftLimitY.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.y_axis._pos_working_limit); + + ScaleResolutionZ.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + NegSoftLimitZ.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.z_axis._neg_working_limit); + PosSoftLimitZ.Format(_T("%.4f"),pSmartMotor_Proto->g_machine.s_machine_config.z_axis._pos_working_limit); + + UpdateData(FALSE); +} + +//=========================================================== +void AnimaticsUtilityDlg::ShowMotorStatusX() +{ + //=====================status word================================== + if (pSmartMotor_Proto->g_machine.x.s_machine_status.DriverRdy) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_X))->SetIcon(m_hBlack); + } + //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.MotorOff) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_X))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.VoltageFault) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_X))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.PosErr) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_X))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.OverHeat) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_X))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.NegLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_X))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.x.s_machine_status.PosLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_X))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_X))->SetIcon(m_hBlack); + } +} + +//=========================================================== +void AnimaticsUtilityDlg::ShowMotorStatusY() +{ + //=====================status word================================== + if (pSmartMotor_Proto->g_machine.y.s_machine_status.DriverRdy) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_Y))->SetIcon(m_hBlack); + } + //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.MotorOff) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_Y))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.VoltageFault) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_Y))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.PosErr) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_Y))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.OverHeat) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_Y))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.NegLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_Y))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.y.s_machine_status.PosLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_Y))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_Y))->SetIcon(m_hBlack); + } +} + +//=========================================================== +void AnimaticsUtilityDlg::ShowMotorStatusZ() +{ + //=====================status word================================== + if (pSmartMotor_Proto->g_machine.z.s_machine_status.DriverRdy) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_DRIVER_RDY_Z))->SetIcon(m_hBlack); + } + //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.MotorOff) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_MOTOR_OFF_Z))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.VoltageFault) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_VOLFAULT_Z))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.PosErr) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSERR_Z))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.OverHeat) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_OVERHEAT_Z))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.NegLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_NEGLIMIT_Z))->SetIcon(m_hBlack); + } //------------------------------------------------------ + if (pSmartMotor_Proto->g_machine.z.s_machine_status.PosLimit) + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_Z))->SetIcon(m_hWhite); + } + else + { + ((CButton*)GetDlgItem(IDC_BUTTON_STATUS_POSLIMIT_Z))->SetIcon(m_hBlack); + } +} + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.h new file mode 100644 index 0000000..0edaa57 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/AnimaticsUtilityDlg.h @@ -0,0 +1,114 @@ +#pragma once + +// AnimaticsUtilityDlg dialog + +class AnimaticsUtilityDlg : public CDialog +{ + DECLARE_DYNAMIC(AnimaticsUtilityDlg) + +public: + AnimaticsUtilityDlg(CWnd* pParent = NULL); // standard constructor + virtual ~AnimaticsUtilityDlg(); + +// Dialog Data + enum { IDD = IDD_ANIMATICS_UTIL_DIALOG }; + + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + + + CString SpeedParameterX[5]; + CString AccelParameterX[5]; + CString DecelParameterX[5]; + CString SpeedParameterY[5]; + CString AccelParameterY[5]; + CString DecelParameterY[5]; + CString SpeedParameterZ[5]; + CString AccelParameterZ[5]; + CString DecelParameterZ[5]; + + CString ScaleResolutionX; + CString ScaleResolutionY; + CString ScaleResolutionZ; + + CString NegSoftLimitX; + CString NegSoftLimitY; + CString NegSoftLimitZ; + + CString PosSoftLimitX; + CString PosSoftLimitY; + CString PosSoftLimitZ; + + CString PosPulseX; + CString PosPulseY; + CString PosPulseZ; + CString PosmmX; + CString PosmmY; + CString PosmmZ; + CString PosmmChangedX; + CString PosmmChangedY; + CString PosmmChangedZ; + + CString MoveToDisX; + CString MoveToDisY; + CString MoveToDisZ; + + CString RepeTestMoveFromDis; + CString RepeTestMoveToDis; + CString RepeTestTimes; + CString RepeTestInterval; + CEdit RepeTestMsgOut; + CString MsgX,MsgY,MsgZ; + + CString SmartMotorSendCmd; + CString SmartMotorGetResponse; + + HICON m_hRed; + HICON m_hGreen; + HICON m_hGray; + HICON m_hWhite; + HICON m_hBlack; + + CProcessButton MoveX_Left; + CProcessButton MoveX_Right; + CProcessButton MoveY_Front; + CProcessButton MoveY_Back; + CProcessButton MoveZ_Up; + CProcessButton MoveZ_Down; + + //============================= + void ChangeParameterOnEdit(); + void ShowParameterOnEdit(); + void ShowMotorStatusX(); + void ShowMotorStatusY(); + void ShowMotorStatusZ(); + BOOL SmartMotorRepeTest(); + void OutputWithScroll(const CString &strNewText,CEdit &edtOutput); + afx_msg void OnBnClickedButtonStartAnimaticsMachine(); + afx_msg void OnBnClickedButtonStopAnimaticsMachine(); + afx_msg void OnBnClickedCancel(); + void ShowWorktableEdit(); + afx_msg void OnEnKillfocusEditWorktable(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + + afx_msg void OnBnClickedButtonAnimaticsMoveToXyz(); + afx_msg void OnBnClickedButtonPosSetZero(); + afx_msg void OnBnClickedButtonSaveConfig(); + afx_msg void OnBnClickedButtonReadConfig(); + afx_msg void OnBnClickedRadioAnimaticsSpeedGear1(); + afx_msg void OnBnClickedRadioAnimaticsSpeedGear2(); + afx_msg void OnBnClickedRadioAnimaticsSpeedGear3(); + afx_msg void OnBnClickedRadioAnimaticsSpeedGear4(); + afx_msg void OnBnClickedButtonAnimaticsMoveToX(); + afx_msg void OnBnClickedButtonAnimaticsMoveToY(); + afx_msg void OnBnClickedButtonAnimaticsMoveToZ(); + + afx_msg void OnEnKillfocusEditAnimaticsCmd(); + afx_msg void OnBnClickedButtonBeginRepeTest(); + afx_msg void OnBnClickedButtonSaveRepetest(); + afx_msg void OnBnClickedButtonAnimaticsHome(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.cpp new file mode 100644 index 0000000..810ace8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.cpp @@ -0,0 +1,62 @@ +#include "stdafx.h" +#include "Animatics_UtilDlg.h" +#include "afxdialogex.h" + + +// CAnimatics_UtilDlg Ի + + +IMPLEMENT_DYNAMIC(CAnimatics_UtilDlg, CDialog) + + CAnimatics_UtilDlg::CAnimatics_UtilDlg(CWnd* pParent /*=NULL*/) + : CDialog(CAnimatics_UtilDlg::IDD, pParent) +{ + m_YPos=0.0; + m_XPos=0.0; + m_ZPos=0.0; +} + +CAnimatics_UtilDlg::~CAnimatics_UtilDlg() +{ +} + +void CAnimatics_UtilDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CAnimatics_UtilDlg, CDialog) + +END_MESSAGE_MAP() + + +// CAnimatics_UtilDlg Ϣ + +BOOL CAnimatics_UtilDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + + return TRUE; // return TRUE unless you set the focus to a control +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.h new file mode 100644 index 0000000..bd55338 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Animatics_UtilDlg.h @@ -0,0 +1,72 @@ +#pragma once + +#include "resource.h" +#include "..\..\..\Animatics\Animatics_Proto.h" +#include "ProcessButton.h" +#include "afxwin.h" +extern SmartMotor_Proto* pSmartMotor_Proto; + + +// CAnimatics_UtilDlg Ի + +class CAnimatics_UtilDlg : public CDialog +{ + DECLARE_DYNAMIC(CAnimatics_UtilDlg) + +public: + CAnimatics_UtilDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CAnimatics_UtilDlg(); + + // Ի + enum { IDD = IDD_ANIMATICS_UTIL_DIALOG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + double m_XPos; + double m_YPos; + double m_ZPos; + + CString m_OutMessage; + CString m_X_Pos; + CString m_Y_Pos; + CString m_Z_Pos; + CString m_Zm_Pos; + + CString m_csTop_Light_Value; + CString m_csBom_Light_Value; + CString m_csFan_Light_Value; + CString m_csBom1_Light_Value; + CString m_csBom2_Light_Value; + CString m_csFan1_Light_Switch; + CString m_csFan2_Light_Switch; + + CString m_cs_Light_Switch; + CString m_cs_Light_Size_Value; + + CString m_cs_Version_Number; + + CString m_cs_XScaleCoeff; + CString m_cs_YScaleCoeff; + CString m_cs_ZScaleCoeff; + + HICON m_hRed; + HICON m_hGreen; + HICON m_hGray; + HICON m_hWhite; + HICON m_hBlack; + + CProcessButton m_Button_MoveX_Left; + CProcessButton m_Button_MoveX_Right; + CProcessButton m_Button_MoveY_Front; + CProcessButton m_Button_MoveY_Back; + CProcessButton m_Button_MoveZ_Up; + CProcessButton m_Button_MoveZ_Down; + CProcessButton m_Button_MoveV_Zoom_In; + CProcessButton m_Button_MoveV_Zoom_Out; + + + +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CMD_H.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CMD_H.h new file mode 100644 index 0000000..c4bd9b8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CMD_H.h @@ -0,0 +1,457 @@ +//#define PASSNUM 110 +//#define PASSNUM1 200 +enum FUN_CMD +{ + +CT_FUN, +CT_MOTOR, +CT_SCALE, +CT_LIGHT, +CT_INT, +CT_DATA + +}; + +enum MOTOR_CMD +{ + +CT_MOVEX, + +CT_MOVEY, + +CT_MOVEZ, + + +CT_MOVETOX, +CT_MOVETOY, +CT_MOVETOZ, + +CT_MOVETOFX, +CT_MOVETOFY, +CT_MOVETOFZ, + +CT_MOVETOSX, +CT_MOVETOSY, +CT_MOVETOSZ, + +CT_MOVETOAX, +CT_MOVETOAY, +CT_MOVETOAZ, + +CT_MOVETOASX, +CT_MOVETOASY, +CT_MOVETOASZ, + +CT_MOVETOAFX, +CT_MOVETOAFY, +CT_MOVETOAFZ, + +CT_RESETXYZ, +CT_RESETX, +CT_RESETY, +CT_RESETZ, + +CT_STOPA, +CT_STOPX, +CT_STOPY, +CT_STOPZ, + +CT_STOPFA, +CT_STOPFX, +CT_STOPFY, +CT_STOPFZ, + +CT_SET_SPEEDX, + + +CT_SET_SPEEDY, + + +CT_SET_SPEEDZ, + +CT_READ_SPEEDX, +CT_READ_SPEEDY, +CT_READ_SPEEDZ, + +CT_SET_PRECISIONX, +CT_SET_PRECISIONY, +CT_SET_PRECISIONZ, + +CT_SET_DEFAULTX, +CT_SET_DEFAULTY, +CT_SET_DEFAULTZ, + +CT_READ_PRECISIONX, +CT_READ_PRECISIONY, +CT_READ_PRECISIONZ, +CT_RESET, + +CT_MOVEV, +CT_MOVETOV, +CT_RESETV, +CT_STOPV, +CT_SET_SPEEDV, +CT_READ_SPEEDV, +CT_SET_DEFAULTV, +CT_TESTV, +CT_TSTOPV, +CT_TEST_STOP, +CT_READ_V, + +CT_M_SPEED, +CT_M_DIS, +CT_M_FRESH, +CT_M_CMD, +CT_M_READ_DAT, +CT_SET_MOTOR_CAL, + +CT_M_SWITCH_START, +CT_M_SWITCH_CLOSE, +CT_M_SWITCH_TOP, +CT_M_SWITCH_BOM, +CT_M_SWITCH_RESET, +CT_M_SWITCH_VALUE, +CT_M_RESET_LEFT, +CT_M_RESET_RIGHT, + +CT_LASE_TIMMER_ON, +CT_LASE_TIMMER_OFF, +CT_M_PROBE_ON, +CT_M_PROBE_OFF, +CT_MOVETOXYZ, +CT_MOVETOXYZ_LASE, +CT_GET_LASE, +CT_MOVETOXYZV, +CT_M_LASE_ON, +CT_M_LASE_OFF, +CT_M_BCL_ON, +CT_M_BCL_OFF, +CT_MOVETOXYZ_JM, + +CT_END + +}; + +enum SCALE_CMD +{ + +CT_SEC_FLAG, + +CT_SCALEX, +CT_SCALEY, +CT_SCALEZ, + +CT_SECTIONX, +CT_SECTIONY, +CT_SECTIONZ, + +CT_SET_AXISX, +CT_SET_AXISY, +CT_SET_AXISZ, + +CT_SET_SECTIONX, +CT_SET_SECTIONY, +CT_SET_SECTIONZ, + +CT_X_BEGIN, +CT_Y_BEGIN, +CT_Z_BEGIN, + +CT_X_SECTION_END, +CT_Y_SECTION_END, +CT_Z_SECTION_END, + +CT_X_SECTION_DEC, +CT_Y_SECTION_DEC, +CT_Z_SECTION_DEC, + +CT_SET_SECTION_X, +CT_SET_SECTION_Y, +CT_SET_SECTION_Z, + +CT_PROBE_FLAG, +CT_SET_LINE_X, +CT_SET_LINE_Y, +CT_SET_LINE_Z, + +CT_SET_PROBE_LINE, +CT_SET_PROBE_SECTION, +CT_SET_VERNO, +CT_SET_RESET_FLAG, +CT_GET_RESET_FLAG + +}; + +enum LIGHT_CMD +{ + +CT_LIGHT1_SIZE, +CT_LIGHT2_SIZE, +CT_LIGHT3_SIZE, +CT_LIGHT4_SIZE, + +CT_LIGHT1_SWITCH, +CT_LIGHT2_SWITCH, +CT_LIGHT3_SWITCH, +CT_LIGHT4_SWITCH, +CT_LIGHT5_SWITCH, +CT_LIGHT_CMD + +}; + +enum INT_CMD +{ + +CT_STOPMX, +CT_STOPMY, +CT_STOPMZ, +CT_STOPXYZ, + +CT_ENDXYZ, + +CT_SWITCHX, +CT_SWITCHY, +CT_SWITCHZ, + +CT_PROBE, +CT_PROBE_SWITCH, +CT_XYZLASE, +CT_SEND_XYZLASE, +CT_END1 + +}; + +enum PRO_DATA +{ +CT_READ_AXISXYZ, +CT_READ_AXISX, +CT_READ_AXISY, +CT_READ_AXISZ, + +CT_READ_PROBEXYZ, +CT_READ_PROBEX, +CT_READ_PROBEY, +CT_READ_PROBEZ, + +CT_SAVE_MOTORX1, +CT_SAVE_MOTORX2, +CT_SAVE_MOTORX3, +CT_SAVE_MOTORX4, +CT_SAVE_MOTORX5, + +CT_SAVE_MOTORY1, +CT_SAVE_MOTORY2, +CT_SAVE_MOTORY3, +CT_SAVE_MOTORY4, +CT_SAVE_MOTORY5, + +CT_SAVE_MOTORZ1, +CT_SAVE_MOTORZ2, +CT_SAVE_MOTORZ3, +CT_SAVE_MOTORZ4, +CT_SAVE_MOTORZ5, + +CT_READ_MOTORX1, +CT_READ_MOTORX2, +CT_READ_MOTORX3, +CT_READ_MOTORX4, +CT_READ_MOTORX5, + +CT_READ_MOTORY1, +CT_READ_MOTORY2, +CT_READ_MOTORY3, +CT_READ_MOTORY4, +CT_READ_MOTORY5, + +CT_READ_MOTORZ1, +CT_READ_MOTORZ2, +CT_READ_MOTORZ3, +CT_READ_MOTORZ4, +CT_READ_MOTORZ5, + +CT_SAVE_SCALEX, +CT_SAVE_SCALEY, +CT_SAVE_SCALEZ, + +CT_READ_SCALEX, +CT_READ_SCALEY, +CT_READ_SCALEZ, + +CT_SAVE_SECTION_FLAGX, +CT_SAVE_SECTION_FLAGY, +CT_SAVE_SECTION_FLAGZ, + +CT_READ_SECTION_FLAGX, +CT_READ_SECTION_FLAGY, +CT_READ_SECTION_FLAGZ, + +CT_SAVE_PROBE, +CT_READ_PROBE, + +CT_SAVE_SEC_REALX, +CT_SAVE_SEC_INTX, +CT_SAVE_SEC_SCALEX, + +CT_SAVE_SEC_REALY, +CT_SAVE_SEC_INTY, +CT_SAVE_SEC_SCALEY, + +CT_SAVE_SEC_REALZ, +CT_SAVE_SEC_INTZ, +CT_SAVE_SEC_SCALEZ, + +CT_READ_SEC_REALX, +CT_READ_SEC_INTX, +CT_READ_SEC_SCALEX, + +CT_READ_SEC_REALY, +CT_READ_SEC_INTY, +CT_READ_SEC_SCALEY, + +CT_READ_SEC_REALZ, +CT_READ_SEC_INTZ, +CT_READ_SEC_SCALEZ, + +CT_READ_SYSTEM, +CT_READ_XSECTION_INT, +CT_READ_XSECTION_REAL, +CT_READ_XSECTION_SCALE, + +CT_READ_YSECTION_INT, +CT_READ_YSECTION_REAL, +CT_READ_YSECTION_SCALE, + +CT_READ_ZSECTION_INT, +CT_READ_ZSECTION_REAL, +CT_READ_ZSECTION_SCALE, + + +CT_WRITE_SYSTEM, +CT_WRITE_XSECTION_INT, +CT_WRITE_XSECTION_REAL, +CT_WRITE_XSECTION_SCALE, + +CT_WRITE_YSECTION_INT, +CT_WRITE_YSECTION_REAL, +CT_WRITE_YSECTION_SCALE, + +CT_WRITE_ZSECTION_INT, +CT_WRITE_ZSECTION_REAL, +CT_WRITE_ZSECTION_SCALE, + +CT_READ_AXISV, +CT_READ_ADC, +CT_READ_ADC_INDEX, + +CT_PRO_DAT_END, +CT_CLEAR_PROBE_FLAG, + +CT_READ_IO_DAT, +CT_WRITE_IO_DAT + +}; + +enum PASSWORD +{ +#ifdef PASSNUM +Llz_unknow=PASSNUM,//110, +#else + llz_unknow = 0, +#endif +Llz_Start, +Llz_Check_PassWord, +Llz_Set_User_Dat, +Llz_Get_User_Dat, +Llz_Get_Fun, +Llz_Scale_Dat, +Llz_Save_Config_Dat, +Llz_Change_SCR_Coor, +Llz_Read_Config_Dat, +Llz_Distance, +Llz_Circle, +Llz_Angle, +Llz_PLDis, +Llz_GetID, +Llz_total +}; + +enum BARCODE +{ +Bar_unknow = 220, + +Bar_Line_Scalex, +Bar_Line_Scaley, +Bar_Section_Scalex, +Bar_Section_Scaley, + +Bar_total +}; + +enum Video_Surce +{ + Video, + + SDK3000, + CG400, + MVIP_1, + MVIP_2, + MVIP_3, + + MV8000E_2, + MV8000E_6, + MV8000E_2_IP, + MV8000E_8, + MV8000E_BAR_3, + MV8000E_BAR_5, + MV8000E_BAR_IP2, + MV8000E_BAR_8, + + V80M, + V80M_SDK3000, + V80M_MV8000E_2, + V80M_MV8000E_BAR_3, + V80M_MV8000E_BAR_5, + V80M_MV8000E_8, + + V140M, + V140M_SDK3000, + V140M_MV8000E_5, + V140M_MV8000E_8, + + V910M, + V910M_SDK3000, + V910M_MV8000E_2, + V910M_MV8000E_BAR_3, + V910M_MV8000E_BAR_5, + V910M_MV8000E_8, + + MV8000E_10, + MV8000E_12, + MV8000E_16, + + MV8800E_8, + MV8800E_10, + MV8800E_12, + MV8800E_16, + + V140M_MV8800E_11, + V140M_MV8000E_11, + + V1000M, + V1000M_2, + + V1000M_30M, + V1KM_V1KM, + V1000M_30M_BARCODE, + V1KM_V1KM_BARCODE, + + V140M_TTK, + VGALF_3C4L, + + + Total +}; + +#define NULCCD if((video_type == MV8000E_8)||(video_type == VGALF_3C4L)||(video_type==V140M_MV8000E_11)/*||(video_type==V140M_TTK)*/||(video_type==V140M_MV8000E_8)||(video_type==MV8000E_BAR_5)||((video_type>=MV8000E_10)&&(video_type=MV8800E_8)&&(video_type<=MV8800E_16)) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMICMotion.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMICMotion.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIComm.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIComm.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIErrors.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIErrors.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIMotor.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIMotor.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIPath.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIPath.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIScan.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CSMIScan.h new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.cpp new file mode 100644 index 0000000..569e029 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.cpp @@ -0,0 +1,320 @@ +// CaptureDataDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "CaptureDataDlg.h" +#include "afxdialogex.h" +#include "..\..\..\MicroVu\Mv_Proto.h" + +extern CMv_Proto *m_pMv_Proto; + +// CCaptureDataDlg dialog + +IMPLEMENT_DYNAMIC(CCaptureDataDlg, CDialogEx) + +CCaptureDataDlg::CCaptureDataDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CCaptureDataDlg::IDD, pParent) +{ + +} + +CCaptureDataDlg::~CCaptureDataDlg() +{ +} + +void CCaptureDataDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CCaptureDataDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_UPDATE_CONFIG, &CCaptureDataDlg::OnBnClickedButtonUpdateConfig) + ON_BN_CLICKED(IDC_BUTTON_BROWSE_LOG, &CCaptureDataDlg::OnBnClickedButtonBrowseLog) + ON_BN_CLICKED(IDC_BUTTON_GET_MV_CONFIG, &CCaptureDataDlg::OnBnClickedButtonGetMvConfig) + ON_BN_CLICKED(IDC_RADIO_CREATE_MV_CONFIG, &CCaptureDataDlg::OnBnClickedRadioCreateMvConfig) + ON_BN_CLICKED(IDC_RADIO_UPDATE_MV_CONFIG, &CCaptureDataDlg::OnBnClickedRadioUpdateMvConfig) +END_MESSAGE_MAP() + +//============================================================================= +// CCaptureDataDlg message handlers +//============================================================================= +void CCaptureDataDlg::OnBnClickedButtonUpdateConfig() +{ + char inBuff[MAX_LINE_LEN]; + FILE* pOutFile; + FILE* pMvFile; + FILE* pExtractLogFile; + + memset(_str_7000, 0, MAX_SHORT_LEN); + memset(_str_6f00, 0, MAX_SHORT_LEN); + memset(_str_4c02, 0, MAX_SHORT_LEN); + + //================================================================================== + // Create condensed file first. + //================================================================================== + CMv_Proto_Dump* mv_proto_dump = new CMv_Proto_Dump; + int retStatus = mv_proto_dump->MainSnoopyFunction(m_SnoopyLogFile, OUT_CONDENSED, MACHINE_MICROVU); + delete mv_proto_dump; + if (retStatus == -1) + { + m_status_msg += _T("\r\nError: SnoopyLog not found or unable to create condensed file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; + } + m_proto_filename = m_SnoopyLogFile + _T(".condensed.proto.txt"); + m_status_msg = _T("\r\nStatus : Extract file created. - ") + m_proto_filename; + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + + //================================================================================== + // Extract 7000/6f00/4c02 from the condensed files. + //================================================================================== + _wfopen_s(&pExtractLogFile, m_proto_filename, _T("r")); // open the condensed file + fgets((char *)inBuff, MAX_LINE_LEN, pExtractLogFile ); // pick up the first line + while (!feof(pExtractLogFile)) + { + if (inBuff[0] != '>') + { + // dummy + } + else + if (!_strnicmp(inBuff+30, _6000_BUFF, 7)) + { + // convert the ascii text into wchar_t code. + memset(_c_str_model, 0, MAX_SHORT_LEN*2); + memset(_c_str_serial_no, 0, MAX_SHORT_LEN*2); + memset(_str_model, 0, MAX_SHORT_LEN*2); + memset(_str_serial_no, 0, MAX_SHORT_LEN*2); + for (int i = 0; i<16; ++i) + { + _c_str_serial_no[i] = (unsigned char) (*(inBuff+37+i*2) - '0'); + _c_str_serial_no[i] = (_c_str_serial_no[i] << 4) + (unsigned char) (*(inBuff+37+i*2+1) - '0'); + _c_str_model[i] = (unsigned char) (*(inBuff+101+i*2) - '0'); + _c_str_model[i] = (_c_str_model[i] << 4 ) + (unsigned char) (*(inBuff+101+i*2+1) - '0'); + }; + wcstombs(_str_serial_no, _wc_str_serial_no, 16); + wcstombs(_str_model, _wc_str_model, 16); + strcpy(_str_SerialNo, _STR_SerialNo_Label); + strcat(_str_SerialNo, _str_serial_no); + int i = (int) strlen(_str_SerialNo); + _str_SerialNo[i] = 0x0a; + _str_SerialNo[i+1] = 0; + strcpy(_str_Model, _STR_Model_Label); + strcat(_str_Model, _str_model); + i = (int) strlen(_str_Model); + _str_Model[i] = 0x0a; + _str_Model[i+1] = 0; + } + else + if (!(inBuff[40] == '1' && inBuff[41] == '0')) + { + } + else + if (!_strnicmp(inBuff+35, _7000_BUFF, 4)) + { + strcpy(_str_7000, _STR_7000_Label); + strcat(_str_7000, inBuff+35); + strcpy(m_pMv_Proto->g_machine.s_machine_config._str_7000_signature, inBuff+35); + } + else + if (!_strnicmp(inBuff+35, _6f00_BUFF, 4)) + { + strcpy(_str_6f00, _STR_6f00_Label); + strcat(_str_6f00, inBuff+35); + strcpy(m_pMv_Proto->g_machine.s_machine_config._str_6f00_signature, inBuff+35); + } + fgets((char *)inBuff, MAX_LINE_LEN, pExtractLogFile ); // pick up the first line + }; + fclose(pExtractLogFile); + + //================================================================================== + // Create a new mv_config file. + //================================================================================== + if (((CButton *)GetDlgItem(IDC_RADIO_CREATE_MV_CONFIG))->GetCheck()) + { + m_status_msg += _T("\r\nStatus : Creating new mv_config file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + MvConfigNew(); + return; + }; + + //================================================================================== + // Create the temp_mv_config_file from old mv_config. + //================================================================================== + _wfopen_s(&pMvFile, m_mv_config_full_path_name, _T("r")); // open the condensed file + + if (pMvFile == NULL) + { + m_status_msg += _T("\r\nUnable to open mv_config file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; + }; + + CString _temp_name = m_AppPath + _T("\\") + m_temp_mv_config_filename + _T(".") + _wc_str_serial_no + _T(".cfg"); + _wfopen_s(&pOutFile, _temp_name, _T("w")); // open the condensed file + if (pOutFile == NULL) + { + m_status_msg += _T("\r\nUnable to create temp_mv_config file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; + }; + fputs(_str_SerialNo, pOutFile); + fputs(_str_Model, pOutFile); + fputs(_str_7000, pOutFile); + fputs(_str_6f00, pOutFile); +// fputs(_str_4c02, pOutFile); + + fgets((char *)inBuff, MAX_LINE_LEN, pMvFile ); // pick up the first line + while (!feof(pMvFile)) + { + if (!_strnicmp(inBuff, _STR_7000_Label, 9) || + !_strnicmp(inBuff, _STR_6f00_Label, 9) || +// !_strnicmp(inBuff, _STR_4c02_Label, 9) || + !_strnicmp(inBuff, _STR_SerialNo_Label, 9) || + !_strnicmp(inBuff, _STR_Model_Label, 6)) + { + } + else + { + fputs(inBuff, pOutFile); + }; + fgets((char *)inBuff, MAX_LINE_LEN, pMvFile ); // pick up the first line + }; + + fclose(pMvFile); + fclose(pOutFile); + m_status_msg += _T("\r\nStatus : temp_mv_config created - \r\n ") + _temp_name; + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; +} + +//======================================================================= +// Defaults to c:\Windows\usbsnoop.log +// Use File Dialog to point to the log file. +// This file must exist. +void CCaptureDataDlg::OnBnClickedButtonBrowseLog() +{ + CString strFilters = _T("All Files (*.*)|*.*||"); + CString strExt = _T("log"); + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) m_SnoopyLogFile, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, strFilters, this); + FILE* pLogFile; + INT_PTR nResult; + while (true) { + nResult = fileDlg.DoModal(); + if (nResult == IDOK) + { + m_SnoopyLogFile = fileDlg.GetPathName(); + _wfopen_s(&pLogFile, m_SnoopyLogFile, _T("r")); // see if we can read the file. + if (pLogFile == NULL) + { + m_status_msg += _T("\r\n Snoopy Input File not found."); + MessageBox( _T("UsbSnoop.log not found."), _T("Message"), MB_OK); + continue; + } + else + { + ((CEdit *)GetDlgItem(IDC_EDIT_SNOOP_LOG_FILE))->SetWindowText(m_SnoopyLogFile); + fclose(pLogFile); + break; + } + } + else + return; + } +} + +//======================================================================= +// Defaults to the current directory with a file called mv_config.cfg. +// This file may not exist. +void CCaptureDataDlg::OnBnClickedButtonGetMvConfig() +{ + CString strFilters = _T("All Files (*.*)|*.*||"); + CString strExt = _T("cfg"); + CString csMvFile = _T("mv_config.cfg"); + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) csMvFile, OFN_HIDEREADONLY, strFilters, this); + FILE* pMvFile; + INT_PTR nResult; + while (true) { + nResult = fileDlg.DoModal(); + if (nResult == IDOK) + { + csMvFile = fileDlg.GetPathName(); + _wfopen_s(&pMvFile, csMvFile, _T("r")); // see if we can read the file. + if (pMvFile == NULL) + { + m_status_msg += _T("\r\nmv_config.cfg file not found. Creating a new temp_mv_config.cfg without mv_config.cfg file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + break; + } + else + { + m_mv_config_full_path_name = csMvFile; + fclose(pMvFile); + break; + } + } + else + return; + } +} + +//=========================================================================== +BOOL CCaptureDataDlg::OnInitDialog() +{ + m_status_msg = _T("System Ready."); + m_SnoopyLogFile = _T("C:\\Windows\\usbsnoop.log"); + m_mv_config_filename = _T("mv_config.cfg"); + m_temp_mv_config_filename = _T("temp_mv_config"); + m_pMv_Proto->GetAppPath(m_AppPath); + ((CEdit *)GetDlgItem(IDC_EDIT_SNOOP_LOG_FILE))->SetWindowText(m_SnoopyLogFile); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + ((CButton *)GetDlgItem(IDC_RADIO_CREATE_MV_CONFIG))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_UPDATE_MV_CONFIG))->SetCheck(1); + CString strAppPath; + m_pMv_Proto->GetAppPath(strAppPath); + m_mv_config_full_path_name = strAppPath + _T("\\") + m_mv_config_filename; + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->EnableWindow(true); + ((CEdit *)GetDlgItem(IDC_EDIT_MV_CONFIG_FILE))->SetWindowText(m_mv_config_full_path_name); + + return TRUE; +}; + +//=========================================================================== +void CCaptureDataDlg::MvConfigNew() +{ + CString fn; + ((CEdit *)GetDlgItem(IDC_EDIT_SNOOP_LOG_FILE))->GetWindowText(fn); + + FILE* pOutFile; + CString _temp_name = m_AppPath + _T("\\") + m_temp_mv_config_filename + _T(".") + _wc_str_serial_no + _T(".cfg"); + _wfopen_s(&pOutFile, _temp_name, _T("w")); // open the condensed file + if (pOutFile == NULL) + { + m_status_msg += _T("\r\nStatus : Unable to create temp_mv_config file."); + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; + }; + fputs(_str_SerialNo, pOutFile); + fputs(_str_Model, pOutFile); + fputs(_str_7000, pOutFile); + fputs(_str_6f00, pOutFile); + fputs(_str_4c02, pOutFile); + fclose(pOutFile); + m_status_msg += _T("\r\nTemp_mv_config created - \r\n ") + _temp_name; + ((CEdit *)GetDlgItem(IDC_EDIT_STATUS_WINDOW))->SetWindowText(m_status_msg); + return; +} + +//=========================================================================== +void CCaptureDataDlg::OnBnClickedRadioCreateMvConfig() +{ + ((CEdit *)GetDlgItem(IDC_EDIT_MV_CONFIG_FILE))->EnableWindow(false); + ((CEdit *)GetDlgItem(IDC_BUTTON_GET_MV_CONFIG))->EnableWindow(false); +} + +//=========================================================================== +void CCaptureDataDlg::OnBnClickedRadioUpdateMvConfig() +{ + ((CEdit *)GetDlgItem(IDC_EDIT_MV_CONFIG_FILE))->EnableWindow(true); + ((CEdit *)GetDlgItem(IDC_BUTTON_GET_MV_CONFIG))->EnableWindow(true); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.h new file mode 100644 index 0000000..3ffc8ab --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/CaptureDataDlg.h @@ -0,0 +1,69 @@ +#pragma once +#include "afxwin.h" +#include "Mv_Proto_Dump.H" + +#define MAX_LINE_LEN 512 +#define MAX_SHORT_LEN 128 + +#define _STR_7000_Label "STR_7000=" +#define _STR_6f00_Label "STR_6f00=" +#define _STR_4c02_Label "STR_4c02=" +#define _STR_SerialNo_Label "SerialNo=" +#define _STR_Model_Label "Model=" + // +#define _6000_BUFF "7e : 60" +#define _7000_BUFF "7000" +#define _6f00_BUFF "6f00" +#define _4c02_BUFF "4c02" + +// CCaptureDataDlg dialog + +class CCaptureDataDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CCaptureDataDlg) + +public: + CCaptureDataDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CCaptureDataDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_UPDATE_MV_CONFIG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedButtonUpdateConfig(); + afx_msg void OnBnClickedButtonBrowseLog(); + afx_msg void OnBnClickedButtonGetMvConfig(); + CString m_status_msg; + CString m_SnoopyLogFile; + CString m_mv_config_full_path_name; + CString m_mv_config_filename; + CString m_temp_mv_config_filename; + CString m_proto_filename; + CString m_AppPath; + CMv_Proto_Dump* mv_proto_dump; + + union { + wchar_t _wc_str_serial_no[MAX_SHORT_LEN]; + char _c_str_serial_no[MAX_SHORT_LEN*2]; + }; + char _str_serial_no[MAX_SHORT_LEN*2]; + union { + wchar_t _wc_str_model[MAX_SHORT_LEN]; + char _c_str_model[MAX_SHORT_LEN*2]; + }; + char _str_model[MAX_SHORT_LEN*2]; + + void MvConfigNew(); + afx_msg void OnBnClickedRadioCreateMvConfig(); + afx_msg void OnBnClickedRadioUpdateMvConfig(); + + char _str_SerialNo[MAX_SHORT_LEN]; + char _str_Model[MAX_SHORT_LEN]; + char _str_7000[MAX_SHORT_LEN]; + char _str_6f00[MAX_SHORT_LEN]; + char _str_4c02[MAX_SHORT_LEN]; +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram1.cd b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram1.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram1.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram11.cd b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram11.cd new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ClassDiagram11.cd @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.cpp new file mode 100644 index 0000000..edbe462 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.cpp @@ -0,0 +1,126 @@ +/////////////////////////////////////////////////////////////////////////// +// DirDialog.cpp: implementation of the CDirDialog class. +// +////////////////////////////////////////////////////////////////////// + +#include "stdafx.h" +#include "DirDialog.h" +#include "shlobj.h" + + + +#ifdef _DEBUG +#undef THIS_FILE +static char THIS_FILE[]=__FILE__; +#define new DEBUG_NEW +#endif + +// Callback function called by SHBrowseForFolder's browse control +// after initialization and when selection changes +static int __stdcall BrowseCtrlCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData) +{ + UNREFERENCED_PARAMETER(lParam); + CDirDialog* pDirDialogObj = (CDirDialog*)lpData; + + if (uMsg == BFFM_INITIALIZED && !pDirDialogObj->m_strSelDir.IsEmpty()) + { + ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(LPCTSTR)(pDirDialogObj->m_strSelDir)); + } + else // uMsg == BFFM_SELCHANGED + { + } + + return 0; +} + +////////////////////////////////////////////////////////////////////// +// Construction/Destruction +////////////////////////////////////////////////////////////////////// + +CDirDialog::CDirDialog() +{ +} + +CDirDialog::~CDirDialog() +{ +} + +//=========================================================================== +int CDirDialog::DoBrowse() +{ + LPMALLOC pMalloc; + if (SHGetMalloc (&pMalloc)!= NOERROR) + { + return 0; + } + + BROWSEINFO bInfo; + LPITEMIDLIST pidl; + ZeroMemory ( (PVOID) &bInfo,sizeof (BROWSEINFO)); + + if (!m_strInitDir.IsEmpty ()) + { + OLECHAR olePath[MAX_PATH]; + ULONG chEaten; + ULONG dwAttributes; + HRESULT hr; + LPSHELLFOLDER pDesktopFolder; + // + // Get a pointer to the Desktop's IShellFolder interface. + // + if (SUCCEEDED(SHGetDesktopFolder(&pDesktopFolder))) + { + // + // IShellFolder::ParseDisplayName requires the file name be in Unicode. + // + MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCSTR) m_strInitDir.GetBuffer(MAX_PATH), -1, + olePath, MAX_PATH); + + m_strInitDir.ReleaseBuffer (-1); + // + // Convert the path to an ITEMIDLIST. + // + hr = pDesktopFolder->ParseDisplayName(NULL, + NULL, + olePath, + &chEaten, + &pidl, + &dwAttributes); + if (FAILED(hr)) + { + pMalloc ->Free (pidl); + pMalloc ->Release (); + return 0; + } + bInfo.pidlRoot = pidl; + + } + } + bInfo.hwndOwner = NULL; + bInfo.pszDisplayName = m_strPath.GetBuffer (MAX_PATH); + bInfo.lpszTitle = (m_strTitle.IsEmpty()) ? _T("Open"):m_strTitle; + bInfo.ulFlags = BIF_RETURNFSANCESTORS|BIF_RETURNONLYFSDIRS; + bInfo.lpfn = BrowseCtrlCallback; // address of callback function + bInfo.lParam = (LPARAM)this; // pass address of object to callback function + + if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL) + { + return 0; + } + m_strPath.ReleaseBuffer(); + m_iImageIndex = bInfo.iImage; + + if (::SHGetPathFromIDList(pidl,m_strPath.GetBuffer(MAX_PATH)) == FALSE) + { + pMalloc ->Free(pidl); + pMalloc ->Release(); + return 0; + } + + m_strPath.ReleaseBuffer(); + + pMalloc ->Free(pidl); + pMalloc ->Release(); + + return 1; +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.h new file mode 100644 index 0000000..70760b4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DirDialog.h @@ -0,0 +1,29 @@ +//////////////////////////////////////////////////////////////////////// +// DirDialog.h: interface for the CDirDialog class. +// +////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_DIRDIALOG_H__62FFAC92_1DEE_11D1_B87A_0060979CDF6D__INCLUDED_) +#define AFX_DIRDIALOG_H__62FFAC92_1DEE_11D1_B87A_0060979CDF6D__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +class CDirDialog +{ + public: + CDirDialog(); + virtual ~CDirDialog(); + int DoBrowse(); + + CString m_strPath; + CString m_strInitDir; + CString m_strSelDir; + CString m_strTitle; + int m_iImageIndex; +}; + +#endif // !defined(AFX_DIRDIALOG_H__62FFAC92_1DEE_11D1_B87A_0060979CDF6D__INCLUDED_) + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.cpp new file mode 100644 index 0000000..84ecf11 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.cpp @@ -0,0 +1,366 @@ +// GraphView.cpp : ʵļ +// + +#include "stdafx.h" +#include "DrawGraph.h" + + +// CDrawGraph + +IMPLEMENT_DYNAMIC(CDrawGraph, CWnd) +//======================================================== +CDrawGraph::CDrawGraph() +{ + //עؼ + RegisterCtrlClass(); + + m_nMarginLeft = 40; + m_nMarginTop = 15; + m_nMarginRight = 15; + m_nMarginBottom = 30; + + m_dbResolutionX = 1; + m_dbResolutionY = 1; + m_nDivisionX = 10; + m_nDivisionY = 10; + + m_dbStartX = m_dbStartY = 0; + m_dbEndX = m_dbEndY = 100; + + //ɫ + m_clrCoordBkg = RGB(255, 255, 255); + m_clrFrame = RGB(0, 0, 0); + m_clrWave = RGB(0, 0, 255); +} +//======================================================== +CDrawGraph::~CDrawGraph() +{ +} +//======================================================== +void CDrawGraph::RegisterCtrlClass() +{ + HINSTANCE hInstance = AfxGetInstanceHandle(); + + WNDCLASS wndclsCtrl; + ZeroMemory(&wndclsCtrl, sizeof(WNDCLASS)); + + if(::GetClassInfo(hInstance, STR_CLASS_NAME, &wndclsCtrl)) + return; + + //ÿؼϢ + wndclsCtrl.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + wndclsCtrl.lpfnWndProc = ::DefWindowProc; + wndclsCtrl.cbClsExtra = 0; + wndclsCtrl.cbWndExtra = 0; + wndclsCtrl.hInstance = hInstance; + wndclsCtrl.hIcon = NULL; + wndclsCtrl.hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW); + wndclsCtrl.hbrBackground = NULL; + wndclsCtrl.lpszMenuName = NULL; + wndclsCtrl.lpszClassName = STR_CLASS_NAME; + + //עؼ + AfxRegisterClass(&wndclsCtrl); +} +//======================================================== +void CDrawGraph::SetViewFont(const CString& strFont, int nPointSize, int nWeight, BOOL bIsRedraw) +{ + int nCount; + LOGFONT lf; + memset(&lf, 0, sizeof(LOGFONT)); + + //ʽ + nCount = sizeof(lf.lfFaceName)/sizeof(TCHAR); + COPYSTRING(lf.lfFaceName, nCount, strFont); + lf.lfHeight = nPointSize; + lf.lfWeight = nWeight; + lf.lfCharSet = GB2312_CHARSET; + + //ʽ + if(m_fontView.GetSafeHandle()) + m_fontView.DeleteObject(); + + // + m_fontView.CreateFontIndirect(&lf); + + if(bIsRedraw) + Invalidate(); +} +//======================================================== +void CDrawGraph::SetMargin(int nLeft, int nTop, int nRight, int nBottom, BOOL bIsRedraw) +{ + m_nMarginLeft = nLeft; + m_nMarginTop = nTop; + m_nMarginRight = nRight; + m_nMarginBottom = nBottom; + + if(bIsRedraw) + Invalidate(); +} +//======================================================== +bool CDrawGraph::SetGraphyView(double dbStartX, double dbEndX, double dbStartY, double dbEndY, int nDivisionX, int nDivisionY, BOOL bIsRedraw) +{ + if(nDivisionX<=1||nDivisionY<=1) + return false; + + m_dbStartX = dbStartX; + m_dbEndX = dbEndX; + m_dbStartY = dbStartY; + m_dbEndY = dbEndY; + m_nDivisionX = nDivisionX; + m_nDivisionY = nDivisionY; + + if(bIsRedraw) + Invalidate(); + + return true; +} +//======================================================== +void CDrawGraph::SetResolution(double dbResolutionX, double dbResolutionY, BOOL bIsRedraw) +{ + m_dbResolutionX = dbResolutionX; + m_dbResolutionY = dbResolutionY; + + if(bIsRedraw) + Invalidate(); +} +//======================================================== +void CDrawGraph::LoadGraphyData(DataBuff& dataShow) +{ + double dbData; + INT_PTR nCount = dataShow.GetCount(); + + if(nCount==0) + return; + + m_dataGraph.RemoveAll(); + m_dataGraph.SetSize(nCount); + for(int i=0; iFillSolidRect(rectCoord, m_clrCoordBkg); + nOffset = 2; + for(i=0; i<=m_nDivisionX; i++) + { + dbTemp = dbTempStartX+dbRangX*i/m_nDivisionX; + strCoord.Format(_T("%g"), dbTemp); + + nSection = rectCoord.Width()*i/m_nDivisionX; + szText = pDC->GetTextExtent(strCoord, strCoord.GetLength()); + + rectTemp.SetRect(rectCoord.left+nSection-szText.cx/2, rectCoord.bottom+nOffset, rectCoord.left+nSection+szText.cx/2, rectCoord.bottom+szText.cy+nOffset); + pDC->MoveTo(rectCoord.left+nSection, rectCoord.top); + pDC->LineTo(rectCoord.left+nSection, rectCoord.bottom); + pDC->DrawText(strCoord, strCoord.GetLength(), rectTemp, DT_CENTER); + } + + nOffset = 2; + for(i=0; i<=m_nDivisionY; i++) + { + dbTemp = dbTempStartY+dbRangY*i/m_nDivisionY; + strCoord.Format(_T("%g"), dbTemp); + + nSection = rectCoord.Height()*i/m_nDivisionY; + szText = pDC->GetTextExtent(strCoord, strCoord.GetLength()); + + rectTemp.SetRect(rectCoord.left-szText.cx-nOffset, rectCoord.bottom-nSection-szText.cy*2/3, rectCoord.left-nOffset, rectCoord.bottom-nSection+szText.cy/3); + pDC->MoveTo(rectCoord.left, rectCoord.top+nSection); + pDC->LineTo(rectCoord.right+1, rectCoord.top+nSection); + pDC->DrawText(strCoord, strCoord.GetLength(), rectTemp, DT_CENTER); + } + LOGFONT lf; + ::ZeroMemory (&lf, sizeof (lf)); + //lf.lfHeight = 160; + //lf.lfWeight = FW_BOLD; + lf.lfEscapement = 900; + lf.lfOrientation = 900; + + CFont font; + font.CreatePointFontIndirect (&lf); + + CFont* pOldFont = pDC->SelectObject (&font); + pDC->TextOut(rectCoord.left-40,rectCoord.top+(rectCoord.Height()/2)+30,_T("ٶ(mm/s)"));//ת90 + pDC->SelectObject (pOldFont); + pDC->TextOut(rectCoord.left-20+(rectCoord.Width()/2),rectCoord.bottom+15,_T("ʱ(s)")); + + nOffset = 4; + rectTemp.SetRect(rectCoord.left+nOffset, rectCoord.top+1, rectCoord.right, rectCoord.bottom-nOffset); + pDC->FillSolidRect(rectTemp, m_clrCoordBkg); +} +//======================================================== +void CDrawGraph::DrawActualCurve(CDC *pDC, CRect rectCoord) +{ + CRect rectView; + CRgn rgnTemp, rgnView; + CPen penLine, *pOldPen; + INT_PTR nCount = m_dataGraph.GetCount(); + + if(nCount==0) + return; + + double dbData(0.0); + int nOffsetX(0), nOffsetY(0),nOriginX(0),nOriginY(0); + dbData = m_dataGraph.ElementAt(0); + nOriginX = rectCoord.left; + nOriginY = rectCoord.bottom;; + nOffsetX = static_cast(m_dbResolutionX*(rectCoord.Width())); + nOffsetY = static_cast(m_dbResolutionY*(rectCoord.Height())*dbData); + + rgnTemp.CreateRectRgnIndirect(rectCoord); + pDC->SelectObject(rgnTemp); + penLine.CreatePen(PS_SOLID, 1, m_clrWave); + pOldPen = pDC->SelectObject(&penLine); + + + pDC->MoveTo(nOriginX, nOriginY-nOffsetY); + + for(int i=1; i(m_dbResolutionY*(rectCoord.Height())*dbData); + + pDC->LineTo(nOriginX+nOffsetX*i, nOriginY-nOffsetY); + } + pDC->SelectObject(pOldPen); + GetClientRect(rectView); + rgnView.CreateRectRgnIndirect(rectView); + pDC->SelectObject(rgnView); +} +//======================================================== +void CDrawGraph::DrawIdealCurve(CDC *pDC, CRect rectCoord) +{ + CRect rectView; + CRgn rgnTemp, rgnView; + CPen penLine, *pOldPen; + INT_PTR nCount = m_dataGraph.GetCount(); + + if(nCount==0) + return; + + double dbData; + int nOffsetX, nOffsetY; + int nRangX = abs(int((m_dbEndX-m_dbStartX)*m_dbResolutionX)), + nRangY = abs(int((m_dbEndY-m_dbStartY)*m_dbResolutionY)); + int nCoordWith = rectCoord.Width(), + nCoordHeight = rectCoord.Height(), + nOriginX = rectCoord.left-int(m_dbStartX*nCoordWith/nRangX), + nOriginY = rectCoord.bottom+int(m_dbStartY*nCoordHeight/nRangY); + + + rgnTemp.CreateRectRgnIndirect(rectCoord); + pDC->SelectObject(rgnTemp); + penLine.CreatePen(PS_SOLID, 1, m_clrWave); + pOldPen = pDC->SelectObject(&penLine); + + dbData = m_dataGraph.ElementAt(0); + nOffsetY = int(nCoordHeight*dbData/nRangY); + pDC->MoveTo(nOriginX, nOriginY-nOffsetY); + + for(int i=1; iLineTo(nOriginX+nOffsetX, nOriginY-nOffsetY); + } + pDC->SelectObject(pOldPen); + GetClientRect(rectView); + rgnView.CreateRectRgnIndirect(rectView); + pDC->SelectObject(rgnView); +} +//======================================================== +BEGIN_MESSAGE_MAP(CDrawGraph, CWnd) + ON_WM_PAINT() + ON_WM_ERASEBKGND() +END_MESSAGE_MAP() + +// CDrawGraph Ϣ +//======================================================== +void CDrawGraph::PreSubclassWindow() +{ + CWnd::PreSubclassWindow(); + + SetViewFont(_T(""), 12, FW_NORMAL); +} +//======================================================== +void CDrawGraph::OnPaint() +{ + CPaintDC dc(this); + int nMode; + CRect rectClient, rectCoord, rectInfo, rectTemp; + CString strCaption, strOutputInfo; + CBitmap bitmapTemp, *pOldBitmap; + CFont* pOldFont; + CDC* pMemDC = new CDC; + + //ȡؼϢ + GetClientRect(rectClient); + GetWindowText(strCaption); + + //λͼڴ + bitmapTemp.CreateCompatibleBitmap(&dc, rectClient.Width(), rectClient.Height()); + pMemDC->CreateCompatibleDC(&dc); + pOldBitmap = pMemDC->SelectObject(&bitmapTemp); + pOldFont = pMemDC->SelectObject(&m_fontView); + nMode = pMemDC->SetBkMode(TRANSPARENT); + + //ͻ + pMemDC->FillSolidRect(&rectClient, GetSysColor(COLOR_BTNFACE)); + //ͼ + pMemDC->DrawText(strCaption, strCaption.GetLength(), rectClient, DT_CENTER); + // + rectCoord.SetRect(rectClient.left+m_nMarginLeft, rectClient.top+m_nMarginTop, rectClient.right-m_nMarginRight, rectClient.bottom-m_nMarginBottom); + DrawCoordinate(pMemDC, rectCoord); + //Ʋ + DrawActualCurve(pMemDC, rectCoord); + + dc.BitBlt(0, 0, rectClient.Width(), rectClient.Height(), pMemDC, 0, 0, SRCCOPY); + + pMemDC->SetBkMode(nMode); + pMemDC->SelectObject(pOldFont); + pMemDC->SelectObject(pOldBitmap); + ReleaseDC(pMemDC); + delete pMemDC; +} + +//================================================================================================ +BOOL CDrawGraph::OnEraseBkgnd(CDC* pDC) +{ + //UNREFERENCED_PARAMETER(pDC); + //return TRUE; + return CWnd::OnEraseBkgnd(pDC); +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.h new file mode 100644 index 0000000..c0fd9f4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/DrawGraph.h @@ -0,0 +1,50 @@ +#pragma once + +#ifdef UNICODE +#define COPYSTRING wcscpy_s +#else +#define COPYSTRING strcpy_s +#endif + +#define STR_CLASS_NAME _T("CDrawGraph") + +typedef CArray DataBuff; +// CDrawGraph + +class CDrawGraph : public CWnd +{ + DECLARE_DYNAMIC(CDrawGraph) + + CFont m_fontView; + COLORREF m_clrCoordBkg,m_clrFrame,m_clrWave; + int m_nMarginLeft,m_nMarginTop,m_nMarginRight,m_nMarginBottom; + double m_dbStartX, m_dbEndX,m_dbStartY,m_dbEndY; + double m_dbResolutionX,m_dbResolutionY; + int m_nDivisionX,m_nDivisionY; + DataBuff m_dataGraph; + +public: + CDrawGraph(); + virtual ~CDrawGraph(); + + void RegisterCtrlClass(); + void SetViewFont(const CString& strFont, int nPointSize, int nWeight, BOOL bIsRedraw=TRUE); + void SetMargin(int nLeft, int nTop, int nRight, int nBottom, BOOL bIsRedraw=TRUE); + bool SetGraphyView(double dbStartX, double dbEndX, double dbStartY, double dbEndY, int nDivisionX = 10, int nDivisionY = 10, BOOL bIsRedraw=TRUE); + void SetResolution(double dbResolutionX, double dbResolutionY, BOOL bIsRedraw=TRUE); + void LoadGraphyData(DataBuff& dataShow); + void AddGraphyData(double _data); + void RemoveGraphyData(BOOL bIsRedraw=TRUE); + void DrawCoordinate(CDC* pDC, CRect rectCoord); + void DrawIdealCurve(CDC* pDC, CRect rectCoord); + void DrawActualCurve(CDC* pDC, CRect rectCoord); + +protected: + virtual void PreSubclassWindow(); + +public: + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + afx_msg void OnPaint(); + + DECLARE_MESSAGE_MAP() +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.cpp new file mode 100644 index 0000000..c2b40e3 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.cpp @@ -0,0 +1,147 @@ +// FileUtilitiesDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "Mv_File_Utilities.h" +#include "FileUtilitiesDlg.h" +#include "afxdialogex.h" + +// CFileUtilitiesDlg dialog + +IMPLEMENT_DYNAMIC(CFileUtilitiesDlg, CDialogEx) + +CFileUtilitiesDlg::CFileUtilitiesDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CFileUtilitiesDlg::IDD, pParent) +{ + +} + +CFileUtilitiesDlg::~CFileUtilitiesDlg() +{ +} + +void CFileUtilitiesDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CFileUtilitiesDlg, CDialogEx) + ON_BN_CLICKED(IDOK, &CFileUtilitiesDlg::OnBnClickedOk) + ON_BN_CLICKED(IDC_BUTTON_BROWSE, &CFileUtilitiesDlg::OnBnClickedButtonBrowse) + ON_BN_CLICKED(IDCANCEL, &CFileUtilitiesDlg::OnBnClickedCancel) + ON_BN_CLICKED(IDC_RADIO_EXTRACT, &CFileUtilitiesDlg::OnBnClickedRadioExtract) + ON_BN_CLICKED(IDC_RADIO_DUMP_BINARY, &CFileUtilitiesDlg::OnBnClickedRadioDumpBinary) + ON_BN_CLICKED(IDC_RADIO_HEX_ASCII2BIN, &CFileUtilitiesDlg::OnBnClickedRadioHexAscii2bin) + ON_BN_CLICKED(IDC_RADIO_DEDUPE, &CFileUtilitiesDlg::OnBnClickedRadioDedupe) +END_MESSAGE_MAP() + + +//============================================================================== +void CFileUtilitiesDlg::OnBnClickedOk() +{ + char _criteria[256]; + CString _extractString; + CMv_File_Utilities *m_FileUtilities = new CMv_File_Utilities(); + if (((CButton *)GetDlgItem(IDC_RADIO_HEX_BIN2ASCII))->GetCheck()) + { + m_FileUtilities->BinToHexAscii(&m_csInputFile); + } + else + if (((CButton *)GetDlgItem(IDC_RADIO_DEDUPE))->GetCheck()) + { + m_FileUtilities->DedupeFunction(&m_csInputFile); + } + else + if (((CButton *)GetDlgItem(IDC_RADIO_HEX_ASCII2BIN))->GetCheck()) + { + } + else + if (((CButton *)GetDlgItem(IDC_RADIO_DUMP_BINARY))->GetCheck()) + { + } + else + if (((CButton *)GetDlgItem(IDC_RADIO_EXTRACT))->GetCheck()) + { + GetDlgItem(IDC_EDIT_CRITERIA)->GetWindowText(_extractString); + if (_extractString.GetLength() == 0) + { + strcpy(_criteria, "Poll"); +// MessageBox(_T("Null Crtieria, operation exit."), _T("Warning Message"), MB_OK); + } + else + { + size_t sConverted; + wcstombs_s(&sConverted, _criteria, _extractString.GetLength()+1, _extractString, _TRUNCATE); + }; + m_FileUtilities->ExtractCommand(&m_csInputFile, (char *)_criteria, ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->GetCheck()); + }; + MessageBox(_T("Done."), _T("Message"), MB_OK); + delete m_FileUtilities; + m_FileUtilities=nullptr; +// CDialogEx::OnOK(); +} + +//============================================================================== +void CFileUtilitiesDlg::OnBnClickedButtonBrowse() +{ + CString strFilters; + CString strExt; + strFilters = _T("All Files (*.*)|*.*||"); + strExt = _T("*"); + CString m_csLogFile = _T(""); + CString strMsg; + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) m_csLogFile, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, strFilters, this); + if ( fileDlg.DoModal ()==IDOK ) + { + m_csInputFile = fileDlg.GetPathName(); + GetDlgItem(IDC_EDIT_INPUT_FILE)->SetWindowText(m_csInputFile); + }; +} + +//============================================================================== +//=========================================================================== +BOOL CFileUtilitiesDlg::OnInitDialog() +{ + ((CButton *)GetDlgItem(IDC_RADIO_DEDUPE))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_HEX_ASCII2BIN))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_DUMP_BINARY))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_EXTRACT))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_EDIT_CRITERIA))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->EnableWindow(false); + return TRUE; +}; + +void CFileUtilitiesDlg::OnBnClickedCancel() +{ + CDialogEx::OnCancel(); +} + + +void CFileUtilitiesDlg::OnBnClickedRadioExtract() +{ + ((CButton *)GetDlgItem(IDC_EDIT_CRITERIA))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->EnableWindow(true); +} + + +void CFileUtilitiesDlg::OnBnClickedRadioDumpBinary() +{ + ((CButton *)GetDlgItem(IDC_EDIT_CRITERIA))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->EnableWindow(false); +} + + +void CFileUtilitiesDlg::OnBnClickedRadioHexAscii2bin() +{ + ((CButton *)GetDlgItem(IDC_EDIT_CRITERIA))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->EnableWindow(false); +} + + +void CFileUtilitiesDlg::OnBnClickedRadioDedupe() +{ + ((CButton *)GetDlgItem(IDC_EDIT_CRITERIA))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_CHECK_NEGATE))->EnableWindow(false); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.h new file mode 100644 index 0000000..c7b101a --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/FileUtilitiesDlg.h @@ -0,0 +1,32 @@ +#pragma once +#include "Mv_File_Utilities.h" + +// CFileUtilitiesDlg dialog + +class CFileUtilitiesDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CFileUtilitiesDlg) + +public: + CFileUtilitiesDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CFileUtilitiesDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_FILE_UTILITIES }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedButtonBrowse(); + virtual BOOL OnInitDialog(); + CMv_File_Utilities* m_FileUtilities; + CString m_csInputFile; + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedRadioExtract(); + afx_msg void OnBnClickedRadioDumpBinary(); + afx_msg void OnBnClickedRadioHexAscii2bin(); + afx_msg void OnBnClickedRadioDedupe(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.cpp new file mode 100644 index 0000000..02141fe --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.cpp @@ -0,0 +1,304 @@ +// Keyence_UtilDlg.cpp : ʵļ +// + +#include "stdafx.h" +#include "resource.h" +#include "afxdialogex.h" +#include "..\..\..\Keyence\Keyence_Laser.h" +#include "..\..\..\Keyence\\Keyence_Proto.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "Keyence_UtilDlg.h" +extern CSO7_Proto* m_pSO7_Proto; +extern CKeyence_Laser* m_pKeyence_Laser; +extern CKeyence_Proto* m_pKeyence_Proto; + +#define MAX_STORAGE_DATA_SIZE 65536 + +long lmove_to_x(0); +long lmove_to_y(0); +long lmove_to_z(0); +INT Axis_X(0); +INT Axis_Y(0); + +float fLaserVaule1(0); +float fLaserVaule2(0); + +// CKeyence_UtilDlg Ի + +IMPLEMENT_DYNAMIC(CKeyence_UtilDlg, CDialog) + + CKeyence_UtilDlg::CKeyence_UtilDlg(CWnd* pParent /*=NULL*/) + : CDialog(CKeyence_UtilDlg::IDD, pParent) +{ + +} + +CKeyence_UtilDlg::~CKeyence_UtilDlg() +{ +} + +void CKeyence_UtilDlg::DoDataExchange(CDataExchange* pDX) +{ + DDX_Control(pDX, IDC_EDIT_TEST_KEYENCE_MESSAGE, m_edMSG); + + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CKeyence_UtilDlg, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BUTTON_INIT_KEYENCE_LASER, &CKeyence_UtilDlg::OnBnClickedButtonInitKeyenceLaser) + ON_BN_CLICKED(IDC_BUTTON_RUNCNC, &CKeyence_UtilDlg::OnBnClickedButtonRuncnc) + ON_BN_CLICKED(IDCANCEL, &CKeyence_UtilDlg::OnBnClickedCancel) + ON_BN_CLICKED(IDC_BUTTON_INIT_KEYENCE_USB, &CKeyence_UtilDlg::OnBnClickedButtonInitKeyenceUsb) + ON_BN_CLICKED(IDC_BUTTON_RESET_KEYENCE_USB, &CKeyence_UtilDlg::OnBnClickedButtonResetKeyenceUsb) + ON_BN_CLICKED(IDC_BUTTON_EXIT_KEYENCE_USB, &CKeyence_UtilDlg::OnBnClickedButtonExitKeyenceUsb) + ON_BN_CLICKED(IDC_CHECK_CONTINUE_READ_LASER_VALUE, &CKeyence_UtilDlg::OnBnClickedCheckContinueReadLaserValue) + ON_BN_CLICKED(IDC_BUTTON_GET_SCAN_DATA_KEYENCE_LK_GLASER, &CKeyence_UtilDlg::OnBnClickedButtonGetScanDataKeyenceLkGlaser) + ON_BN_CLICKED(IDC_BUTTON_STOP_SCAN_KEYENCE_LK_GLASER, &CKeyence_UtilDlg::OnBnClickedButtonStopScanKeyenceLkGlaser) + ON_BN_CLICKED(IDC_BUTTON_SCAN_KEYENCE_LK_GLASER, &CKeyence_UtilDlg::OnBnClickedButtonScanKeyenceLkGlaser) +END_MESSAGE_MAP() + + +BOOL CKeyence_UtilDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + m_pSO7_Proto->Init_SO7Usb(); + m_pSO7_Proto->_start_machine(); + m_pKeyence_Laser->KeyenceLaserInit(); + + return TRUE; // return TRUE unless you set the focus to a control +} + + +// CKeyence_UtilDlg Ϣ + + +void CKeyence_UtilDlg::OnBnClickedButtonInitKeyenceLaser() +{ + m_pSO7_Proto->_send_cmd_SO7_CMD_OPEN_KEYENCE_LASER(); + do + { + Sleep(20); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE(); + } while (m_pSO7_Proto->g_machine.InterruptFlag[0]!=CT_SEND_XYZLASE); + m_pSO7_Proto->g_machine.InterruptFlag[0]=0; + CString csLaserValue; + m_pKeyence_Laser->Get_KeyenceLaserData(&fLaserVaule1,&fLaserVaule2); + csLaserValue.Format(_T("%f"),fLaserVaule1); + GetDlgItem(IDC_EDIT_LASER_VALUE1)->SetWindowText(csLaserValue); + csLaserValue.Format(_T("%f"),fLaserVaule2); + GetDlgItem(IDC_EDIT_LASER_VALUE2)->SetWindowText(csLaserValue); +} +//================================================================================================ + +void CKeyence_UtilDlg::OnBnClickedCheckContinueReadLaserValue() +{ + if (((CButton*)(GetDlgItem(IDC_CHECK_CONTINUE_READ_LASER_VALUE)))->GetCheck()) + { + ((CButton*)(GetDlgItem(IDC_BUTTON_INIT_KEYENCE_LASER)))->EnableWindow(FALSE); + SetTimer(1,20,NULL); + } + else + { + ((CButton*)(GetDlgItem(IDC_BUTTON_INIT_KEYENCE_LASER)))->EnableWindow(TRUE); + KillTimer(1); + } + + +} + +//================================================================================================ +void CKeyence_UtilDlg::OnBnClickedButtonScanKeyenceLkGlaser() +{ + m_pKeyence_Laser->StartStoreData(500,20); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_X(5); + SetTimer(2,100,NULL); +} +//================================================================================================ +void CKeyence_UtilDlg::OnBnClickedButtonStopScanKeyenceLkGlaser() +{ + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_MOVE_XYZ(); + m_pKeyence_Laser->StopStoreData(); + KillTimer(2); +} +//================================================================================================ +void CKeyence_UtilDlg::OnBnClickedButtonGetScanDataKeyenceLkGlaser() +{ + float GetData[MAX_STORAGE_DATA_SIZE]; + int GetDataNumber(0); + m_pKeyence_Laser->GetStoredData(GetData,&GetDataNumber); + m_OutMessage.Format(_T("------TotaL:%d--------------"),GetDataNumber); + OutputWithScroll(m_OutMessage,m_edMSG); + + FILE* m_pOutFile; + char *outBuff = NULL; + + CString cFileName=_T("T:\\log\\Laser.log"); + _wfopen_s(&m_pOutFile, cFileName, _T("wt")); + if (!m_pOutFile) + { + free(outBuff); + } + else + { + fprintf(m_pOutFile,"-------------Total:%d-----------------\n", GetDataNumber); + for (int i=0;iPauseScanAndGetData(GetData,&GetDataNumber); + m_OutMessage.Format(_T(":%d"),m_pKeyence_Laser->m_StoredDataNumber); + OutputWithScroll(m_OutMessage,m_edMSG); + /*for(INT I=0;I_shutdown_machine(); + m_pSO7_Proto->Exit_SO7Usb(); + CDialog::OnCancel(); + +} + +//===================================================================================== +//Print message on edit control +void CKeyence_UtilDlg::OutputWithScroll(const CString &strNewText,CEdit &edtOutput) +{ + CString strOutput; + edtOutput.GetWindowText(strOutput); + strOutput += strNewText; + if ("\r\n" != strOutput.Right(2)) + { + strOutput += "\r\n"; + } + + int iCount = strOutput.GetLength(); + + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strOutput); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); +} +/************************************************ +*************************************************/ +//=============================================== +void CKeyence_UtilDlg::OnBnClickedButtonRuncnc() +{ + + SetTimer(2,300,NULL); +} +//=============================================== +void CKeyence_UtilDlg::RunCNC() +{ + + if (m_pSO7_Proto) + { + if (Axis_X<75 && Axis_Y<=40) + { + lmove_to_x=5; + lmove_to_y=0; + m_pSO7_Proto->g_machine.x._pos_fixed._long_=(lmove_to_x*1999); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=(lmove_to_y*1999); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=(lmove_to_z*1999); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + Axis_X+=5; + } + else if (Axis_X>=75 && Axis_Y<40) + { + lmove_to_x=-75; + lmove_to_y=5; + m_pSO7_Proto->g_machine.x._pos_fixed._long_=(lmove_to_x*1999); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=(lmove_to_y*1999); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=(lmove_to_z*1999); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + Axis_X=0; + Axis_Y+=5; + } + else if (Axis_X>=75 && Axis_Y>=40) + { + lmove_to_x=-75; + lmove_to_y=-40; + m_pSO7_Proto->g_machine.x._pos_fixed._long_=(lmove_to_x*1999); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=(lmove_to_y*1999); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=(lmove_to_z*1999); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + Axis_X=0; + Axis_Y=0; + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + } + } + + +} +void CKeyence_UtilDlg::OnBnClickedButtonInitKeyenceUsb() +{ + + if (m_pKeyence_Proto) + { + if (m_pKeyence_Proto->Init_MvUsb()) + { + m_OutMessage = _T("Usb Port Error"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + return; + }; + }; + +} +void CKeyence_UtilDlg::OnBnClickedButtonResetKeyenceUsb() +{ + + m_pKeyence_Proto->_usb_reset(); + m_OutMessage = _T("The usb has been reseted."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); +} +void CKeyence_UtilDlg::OnBnClickedButtonExitKeyenceUsb() +{ + + m_pKeyence_Proto->Exit_MvUsb(); + m_OutMessage = _T("Ready - Usb Port Released"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + +} + + + + + + + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.h new file mode 100644 index 0000000..bd4ea53 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Keyence_UtilDlg.h @@ -0,0 +1,36 @@ +#pragma once + +// CKeyence_UtilDlg Ի + +class CKeyence_UtilDlg : public CDialog +{ + DECLARE_DYNAMIC(CKeyence_UtilDlg) + +public: + CKeyence_UtilDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CKeyence_UtilDlg(); + +// Ի + enum { IDD = IDD_DIALOG_TEST_KEYENCE }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + virtual BOOL OnInitDialog(); + CEdit m_edMSG; + DECLARE_MESSAGE_MAP() +public: + CString m_OutMessage; + void RunCNC(); + void OutputWithScroll(const CString &strNewText,CEdit &edtOutput); + afx_msg void OnBnClickedButtonInitKeyenceLaser(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnBnClickedButtonRuncnc(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedButtonInitKeyenceUsb(); + afx_msg void OnBnClickedButtonResetKeyenceUsb(); + afx_msg void OnBnClickedButtonExitKeyenceUsb(); + afx_msg void OnBnClickedCheckContinueReadLaserValue(); + afx_msg void OnBnClickedButtonGetScanDataKeyenceLkGlaser(); + afx_msg void OnBnClickedButtonStopScanKeyenceLkGlaser(); + afx_msg void OnBnClickedButtonScanKeyenceLkGlaser(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.cpp new file mode 100644 index 0000000..af5c67d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.cpp @@ -0,0 +1,379 @@ +// AutoTestDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "Mv_AutoTestDlg.h" +#include "afxdialogex.h" +#include "..\..\..\MicroVu\Mv_Proto.h" + +extern CMv_Proto *m_pMv_Proto; + +int CMv_AutoTestDlg::g_hThread_State; +HANDLE CMv_AutoTestDlg::g_hThread_Id; +CString CMv_AutoTestDlg::g_EditString; +HANDLE CMv_AutoTestDlg::g_hExitMutex; + +// CMv_AutoTestDlg dialog + +IMPLEMENT_DYNAMIC(CMv_AutoTestDlg, CDialogEx) + +CMv_AutoTestDlg::CMv_AutoTestDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CMv_AutoTestDlg::IDD, pParent) + , vIterations(_T("")) + , bUpdateFlag(false) + , vMessageWindow(_T("")) +{ + vMotionSpeed = _T(""); +} + +//======================================================================== +CMv_AutoTestDlg::~CMv_AutoTestDlg() +{ +} + +//======================================================================== +void CMv_AutoTestDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_ITERATIONS, vIterations); + DDX_Text(pDX, IDC_EDIT_MOTION_SPEED, vMotionSpeed); + DDX_Text(pDX, IDC_EDIT_AUTO_TEST_TEXT, vMessageWindow); + DDX_Text(pDX, IDC_EDIT_SCALE_X, m_scale_x); + DDX_Text(pDX, IDC_EDIT_SCALE_Y, m_scale_y); + DDX_Text(pDX, IDC_EDIT_SCALE_Z, m_scale_z); + DDX_Text(pDX, IDC_EDIT_SCALE_ZM, m_scale_zm); +} + +//======================================================================== +BEGIN_MESSAGE_MAP(CMv_AutoTestDlg, CDialogEx) + ON_BN_CLICKED(IDCANCEL, &CMv_AutoTestDlg::OnBnClickedExit) + ON_BN_CLICKED(IDOK, &CMv_AutoTestDlg::OnBnClickedOk) + ON_BN_CLICKED(IDSTOP, &CMv_AutoTestDlg::OnBnClickedBreak) + ON_WM_TIMER() +END_MESSAGE_MAP() + +//=========================================================================== +// CMv_AutoTestDlg message handlers +//=========================================================================== +void CMv_AutoTestDlg::OnBnClickedExit() +{ + KillTimer(1); + CDialogEx::OnCancel(); +} + +//=========================================================================== +// This function creates all objects and delete them all upon exit. +//=========================================================================== +void CMv_AutoTestDlg::OnBnClickedOk() +{ + UpdateData(TRUE); + SetTimer(1, 20, 0); + m_iIterations = _ttoi(vIterations); + m_iMotionSpeed = _ttoi(vMotionSpeed); + m_iTop_Bottom = ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_TOP_BOTTOM_LIGHTS))->GetCheck(); + m_iRing_Light = ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_RING_LIGHTS))->GetCheck(); + m_iZoom = ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_ZOOM))->GetCheck(); + m_iCycle_Stage = ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_STAGE))->GetCheck(); + m_iCycle_Rotary = ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_ROTARY))->GetCheck(); + if (!(m_iCycle_Stage || m_iRing_Light || m_iTop_Bottom || m_iZoom || m_iCycle_Rotary)) + { + m_status_msg += _T("======== Cycle selection not set, leaving. ======\r\n"); + ((CEdit *)GetDlgItem(IDC_EDIT_AUTO_TEST_TEXT))->SetWindowText(m_status_msg); + return; + } + g_hThread_State = THREAD_RUNNING; // Set thread to running + g_hThread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_Thread, + (LPVOID) this, + 0, + NULL); + ((CEdit *)GetDlgItem(IDC_EDIT_AUTO_TEST_TEXT))->SetWindowText(m_status_msg); + ((CButton *)GetDlgItem(IDSTOP))->EnableWindow(true); + ((CButton *)GetDlgItem(IDOK))->EnableWindow(false); + ((CButton *)GetDlgItem(IDCANCEL))->EnableWindow(false); +} + +//======================================================================== +// +//======================================================================== +void CMv_AutoTestDlg::CycleTopBottomLights() +{ + // ramp up the bottom light + for (int ii=0 ; ii<11; ii++ ) + { + m_pMv_Proto->mv_light_set_lamp_state(ii*10.0, 0.0); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + m_pMv_Proto->mv_light_set_lamp_state(0.0, 0.0); + m_pMv_Proto->mv_light_set_light(); + + // ramp up the top light + for (int ii=0 ; ii<11; ii++ ) + { + m_pMv_Proto->mv_light_set_lamp_state(0.0, ii*10.0); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + m_pMv_Proto->mv_light_set_lamp_state(0.0, 0.0); + m_pMv_Proto->mv_light_set_light(); + return; +}; + +//======================================================================== +// +//======================================================================== +void CMv_AutoTestDlg::CycleRingLights() +{ + if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 2) + { + for (int ii=0 ; iig_machine.s_lights_200._segment[ii][jj] = 256; + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + m_pMv_Proto->g_machine.s_lights_200._segment[ii][jj] = 0; + m_pMv_Proto->mv_light_set_light(); + } + } + } + else +// if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 3) + { + for (int ii=0 ; iig_machine.s_lights_300._segment[ii][jj] = 256; + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + m_pMv_Proto->g_machine.s_lights_300._segment[ii][jj] = 0; + m_pMv_Proto->mv_light_set_light(); + } + } + }; + MessageBeep(MB_ICONINFORMATION); + + for (int lIntensity = 0 ; lIntensity < MAXINTENSITY ; lIntensity += (long)(MAXINTENSITY*0.05)) + { + m_pMv_Proto->mv_set_full_ringlight_data(lIntensity); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + + MessageBeep(MB_ICONINFORMATION); + + for (int lIntensity = MAXINTENSITY ; lIntensity > 0 ; lIntensity -= (long)(MAXINTENSITY*0.05)) + { + m_pMv_Proto->mv_set_full_ringlight_data(lIntensity); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + MessageBeep(MB_ICONINFORMATION); +} + +//=========================================================================== +BOOL CMv_AutoTestDlg::OnInitDialog() +{ + ((CButton *)GetDlgItem(IDC_EDIT_ITERATIONS))->SetWindowText(_T("1")); + ((CButton *)GetDlgItem(IDC_EDIT_MOTION_SPEED))->SetWindowTextW(_T("100")); + ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_TOP_BOTTOM_LIGHTS))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_STAGE))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_CHECK_CYCLE_RING_LIGHTS))->SetCheck(0); + ((CButton *)GetDlgItem(IDSTOP))->EnableWindow(false); + return TRUE; +}; + +//=========================================================================== +void CMv_AutoTestDlg::OnBnClickedBreak() +{ + ((CButton *)GetDlgItem(IDSTOP))->EnableWindow(false); + g_hThread_State = THREAD_EXIT; // Set thread to stop + WaitForSingleObject(g_hExitMutex, INFINITE); + CloseHandle(g_hExitMutex); + KillTimer(1); + ((CButton *)GetDlgItem(IDOK))->EnableWindow(true); + ((CButton *)GetDlgItem(IDCANCEL))->EnableWindow(true); +} + +//=========================================================================== +// Worker Thread to run the autotest +//=========================================================================== +unsigned __stdcall CMv_AutoTestDlg::g_Thread(LPVOID pThis) +{ + CMv_AutoTestDlg* _This = (CMv_AutoTestDlg*)pThis; + USES_CONVERSION; + SSI_STATUS sStatus; + g_hExitMutex=CreateMutex(NULL,TRUE,NULL); // Owned + sStatus = m_pMv_Proto->Load_MicroVu_Config(); + _This->m_status_msg += _T("======== Loading configuration file. \r\n"); + _This->bUpdateFlag = true; + if (sStatus == SSI_STATUS_MV_CONFIG_FILE_NOT_FOUND) + { + // Initiallize default values + }; + sStatus = m_pMv_Proto->Init_MvUsb(); + if (sStatus == SSI_STATUS_DATALINK_ERROR) + { + _This->m_status_msg += _T("======== Unable to start Usb. \r\n"); + ((CButton *)(_This->GetDlgItem(IDSTOP)))->EnableWindow(false); + ((CButton *)(_This->GetDlgItem(IDOK)))->EnableWindow(true); + ((CButton *)(_This->GetDlgItem(IDCANCEL)))->EnableWindow(true); + ExitThread(0); + }; + + ((CButton *)(_This->GetDlgItem(IDSTOP)))->EnableWindow(false); + ((CButton *)(_This->GetDlgItem(IDOK)))->EnableWindow(false); + ((CButton *)(_This->GetDlgItem(IDCANCEL)))->EnableWindow(false); + m_pMv_Proto->_start_machine(); + m_pMv_Proto->_get_xyz_index(); + m_pMv_Proto->_poll_machine_59(); + _This->m_status_msg += _T("======== Homing the stage. Please wait. \r\n"); + _This->bUpdateFlag = true; + ::MessageBox(NULL, _T("======== Please clear all objects from the stage. Press OK when ready."), _T("Warning"), MB_OK); + m_pMv_Proto->mv_motion_Dcc_Home(); + _This->m_status_msg += _T("======== Homing completed.\r\n"); + _This->bUpdateFlag = true; + ((CButton *)(_This->GetDlgItem(IDSTOP)))->EnableWindow(true); + ((CButton *)(_This->GetDlgItem(IDOK)))->EnableWindow(false); + ((CButton *)(_This->GetDlgItem(IDCANCEL)))->EnableWindow(false); + + int iIteration = _This->m_iIterations < 0 ? 5 : _This->m_iIterations; + for (int i=0; im_iIterations == 0) i = 0; + if (g_hThread_State == THREAD_EXIT) break; + _This->m_status_msg += _T("======== Processing iteration : " ); + g_EditString.Format(_T("%d"),(i+1)); + _This->m_status_msg += g_EditString; + _This->m_status_msg += _T("\r\n"); + _This->bUpdateFlag = true; + USES_CONVERSION; + if (_This->m_iCycle_Stage) + { + _This->m_status_msg += _T(" Motion speed : "); + g_EditString.Format(_T("%d"),_This->m_iMotionSpeed); + _This->m_status_msg += g_EditString; + _This->m_status_msg += _T("\r\n"); + _This->bUpdateFlag = true; + m_pMv_Proto->mv_motion_set_speed_xyz(_This->m_iMotionSpeed); + double dX = 100.0, dY = 100.0, dZ = 80.0; + m_pMv_Proto->mv_motion_set_position_xyz(dX, dY, dZ, true); + double dXFinal=0.0, dYFinal=0.0, dZFinal = 0.0; + m_pMv_Proto->mv_motion_get_position_xyz(dXFinal, dYFinal, dZFinal); + g_EditString.Format(_T(" Set Position : %8.4lf %8.4lf %8.4lf\r\n"), dX, dY, dZ); + _This->m_status_msg += g_EditString; + g_EditString.Format(_T(" Get Position : %8.4lf %8.4lf %8.4lf\r\n"), dXFinal, dYFinal, dZFinal); + _This->m_status_msg += g_EditString; + _This->bUpdateFlag = true; + m_pMv_Proto->mv_motion_set_speed_xyz(_This->m_iMotionSpeed); + + dX = 200.0; + dY = 150.0; + dZ = 100.0; + + m_pMv_Proto->mv_motion_set_position_xyz(dX, dY, dZ, true); + m_pMv_Proto->mv_motion_get_position_xyz(dXFinal, dYFinal, dZFinal); + g_EditString.Format(_T(" Set Position : %8.4lf %8.4lf %8.4lf\r\n"), dX, dY, dZ); + _This->m_status_msg += g_EditString; + g_EditString.Format(_T(" Get Position : %8.4lf %8.4lf %8.4lf\r\n"), dXFinal, dYFinal, dZFinal); + _This->m_status_msg += g_EditString; + _This->bUpdateFlag = true; + } + if (g_hThread_State == THREAD_EXIT) break; + if (_This->m_iRing_Light) + { + _This->m_status_msg += _T(" Cycle Ring Light. \r\n"); + _This->bUpdateFlag = true; + _This->CycleRingLights(); + }; + if (g_hThread_State == THREAD_EXIT) break; + if (_This->m_iTop_Bottom) + { + _This->m_status_msg += _T(" Cycle Top and Bottom Lights. \r\n"); + _This->bUpdateFlag = true; + _This->CycleTopBottomLights(); + }; + + if (g_hThread_State == THREAD_EXIT) break; + long lScale = -999999; + if (_This->m_iZoom) + { + _This->m_status_msg += _T(" Get Zoom Scale : "); + _This->bUpdateFlag = true; + m_pMv_Proto->mv_optics_get_scale_position(lScale); + g_EditString.Format(_T("%ld"), lScale); + _This->m_status_msg += g_EditString; + _This->m_status_msg += _T("\r\n"); + _This->bUpdateFlag = true; + g_EditString.Format(_T(" Set Zoom Scale : %ld \r\n"), lScale+5000); + _This->m_status_msg += g_EditString; + _This->bUpdateFlag = true; + m_pMv_Proto->mv_optics_set_scale_position(lScale+5000); + + _This->m_status_msg += _T(" Get Zoom Scale : "); + _This->bUpdateFlag = true; + m_pMv_Proto->_send_cmd_MV_CMD_GET_MAG_43(0x03); + g_EditString.Format(_T("%ld"), m_pMv_Proto->g_machine.zm._pos_59); + _This->m_status_msg += g_EditString; + _This->m_status_msg += _T("\r\n"); + _This->bUpdateFlag = true; + g_EditString.Format(_T(" Set Zoom Scale : %ld \r\n"), lScale-5000); + _This->m_status_msg += g_EditString; + _This->bUpdateFlag = true; + m_pMv_Proto->mv_optics_set_scale_position(lScale-5000); + + _This->m_status_msg += _T(" Get Zoom Scale : "); + _This->bUpdateFlag = true; + m_pMv_Proto->_send_cmd_MV_CMD_GET_MAG_43(0x03); + g_EditString.Format(_T("%ld"), m_pMv_Proto->g_machine.zm._pos_59); + _This->m_status_msg += g_EditString; + _This->m_status_msg += _T("\r\n"); + _This->bUpdateFlag = true; + m_pMv_Proto->_poll_machine_59(); + }; + if (_This->m_iCycle_Rotary) + { + for (int j = 1; j<12; j++) + { + m_pMv_Proto->mv_motion_set_position_r(30.0*j); + Sleep(10); + }; + }; + _This->m_status_msg += _T("======== Iteration completed. \r\n"); + } + m_pMv_Proto->_shutdown_machine(); + m_pMv_Proto->Exit_MvUsb(); + ReleaseMutex(g_hExitMutex); + ExitThread(0); +}; + +//================================================================================================ +// This is needed to update the status window periodically. +//================================================================================================ +void CMv_AutoTestDlg::OnTimer(UINT_PTR nIDEvent) +{ + if (m_pMv_Proto) + { + if (bUpdateFlag) + { + CString temp; + temp = m_status_msg; + ((CEdit *)GetDlgItem(IDC_EDIT_AUTO_TEST_TEXT))->SetWindowText(temp); + bUpdateFlag = false; + }; + m_scale_x.Format(_T("%8ld"),(m_pMv_Proto->g_machine.x._pos_59)); + GetDlgItem(IDC_EDIT_SCALE_X)->SetWindowText(m_scale_x); + m_scale_y.Format(_T("%8ld"),(m_pMv_Proto->g_machine.y._pos_59)); + GetDlgItem(IDC_EDIT_SCALE_Y)->SetWindowText(m_scale_y); + m_scale_z.Format(_T("%8ld"),(m_pMv_Proto->g_machine.z._pos_59)); + GetDlgItem(IDC_EDIT_SCALE_Z)->SetWindowText(m_scale_z); + m_scale_zm.Format(_T("%8ld"),(m_pMv_Proto->g_machine.zm._pos_59)); + GetDlgItem(IDC_EDIT_SCALE_ZM)->SetWindowText(m_scale_zm); + } + CDialog::OnTimer(nIDEvent); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.h new file mode 100644 index 0000000..fe62e75 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_AutoTestDlg.h @@ -0,0 +1,54 @@ +#pragma once +#include "..\..\..\MicroVu\Mv_Proto.h" +#include "afxwin.h" + +// CMv_AutoTestDlg dialog + +class CMv_AutoTestDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CMv_AutoTestDlg) + +public: + CMv_AutoTestDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_AutoTestDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_AUTO_TEST }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedExit(); + void CycleTopBottomLights(); + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedBreak(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + void CycleRingLights(); + BOOL OnInitDialog(); + // Number of times to execute + CString vIterations; + int m_iIterations; + + static int g_hThread_State; + static unsigned __stdcall g_Thread(LPVOID pThis); + static HANDLE g_hThread_Id; + static CString g_EditString; + CString vMotionSpeed; + int m_iMotionSpeed; + CString vMessageWindow; + CString m_status_msg; + BOOL bUpdateFlag; + BOOL m_iTop_Bottom; + BOOL m_iRing_Light; + BOOL m_iCycle_Stage; + BOOL m_iCycle_Rotary; + BOOL m_iZoom; + long m_lScale; + CString m_scale_x; + CString m_scale_y; + CString m_scale_z; + CString m_scale_zm; + static HANDLE g_hExitMutex; +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.cpp new file mode 100644 index 0000000..7e7c8a1 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.cpp @@ -0,0 +1,60 @@ +// Mv_ConfigDataDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "Mv_ConfigDataDlg.h" +#include "afxdialogex.h" +#include "DirDialog.h" + +// CMv_ConfigDataDlg dialog + +IMPLEMENT_DYNAMIC(CMv_ConfigDataDlg, CDialogEx) + +CMv_ConfigDataDlg::CMv_ConfigDataDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CMv_ConfigDataDlg::IDD, pParent) +{ + +} + +CMv_ConfigDataDlg::~CMv_ConfigDataDlg() +{ +} + +void CMv_ConfigDataDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CMv_ConfigDataDlg, CDialogEx) + ON_BN_CLICKED(IDOK, &CMv_ConfigDataDlg::OnBnClickedOk) +END_MESSAGE_MAP() + + +// CMv_ConfigDataDlg message handlers + + +void CMv_ConfigDataDlg::OnBnClickedOk() +{ + + // Select the target directory + CString m_szDirName; + CDirDialog dirDlg; + dirDlg.m_strSelDir = _T("C:\\Program Files\\Micro-Vu Corporation\\InSpec for Windows"); + if (dirDlg.DoBrowse()) + { + m_szDirName = dirDlg.m_strPath; + }; + CString FromFile = m_szDirName + _T("\\InSpecDiagCollect.zip"); + CString ToFile; + BOOL bFailIfExists = false; + if(::CopyFile(FromFile,ToFile,bFailIfExists)) + { + CString Entry; + Entry.Format(_T("\r\nCopied %s"), FromFile); + Entry.Format(_T("\r\nTo %s"),ToFile); + } + + CDialogEx::OnOK(); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.h new file mode 100644 index 0000000..6e39fe4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ConfigDataDlg.h @@ -0,0 +1,23 @@ +#pragma once + + +// CMv_ConfigDataDlg dialog + +class CMv_ConfigDataDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CMv_ConfigDataDlg) + +public: + CMv_ConfigDataDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_ConfigDataDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_COPY_INSPEC_CONFIG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedOk(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.Cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.Cpp new file mode 100644 index 0000000..6636894 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.Cpp @@ -0,0 +1,186 @@ +#include "StdAfx.h" +#include "Mv_File_Utilities.h" + +#define MAX_BUFF_SIZE 1024 +// ========================================================================================== +// Read in a buffer. Look for the key. Match one of them. +// iFmt = -1 not used. +// ========================================================================================== +int CMv_File_Utilities::DedupeFunction(CString *_InFileName) +{ + FILE* pInFile; + FILE* pOutFile; + char LastCmd[MAX_BUFF_SIZE]; + char PrintLine[MAX_BUFF_SIZE]; + char InBuff[MAX_BUFF_SIZE]; + int iCount=0; + + memset(LastCmd, 0, MAX_BUFF_SIZE); + CString OutFileName = *_InFileName + _T("_scrubbed.txt"); + _wfopen_s(&pOutFile, OutFileName, _T("w")); + if (!pOutFile) + return -1; + _wfopen_s(&pInFile, *_InFileName, _T("r")); + if (!pInFile) + { + fclose(pOutFile); + return(-1); + }; + memset(PrintLine, 0, MAX_BUFF_SIZE); + fgets((char *)InBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + while (!feof(pInFile)) + { + if (!_strnicmp(InBuff, "Matrix", 6)) + { + if (!_strnicmp(LastCmd, InBuff, strlen(InBuff))) + { + iCount++; + } + else + { + if (strlen(LastCmd) > 2) + { + LastCmd[strlen(LastCmd)-1] = 0; + fprintf(pOutFile, "%s (%i) \n", LastCmd, iCount+1); + iCount=0; + } + strcpy(LastCmd, InBuff); + fgets((char *)InBuff, MAX_BUFF_SIZE, pInFile ); // + } + }; + fgets((char *)InBuff, MAX_BUFF_SIZE, pInFile ); // + }; + fclose(pInFile); + fclose(pOutFile); + return 0; +} + +//===================================================================================== +int CMv_File_Utilities::ExtractCommand(CString* _InFileName, char* _criteriaString, int bNegate) +{ + FILE* pInFile; + FILE* pOutFile; + char inBuff[MAX_BUFF_SIZE]; + char _criteriaArray[5][256]; + + CString OutFileName = *_InFileName + _T("_scrubbed.txt"); + _wfopen_s(&pOutFile, OutFileName, _T("w")); + if (!pOutFile) + return -1; + _wfopen_s(&pInFile, *_InFileName, _T("r")); + if (!pInFile) + { + fclose(pOutFile); + return(-1); + }; + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + char *token = NULL; + int idx = 0; + int i; + token = strtok(_criteriaString, ";"); + while (token) + { + strcpy(_criteriaArray[idx], token); + ++idx; + token = strtok(NULL, ";"); + }; + if (bNegate) + { + while (!feof(pInFile)) + { + if ((inBuff[0] == '<') || (inBuff[0] == '>')) + { + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // + continue; + } + for (i=0; i0) + fprintf(pOutFile, inBuff); + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // + }; + } + else + { + while (!feof(pInFile)) + { + for (int i=0; i 0) + { + fprintf(pOutFile, "%8.8X : ", byte_pos); + for (int j = 0; j < 8; j++) + { + fprintf(pOutFile, "%2.2X%2.2X%2.2X%2.2X ", *(fBuff+j*4), *(fBuff+j*4+1), *(fBuff+j*4+2), *(fBuff+j*4+3)); + }; + fprintf(pOutFile, "\n"); + byte_pos += 32; + }; + }; + + fclose(pInFile); + fclose(pOutFile); + + free(fBuff); + + return 0; +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.h new file mode 100644 index 0000000..9461ed9 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_File_Utilities.h @@ -0,0 +1,12 @@ +#pragma once +#include "afxwin.h" + +class CMv_File_Utilities +{ +public: + CMv_File_Utilities(void); + ~CMv_File_Utilities(void); + int BinToHexAscii(CString* InFileName); + int DedupeFunction(CString* InFileName); + int ExtractCommand(CString* InFileName, char *_criteriaString, int bNegate); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.cpp new file mode 100644 index 0000000..d9fdb4b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.cpp @@ -0,0 +1,534 @@ +// Mv_MainDlg.cpp : implementation file +// +#include "stdafx.h" +#include "Mv_Util.h" +#include "afxdialogex.h" +#include "..\..\..\MicroVu\Mv_Proto.h" +#include "Mv_UtilDlg.h" +#include "Mv_AutoTestDlg.h" +#include "Mv_ProtocolAnalyzerDlg.h" +#include "CaptureDataDlg.h" +#include "FileUtilitiesDlg.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "ProcessButton.h" +#include "..\..\..\Animatics\Animatics_Proto.h" +#include "AnimaticsUtilityDlg.h" +#include "Animatics_UtilDlg.h" +#include "SO7_UtilDlg.h" +#include "So7_Option.h" +#include "Mv_MainDlg.h" + +CMv_Proto* m_pMv_Proto =NULL; +SmartMotor_Proto* pSmartMotor_Proto=NULL; + + +// CMv_MainDlg dialog + +IMPLEMENT_DYNAMIC(CMv_MainDlg, CDialogEx) + +CMv_MainDlg::CMv_MainDlg(CWnd* pParent /*=NULL*/) + : CDialogEx(CMv_MainDlg::IDD, pParent) +{ +} + +CMv_MainDlg::~CMv_MainDlg() +{ +} + +void CMv_MainDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CMv_MainDlg, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON_DIAGNOSTICS, &CMv_MainDlg::OnBnClickedButtonDiagnostics) + ON_BN_CLICKED(IDC_BUTTON_AUTO_TEST, &CMv_MainDlg::OnBnClickedButtonAutoTest) + ON_BN_CLICKED(IDC_BUTTON_PROTOCOL_ANALYZER, &CMv_MainDlg::OnBnClickedButtonProtocolAnalyzerDlg) + ON_BN_CLICKED(IDC_BUTTON_REPLAY_STARTUP, &CMv_MainDlg::OnBnClickedButtonReplayStartup) + ON_BN_CLICKED(IDOK, &CMv_MainDlg::OnBnClickedOk) + ON_BN_CLICKED(IDC_BUTTON_START_CAPTURE, &CMv_MainDlg::OnBnClickedButtonStartCapture) + ON_BN_CLICKED(IDC_RADIO_DATA_CAPTURE_MODE, &CMv_MainDlg::OnBnClickedRadioDataCaptureMode) + ON_BN_CLICKED(IDC_RADIO_ENGINEERING_MODE, &CMv_MainDlg::OnBnClickedRadioEngineering) + ON_BN_CLICKED(IDC_RADIO_DEMO_MODE, &CMv_MainDlg::OnBnClickedRadioDemoMode) + ON_BN_CLICKED(IDC_BUTTON_FILE_UTILITIES, &CMv_MainDlg::OnBnClickedButtonFileUtilities) + ON_BN_CLICKED(IDC_RADIO_MACHINE_MICROVU, &CMv_MainDlg::OnBnClickedRadioMachineMicrovu) + ON_BN_CLICKED(IDC_RADIO_MACHINE_MITUTOYO, &CMv_MainDlg::OnBnClickedRadioMachineMitutoyo) + ON_BN_CLICKED(IDC_BUTTON_CREATE_CONFIG, &CMv_MainDlg::OnBnClickedButtonCreateConfig) + ON_BN_CLICKED(IDC_RADIO_MACHINE_SevenOcean, &CMv_MainDlg::OnBnClickedRadioMachineSevenocean) + ON_BN_CLICKED(IDC_RADIO_MACHINE_GENERIC, &CMv_MainDlg::OnBnClickedRadioMachineGeneric) + ON_BN_CLICKED(IDC_RADIO_MACHINE_ANIMATICS, &CMv_MainDlg::OnBnClickedRadioAnimatics) +END_MESSAGE_MAP() + +//=========================================================================== +//=========================================================================== +// CMv_MainDlg message handlers +//=========================================================================== +//=========================================================================== +void CMv_MainDlg::OnBnClickedButtonDiagnostics() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->GetCheck()) + { + CMv_UtilDlg* pMv_UtilDlg = new CMv_UtilDlg(); + pMv_UtilDlg->DoModal(); + delete pMv_UtilDlg; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_SevenOcean))->GetCheck()) + { + CSo7_Option* pSo7_Option=new CSo7_Option(); + pSo7_Option->DoModal(); + delete pSo7_Option; + pSo7_Option=nullptr; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_ANIMATICS))->GetCheck()) + { + if(!pSmartMotor_Proto) + { + pSmartMotor_Proto=new SmartMotor_Proto(); + } + AnimaticsUtilityDlg* pAnimaticsDlg =new AnimaticsUtilityDlg(); + pAnimaticsDlg->DoModal(); + delete pAnimaticsDlg; + pAnimaticsDlg=nullptr; + if(pSmartMotor_Proto) + { + delete pSmartMotor_Proto; + pSmartMotor_Proto=nullptr; + } + + } + +} + +//=========================================================================== +void CMv_MainDlg::OnBnClickedButtonAutoTest() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->GetCheck()) + { + m_pMv_Proto = new CMv_Proto(); + CMv_AutoTestDlg* pMv_AutoTestDlg = new CMv_AutoTestDlg(); + pMv_AutoTestDlg->DoModal(); + delete pMv_AutoTestDlg; + delete m_pMv_Proto; + m_pMv_Proto=NULL; + }; +} + +//=========================================================================== +// pMv_ProtocolAnalyzerDlg->m_machine = 0; MicroVu +// pMv_ProtocolAnalyzerDlg->m_machine = 1; Mitutoyo +//=========================================================================== +void CMv_MainDlg::OnBnClickedButtonProtocolAnalyzerDlg() +{ + CMv_ProtocolAnalyzerDlg* pMv_ProtocolAnalyzerDlg = new CMv_ProtocolAnalyzerDlg(); + + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->GetCheck()) + pMv_ProtocolAnalyzerDlg->m_machine = 2; + else + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->GetCheck()) + pMv_ProtocolAnalyzerDlg->m_machine = 1; + else + pMv_ProtocolAnalyzerDlg->m_machine = 0; // Generic + pMv_ProtocolAnalyzerDlg->DoModal(); + delete pMv_ProtocolAnalyzerDlg; +} + +//=========================================================================== +// DeviceID = "VID_0D26&PID_1001" - MicroVu +// DeviceID = "VID_0fe7&PID_2004" - Mitutoyo +//=========================================================================== + +//=========================================================================== +// +void CMv_MainDlg::OnBnClickedButtonReplayStartup() +{ + CString strFilters; + CString strExt; + strFilters = _T("Replay Data (*.annotated.proto.txt)|*.annotated.proto.txt|All Files (*.*)|*.*||"); + strExt = _T(".txt"); + m_csLogFile = "Replay.Txt"; + CString strMsg; + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) m_csLogFile, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, strFilters, this); + if ( fileDlg.DoModal ()==IDOK ) + { + m_csReplayFile = fileDlg.GetPathName(); + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->GetCheck()) + { + if (!m_pMv_Proto) + m_pMv_Proto = new CMv_Proto(); + m_pMv_Proto->Init_MvUsb(); + m_pMv_Proto->_start_machine(); + m_pMv_Proto->_get_xyz_index(); + m_pMv_Proto->_poll_machine_59(); + m_pMv_Proto->mv_motion_Dcc_Home(); + if (m_pMv_Proto->_replay_capture(m_csReplayFile)) + { + MessageBox( _T("Replay MicroVu Capture File not found."), _T("Message"), MB_OK); + } + else + { + MessageBox( _T("Replay MicroVu Capture File Done."), _T("Message"), MB_OK); + }; + m_pMv_Proto->_shutdown_machine(); + m_pMv_Proto->Exit_MvUsb(); + delete m_pMv_Proto; + } + }; +} + +//=========================================================================== +void CMv_MainDlg::OnBnClickedOk() +{ + CDialogEx::OnOK(); +} + +//=========================================================================== +BOOL CMv_MainDlg::OnInitDialog() +{ + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_SevenOcean))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_ANIMATICS))->SetCheck(false); + + ((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->SetCheck(true); + OnBnClickedRadioEngineering(); + OnBnClickedRadioMachineMitutoyo(); + return TRUE; +}; + +//=========================================================================== +void CMv_MainDlg::OnBnClickedButtonStartCapture() +{ + STARTUPINFO m_si; + PROCESS_INFORMATION m_pi; + ZeroMemory(&m_si, sizeof(m_si)); + m_si.cb = sizeof(m_si); + ZeroMemory(&m_pi, sizeof(m_pi)); + DWORD dwExitCode = 0; + int x; + LPTSTR szCmdline = _tcsdup(TEXT("SniffUSB.exe")); + if (!CreateProcess(NULL, + szCmdline, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &m_si, + &m_pi) + ) + { + x = GetLastError(); + return; + }; + dwExitCode = ::WaitForSingleObject(m_pi.hProcess, INFINITE); + CloseHandle( m_pi.hProcess ); + CloseHandle( m_pi.hThread ); + free( szCmdline ); + +//================================================================================= +// Copy the UsbSnoopy.Log to a special location. +//================================================================================= + CString strDestFileName; + CString strFilters; + CString strExt; + strFilters = _T("All Files (*.*)|*.*||"); + strExt = _T("Log"); + strDestFileName = "UsbSnoop_Destination.Log"; + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) strDestFileName, OFN_HIDEREADONLY, strFilters, this); + if ( fileDlg.DoModal ()==IDOK ) + { + strDestFileName = fileDlg.GetPathName(); + } + delete fileDlg; + BOOL bFailIfExists = false; + CString strSourceFileName = _T("c:\\windows\\usbsnoop.log"); + CopyFile(strSourceFileName, strDestFileName, bFailIfExists); + return; +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedRadioDataCaptureMode() +{ + if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_SevenOcean))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_ANIMATICS))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(true); + } + +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedRadioEngineering() +{ + + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DEMO_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_SevenOcean))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_ANIMATICS))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DEMO_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(true); + }; +}; + +//================================================================================= +void CMv_MainDlg::OnBnClickedRadioDemoMode() +{ + if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_SevenOcean))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_FILE_UTILITIES))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MACHINE_ANIMATICS))->GetCheck()) + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + + } + else + { + ((CButton *)GetDlgItem(IDC_BUTTON_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_STATIC_AUTO_TEST))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_DIAGNOSTICS))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_DIAGNOSTICS))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_REPLAY_STARTUP))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_REPLAY))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_START_CAPTURE))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_COLLECTS_TEXT))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_RADIO_DEMO_MODE))->EnableWindow(true); + } +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedButtonFileUtilities() +{ + CFileUtilitiesDlg* pMv_FileUtilitiesDlg = new CFileUtilitiesDlg(); + pMv_FileUtilitiesDlg->DoModal(); + delete pMv_FileUtilitiesDlg; +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedRadioMachineMicrovu() +{ + if (!m_pMv_Proto) + m_pMv_Proto = new CMv_Proto(); + if (((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->GetCheck()) + { + OnBnClickedRadioDataCaptureMode(); + } else + if (((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->GetCheck()) + { + OnBnClickedRadioEngineering(); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(true); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(true); + } else + { // Demo Mode + OnBnClickedRadioDemoMode(); + } + if (m_pMv_Proto) + { + delete m_pMv_Proto; + m_pMv_Proto=nullptr; + } + return; +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedRadioMachineMitutoyo() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->GetCheck()) + { + OnBnClickedRadioDataCaptureMode(); + } else + if (((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->GetCheck()) + { + OnBnClickedRadioEngineering(); + ((CButton *)GetDlgItem(IDC_STATIC_MV_CONFIG))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_CREATE_CONFIG))->EnableWindow(false); + } else + { // Demo Mode + OnBnClickedRadioDemoMode(); + } + return; +} + +//================================================================================= +void CMv_MainDlg::OnBnClickedButtonCreateConfig() +{ + CCaptureDataDlg* pCaptureDataDlg = new CCaptureDataDlg(); + pCaptureDataDlg->DoModal(); + delete pCaptureDataDlg; + return; +} + + +void CMv_MainDlg::OnBnClickedRadioMachineSevenocean() +{ + + if (((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->GetCheck()) + { + OnBnClickedRadioDataCaptureMode(); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->GetCheck()) + { + OnBnClickedRadioEngineering(); + } + else + { // Demo Mode + OnBnClickedRadioDemoMode(); + } + + return; + +} + + + + +void CMv_MainDlg::OnBnClickedRadioMachineGeneric() +{ + + if (((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->GetCheck()) + { + OnBnClickedRadioDataCaptureMode(); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->GetCheck()) + { + OnBnClickedRadioEngineering(); + } + else + { // Demo Mode + OnBnClickedRadioDemoMode(); + } + + return; + +} + + +void CMv_MainDlg::OnBnClickedRadioAnimatics() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_DATA_CAPTURE_MODE))->GetCheck()) + { + OnBnClickedRadioDataCaptureMode(); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_ENGINEERING_MODE))->GetCheck()) + { + OnBnClickedRadioEngineering(); + } + else + { // Demo Mode + OnBnClickedRadioDemoMode(); + } + + return; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.h new file mode 100644 index 0000000..f122cd4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_MainDlg.h @@ -0,0 +1,42 @@ +#pragma once + +#include "..\..\..\MicroVu\Mv_Proto.h" + +// Mv_MainDlg dialog + +class CMv_MainDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CMv_MainDlg) + +public: + CMv_MainDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_MainDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_MAIN_MENU }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + virtual BOOL OnInitDialog(); + afx_msg void OnBnClickedButtonDiagnostics(); + afx_msg void OnBnClickedButtonAutoTest(); + afx_msg void OnBnClickedButtonProtocolAnalyzerDlg(); + afx_msg void OnBnClickedButtonReplayStartup(); + CString m_csLogFile; + CString m_csReplayFile; + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedButtonStartCapture(); + afx_msg void OnBnClickedRadioDataCaptureMode(); + afx_msg void OnBnClickedRadioEngineering(); + afx_msg void OnBnClickedRadioDemoMode(); + afx_msg void OnBnClickedButtonFileUtilities(); + afx_msg void OnBnClickedRadioMachineMicrovu(); + afx_msg void OnBnClickedRadioMachineMitutoyo(); + afx_msg void OnBnClickedButtonCreateConfig(); + afx_msg void OnBnClickedRadioMachineSevenocean(); + afx_msg void OnBnClickedRadioMachineGeneric(); + afx_msg void OnBnClickedRadioAnimatics(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.cpp new file mode 100644 index 0000000..19efaab --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.cpp @@ -0,0 +1,261 @@ +// Mv_Move_Location.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "..\..\..\MicroVu\Mv_Proto.h" +#include "Mv_Move_Location.h" +#include "afxdialogex.h" + +extern CMv_Proto* m_pMv_Proto; + +// CMv_Move_Location dialog + +IMPLEMENT_DYNAMIC(CMv_Move_Location, CDialog) + +CMv_Move_Location::CMv_Move_Location(CWnd* pParent /*=NULL*/) + : CDialog(CMv_Move_Location::IDD, pParent) +{ +} + +CMv_Move_Location::~CMv_Move_Location() +{ +} + +//=========================================================================== +void CMv_Move_Location::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_X, m_Move_to_X); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_Y, m_Move_to_Y); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_Z, m_Move_to_Z); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_ZM, m_Move_to_ZM); + DDX_Text(pDX, IDC_EDIT_SPEED_X, m_Speed_X); + DDX_Text(pDX, IDC_EDIT_SPEED_Y, m_Speed_Y); + DDX_Text(pDX, IDC_EDIT_SPEED_Z, m_Speed_Z); + DDX_Text(pDX, IDC_EDIT_ACC_X, m_Acc_X); + DDX_Text(pDX, IDC_EDIT_ACC_Y, m_Acc_Y); + DDX_Text(pDX, IDC_EDIT_ACC_Z, m_Acc_Z); + DDX_Text(pDX, IDC_EDIT_DEC_X, m_Acc_X); + DDX_Text(pDX, IDC_EDIT_DEC_Y, m_Acc_Y); + DDX_Text(pDX, IDC_EDIT_DEC_Z, m_Acc_Z); + DDX_Text(pDX, IDC_EDIT_MANUAL_SPEED_X, m_Manual_Speed_X); + DDX_Text(pDX, IDC_EDIT_MANUAL_SPEED_Y, m_Manual_Speed_Y); + DDX_Text(pDX, IDC_EDIT_MANUAL_SPEED_Z, m_Manual_Speed_Z); + DDX_Text(pDX, IDC_EDIT_MANUAL_ACC_X, m_Manual_Acc_X); + DDX_Text(pDX, IDC_EDIT_MANUAL_ACC_Y, m_Manual_Acc_Y); + DDX_Text(pDX, IDC_EDIT_MANUAL_ACC_Z, m_Manual_Acc_Z); + DDX_Text(pDX, IDC_EDIT_MANUAL_DEC_X, m_Manual_Dec_X); + DDX_Text(pDX, IDC_EDIT_MANUAL_DEC_Y, m_Manual_Dec_X); + DDX_Text(pDX, IDC_EDIT_MANUAL_DEC_Z, m_Manual_Dec_X); + + CString m_Acc_X; + CString m_Acc_Y; + CString m_Acc_z; + CString m_Dec_X; + CString m_Dec_Y; + CString m_Dec_Z; +} + +BEGIN_MESSAGE_MAP(CMv_Move_Location, CDialog) + ON_BN_CLICKED(IDOK, &CMv_Move_Location::OnBnClickedStart) + ON_EN_KILLFOCUS(IDC_EDIT_MOVE_TO_X, &CMv_Move_Location::OnEnKillfocusEditMoveToX) + ON_EN_KILLFOCUS(IDC_EDIT_MOVE_TO_Y, &CMv_Move_Location::OnEnKillfocusEditMoveToY) + ON_EN_KILLFOCUS(IDC_EDIT_MOVE_TO_Z, &CMv_Move_Location::OnEnKillfocusEditMoveToZ) + ON_EN_KILLFOCUS(IDC_EDIT_MOVE_TO_ZM, &CMv_Move_Location::OnEnKillfocusEditMoveToZm) + ON_BN_CLICKED(IDC_BUTTON_MOVE_W, &CMv_Move_Location::OnBnClickedButtonMoveW) +END_MESSAGE_MAP() + +//======================================================================= +// May use auto parameters or manual parameters. +//======================================================================= +void CMv_Move_Location::OnBnClickedStart() +{ + UpdateData(TRUE); + m_move_to_x = _wtof(m_Move_to_X); + m_move_to_y = _wtof(m_Move_to_Y); + m_move_to_z = _wtof(m_Move_to_Z); + m_move_to_zm = _wtof(m_Move_to_ZM); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { // scale + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { // mm + } + else + { // inches + }; + + if (((CButton *)GetDlgItem(IDC_RADIO_SPEED_FAST))->GetCheck()) + { // fast + } + else if (((CButton *)GetDlgItem(IDC_RADIO_SPEED_SLOW))->GetCheck()) + { // slow + } + else + { // user defined + }; + + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { // move relative + } + else + { // move absolute + }; + + if (((CButton *)GetDlgItem(IDC_CHECK_USE_MANUAL_MOTION_PARAMETERS))->GetCheck()) + { // use manual parameters + } + else + { // use automatically generated parameters + }; + +#pragma message("hard coded speed") + m_pMv_Proto->mv_optics_set_scale_position((long)m_move_to_zm); + m_pMv_Proto->mv_motion_set_speed_xyz(50.0); + m_pMv_Proto->mv_motion_set_position_xyz(m_move_to_x, m_move_to_y, m_move_to_z, true); + CDialog::OnOK(); +} + +//======================================================================= +BOOL CMv_Move_Location::OnInitDialog() +{ + ((CButton *)GetDlgItem(IDC_RADIO_INCH))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MM))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_FAST))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_SLOW))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->SetCheck(0); + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + {// scale + m_Move_to_X.Format(_T("%d"),(m_pMv_Proto->g_machine.x._pos_59)); + m_Move_to_Y.Format(_T("%d"),(m_pMv_Proto->g_machine.y._pos_59)); + m_Move_to_Z.Format(_T("%d"),(m_pMv_Proto->g_machine.z._pos_59)); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + {// mm + m_Move_to_X.Format(_T("%f"),(m_pMv_Proto->g_machine.x._pos_59)); + m_Move_to_Y.Format(_T("%f"),(m_pMv_Proto->g_machine.y._pos_59)); + m_Move_to_Z.Format(_T("%f"),(m_pMv_Proto->g_machine.z._pos_59)); + } + else + {// inches + m_Move_to_X.Format(_T("%f"),(m_pMv_Proto->g_machine.x._pos_59/(25.4*1000))); + m_Move_to_Y.Format(_T("%f"),(m_pMv_Proto->g_machine.y._pos_59/(25.4*1000))); + m_Move_to_Z.Format(_T("%f"),(m_pMv_Proto->g_machine.z._pos_59/(25.4*1000))); + }; + UpdateData(FALSE); + return TRUE; +}; + +//======================================================================= +// Calculate the auto parameters and populate the edit boxes +// +void CMv_Move_Location::OnEnKillfocusEditMoveToX() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X)) + m_pMv_Proto->g_machine.x._pos_59; + else + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X)); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X)) + m_pMv_Proto->g_machine.x._pos_59; + else + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X)); + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X)) + m_pMv_Proto->g_machine.x._pos_59/(25.4*1000); + else + m_move_to_x = atof((const char *)(LPCTSTR)(m_Move_to_X))*25.4*1000; + }; +// m_pMv_Proto->_calc_speed_acc_dec(move_x, move_y, move_z, move_zm); +} + +//======================================================================= +// Calculate the auto parameters and populate the edit boxes +// +void CMv_Move_Location::OnEnKillfocusEditMoveToY() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y)) + m_pMv_Proto->g_machine.y._pos_59; + else + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y)); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y)) + m_pMv_Proto->g_machine.y._pos_59; + else + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y)); + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y)) + m_pMv_Proto->g_machine.y._pos_59/(25.4*1000); + else + m_move_to_y = atof((const char *)(LPCTSTR)(m_Move_to_Y))*25.4*1000; + }; +} + +//======================================================================= +// Calculate the auto parameters and populate the edit boxes +// +void CMv_Move_Location::OnEnKillfocusEditMoveToZ() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Z)) + m_pMv_Proto->g_machine.z._pos_59; + else + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Z)); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Z)) + m_pMv_Proto->g_machine.z._pos_59; + else + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Z)); + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Y)) + m_pMv_Proto->g_machine.z._pos_59/(25.4*1000); + else + m_move_to_z = atof((const char *)(LPCTSTR)(m_Move_to_Y))*25.4*1000; + }; +} + +//======================================================================= +// Calculate the auto parameters and populate the edit boxes +void CMv_Move_Location::OnEnKillfocusEditMoveToZm() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_zm = atof((const char *)(LPCTSTR)(m_Move_to_ZM)) + m_pMv_Proto->g_machine.zm._pos_59; + else + m_move_to_zm = atof((const char *)(LPCTSTR)(m_Move_to_ZM)); +} + +//======================================================================= +void CMv_Move_Location::OnBnClickedButtonMoveW() +{ + CString str; + GetDlgItem(IDC_EDIT_MOVE_W)->GetWindowText(str); + swscanf_s((LPCTSTR)str, _T("%d"), &m_pMv_Proto->g_machine.r1._deg); + m_pMv_Proto->mv_motion_set_position_r(m_pMv_Proto->g_machine.r1._deg); + m_pMv_Proto->mv_motion_get_position_r(m_pMv_Proto->g_machine.r1._deg); + str.Format(_T("%8ld"),(m_pMv_Proto->g_machine.r1._deg)); + GetDlgItem(IDC_EDIT_MOVE_W)->SetWindowText(str); + +} + +//======================================================================= + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.h new file mode 100644 index 0000000..98055b4 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Move_Location.h @@ -0,0 +1,67 @@ +#pragma once + + +// CMv_Move_Location dialog + +class CMv_Move_Location : public CDialog +{ + DECLARE_DYNAMIC(CMv_Move_Location) + +public: + CMv_Move_Location(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_Move_Location(); + +// Dialog Data + enum { IDD = IDD_MV_UTIL_MOVE_LOCATION }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() + +public: + afx_msg void OnBnClickedStart(); + double m_move_to_x; + double m_move_to_y; + double m_move_to_z; + double m_move_to_zm; + double m_acc_x; + double m_acc_y; + double m_acc_z; + double m_dec_x; + double m_dec_y; + double m_dec_z; + CString m_Move_to_X; + CString m_Move_to_Y; + CString m_Move_to_Z; + CString m_Move_to_ZM; + CString m_Speed_X; + CString m_Speed_Y; + CString m_Speed_Z; + CString m_Acc_X; + CString m_Acc_Y; + CString m_Acc_Z; + CString m_Dec_X; + CString m_Dec_Y; + CString m_Dec_Z; + CString m_Manual_Speed_X; + CString m_Manual_Speed_Y; + CString m_Manual_Speed_Z; + CString m_Manual_Acc_X; + CString m_Manual_Acc_Y; + CString m_Manual_Acc_Z; + CString m_Manual_Dec_X; + CString m_Manual_Dec_Y; + CString m_Manual_Dec_Z; + + AXISMOVE move_x; + AXISMOVE move_y; + AXISMOVE move_z; + AXISMOVE move_zm; + + afx_msg void OnEnKillfocusEditMoveToX(); + afx_msg void OnEnKillfocusEditMoveToY(); + afx_msg void OnEnKillfocusEditMoveToZ(); + afx_msg void OnEnKillfocusEditMoveToZm(); + afx_msg void OnBnClickedButtonMoveW(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Proto_Dump.CPP b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Proto_Dump.CPP new file mode 100644 index 0000000..70c2914 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Proto_Dump.CPP @@ -0,0 +1,1968 @@ +#include "StdAfx.h" +#include "Mv_Util.h" +#include "..\..\..\MicroVu\Mv_Proto.h" +#include "Mv_Proto_Dump.h" + +#define MAX_SUBGROUPS 50 + +char CMv_Proto_Dump::cCurr_Cmd[MAX_IN_BUFF_SIZE]; +//============================================== +union L2C +{ + long _long_; + char _char_[4]; +}; +//============================================== +// if match the following, append to print line +// if all filled, or not matching, start new line. +// Each subgroup will be printed on the same line. +char *cPOSITION_GROUP[] = {"TPX;", + "TPY;", + "TPZ;", + "DP ?;", + "DP ,?;", + "DP ,,?;", + "ABSFLAG=;", + "" +}; + +char *cJS_MOVED_GROUP[] = {"JS_MOVED=;", + "!HWS,?;", + "!HWS?;", + "SC;", + "RPZ;", + "" +}; +char *cTS_XYZ_GROUP[] = {"TS XYZ;", + // "!ISL;", + "" +}; +char *cTS_GROUP[] = {"TSX;", + "TSY;", + "TSZ;", + "" +}; +char *cACDC_GROUP[] = { "AC ", + "DC ", + "AC ,", + "DC ,", + "AC ,,", + "DC ,,", + "" +}; + +char *cBLFL_GROUP[] = {"RPZ;", + "RPXY;", + "BL ?;", + "FL ?;", + "BL ,?;", + "FL ,?;", + "BL ,,?;", + "FL ,,?;", + "" +}; +char *cSP_GROUP[] = { "SP ", + "SP ,", + "SP ,,", + "" +}; + +char *cMISC_GROUP[] = { "TS;", + "IP", + "" +}; + +char *cFORCE_PRINT_GROUP[] = +{ + "!IP", + "" +}; + +char *cCRLF_GROUP[] = { "TSZ;", + "DP ,,?;", + "SC;", + "TS XYZ;", + "FL ,,?;", + "DC ,,", + "SP ,,", + "RPZ;", + "RPXYZ;", + "IP", + "!ISL;", + "TS;", + "" +}; + + +extern CMv_Proto* m_pMv_Proto; + +// ========================================================================================== +// This program reads in the Snoopy Trace data and converts into a linear format. +// Pick out "--" +// Pick out " :" at position 12 +// combine into another one. +// +char *fname = NULL; +static char *inBuff = NULL; +static char *outBuff = NULL; +char *rcv_hdr0 = "*Received : "; +char *ascii_hdr0 = " *Ascii : "; +char *cmd_hdr0 = " *Command : "; +char *lighting_hdr0 = "*Lighting : "; +char *machine_status0 = " Status "; +char rcv_hdr[MAX_OUT_BUFF_SIZE] = "unknown>>>"; +char cmd_hdr[MAX_OUT_BUFF_SIZE] = "unknown<<<"; +char *scale_hdr = " Scale Count : "; +char *blank_hdr = " : "; +char *inches_hdr = " Inches : "; +size_t ptr = 0; +size_t t; +char last_send[256]; +char last_rcv[256]; +char cIP_Buff[256]; +char cIPE_Buff[256]; +char last_mt_send[256]; +char ep_text[24]; +long long g_CntRows; +BOOL bSo7; +// ========================================================================================== +int CMv_Proto_Dump::SendToFile(char* outBuff, _out_type_e _out_type, _machine_e _machine) +{ + switch (_machine) + { + case MACHINE_MICROVU: + bSo7=FALSE; + switch (_out_type) + { + case OUT_DETAIL: + OutputMicroVuDetailLine(outBuff); + fprintf(m_pOutFile, "\n"); + break; + case OUT_CONDENSED: + OutputMicroVuCondensedLine(outBuff); + fprintf(m_pOutFile, "\n"); + break; + case OUT_REPLAY: + OutputMicroVuReplayLine(outBuff); + break; + }; + break; + case MACHINE_MITUTOYO: + bSo7=FALSE; + switch (_out_type) + { + case OUT_DETAIL: + OutputMitutoyoDetailLine(outBuff); + break; + case OUT_CONDENSED: + OutputMitutoyoCondesnedLine(outBuff); + break; + case OUT_REPLAY: + OutputMitutoyoReplayLine(outBuff); + break; + }; + break; + case MACHINE_GENERIC: + bSo7=TRUE; + switch (_out_type) + { + case OUT_DETAIL: + OutputSo7DetailLine(outBuff); + fprintf(m_pOutFile, "\n"); + break; + case OUT_CONDENSED: + OutputReplayGenericLine(outBuff); + break; + case OUT_SEGMENT: + OutputSegmentGenericLine(outBuff); + break; + }; + break; + default: + break; + }; + return 0; +}; + +// ========================================================================================== +int CMv_Proto_Dump::ConcateDmsLine(char *inBuff, char* outBuff) +{ + inBuff[49] = 0; + _clear_blanks(inBuff); + if (strlen(inBuff) > 1) + strcat(outBuff, inBuff); + return 0; +}; + +// ========================================================================================== +int CMv_Proto_Dump::ConcateSnoopyLine(char *inBuff, char* outBuff) +{ + _clear_blanks(inBuff); + if (strlen(inBuff) > 2) + strcat(outBuff,inBuff+9); + return 0; +}; + +// ========================================================================================== +int CMv_Proto_Dump::DoAppendSnoopyOutputLine(char *inBuff, char *outBuff) +{ + for (int i = 0; i<5; i++) + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + while (inBuff[12] == ':') + { + ConcateSnoopyLine(inBuff, outBuff); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + }; + return 0; +}; + +// ========================================================================================== +int CMv_Proto_Dump::DoAppendDmsOutputLine(char *inBuff, char *outBuff) +{ + while (inBuff[0]==' ') + { + ConcateDmsLine(inBuff, outBuff); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + }; + return 0; +}; + +// ========================================================================================== +int CMv_Proto_Dump::MainSnoopyFunction(LPCTSTR fname, _out_type_e _out_type, _machine_e _machine) +{ + + + CString outname_proto; + outname_proto = fname; + static char cPrev = ' '; + + switch (_out_type) + { + case OUT_CONDENSED: + outname_proto += ".extract.txt"; + break; + case OUT_REPLAY: + outname_proto += ".replay.txt"; + break; + case OUT_DETAIL: + outname_proto += ".detail.txt"; + break; + case OUT_SEGMENT: + outname_proto += ".segment.txt"; + break; + }; + inBuff = (char *)malloc(MAX_IN_BUFF_SIZE); + outBuff = (char *)malloc(MAX_OUT_BUFF_SIZE); + + _wfopen_s(&m_pOutFile, outname_proto, _T("wt")); + if (!m_pOutFile) + { + free(inBuff); + free(outBuff); + return(-1); + }; + _wfopen_s(&pInFile, fname, _T("r")); + if (!pInFile) + { + free(inBuff); + free(outBuff); + fclose(m_pOutFile); + return(-1); + }; + memset(outBuff, 0, MAX_OUT_BUFF_SIZE); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // pick up the first line + + while (!feof(pInFile)) + { + if ((strlen(outBuff) > 23))// && (cPrev != *outBuff) + { + SendToFile(outBuff, _out_type, _machine); + cPrev = *outBuff; + memset(outBuff, 0, sizeof(outBuff)); + } + + char *ipos; + ipos = strstr(inBuff, "ms] >>> URB "); + if (ipos) + { + strcpy(outBuff, "> "); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // skip -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + + if (*(inBuff+34) == '[') + { + memcpy(ep_text, (char *)(inBuff+34), 21); + strcat(outBuff, ep_text); + if (inBuff[52] == '0') // pick this up + { + DoAppendSnoopyOutputLine(inBuff, outBuff); + } + else + { + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + + }; + continue; + }; + }; + ipos = strstr(inBuff, "ms] <<< URB "); + if (ipos) + { + strcpy(outBuff, "< "); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // skip -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + + if (*(inBuff+34) == '[') + { + memcpy(ep_text, (char *)(inBuff+34), 21); + strcat(outBuff, ep_text); + if (inBuff[52] == '8') // pick this up + { + DoAppendSnoopyOutputLine(inBuff, outBuff); + } + else + { + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + }; + continue; + }; + } + else + { + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // skip in between lines. + }; + }; + fclose(pInFile); + fclose(m_pOutFile); + free(inBuff); + free(outBuff); + return 0; +} + +// ========================================================================================== +int CMv_Proto_Dump::MainSegmentFunction(LPCTSTR fname, _out_type_e _out_type, _machine_e _machine) +{ + CString outname_proto; + outname_proto = fname; + g_CntRows=0; + + switch (_out_type) + { + case OUT_CONDENSED: + outname_proto += ".extract.txt"; + break; + case OUT_REPLAY: + outname_proto += ".replay.txt"; + break; + case OUT_DETAIL: + outname_proto += ".detail.txt"; + break; + case OUT_SEGMENT: + outname_proto += ".segment.txt"; + break; + }; + inBuff = (char *)malloc(MAX_IN_BUFF_SIZE); + outBuff = (char *)malloc(MAX_OUT_BUFF_SIZE); + + _wfopen_s(&m_pOutFile, outname_proto, _T("wt")); + if (!m_pOutFile) + { + free(inBuff); + free(outBuff); + return(-1); + }; + _wfopen_s(&pInFile, fname, _T("r")); + if (!pInFile) + { + free(inBuff); + free(outBuff); + fclose(m_pOutFile); + return(-1); + }; + memset(outBuff, 0, MAX_OUT_BUFF_SIZE); + fgets((char *)outBuff, MAX_IN_BUFF_SIZE, pInFile ); + g_CntRows++; + while (!feof(pInFile)) + { + fgets((char *)outBuff, MAX_IN_BUFF_SIZE, pInFile ); + g_CntRows++; + + if (g_CntRows<1000) + { + SendToFile(outBuff, _out_type, _machine); + } + + }; + fclose(pInFile); + fclose(m_pOutFile); + free(inBuff); + free(outBuff); + return 0; +} + + +//=========================================================================== +// Remove the ones we are not going to send. +// We can review this file. +// this file basically look like Extract Line. +//=========================================================================== +void CMv_Proto_Dump::OutputMicroVuReplayLine(char *outBuff) +{ + if (strlen(outBuff) > 24) + fprintf(m_pOutFile, outBuff); +}; + +//=========================================================================== +// Remove the ones we are not going to send. +// We can review this file. +// this file basically look like Extract Line. +//=========================================================================== +void CMv_Proto_Dump::OutputReplayGenericLine(char *outBuff) +{ + if (strlen(outBuff) > 22) + { + fprintf(m_pOutFile,"%s", outBuff); + fprintf(m_pOutFile, "\n"); + }; +}; + +//=========================================================================== +void CMv_Proto_Dump::OutputSegmentGenericLine(char *outBuff) +{ + fprintf(m_pOutFile,"%s", outBuff); + +}; + + +//=========================================================================== +// Remove the ones we are not going to send. +// We can review this file. +// this file basically look like Extract Line. +//=========================================================================== +void CMv_Proto_Dump::OutputMitutoyoReplayLine(char *outBuff) +{ + if (strlen(outBuff) > 24) + fprintf(m_pOutFile, outBuff); +}; + +//=========================================================================== +void CMv_Proto_Dump::OutputMitutoyoDetailLine(char *outBuff) +{ + if (strlen(outBuff) > 24) + fprintf(m_pOutFile, outBuff); +}; + +// ========================================================================================== +void CMv_Proto_Dump::OutputMitutoyoCondesnedLine( char* outBuff) +{ + if (strlen(outBuff) > 24) + fprintf(m_pOutFile, outBuff); +}; + +// ========================================================================================== +void CMv_Proto_Dump::DoMicroVuSendDetailLine(char *_outBuff, char *_sendCmd) +{ + fprintf(m_pOutFile, _outBuff); // Send out a condensed line first. + + // if end point is 0x02 + + // We can add more stuff later + if (!_strnicmp("4C03", _sendCmd, 4)) + { + fprintf(m_pOutFile, "\n Set Mag :4C03 "); + Dump_Array_LONG(_outBuff+23+6, 7); + } + else + if (!_strnicmp("4C10", _sendCmd, 4)) + { + fprintf(m_pOutFile, "\n Move Rotary :4C10 "); + fprintf(m_pOutFile, " R1 "); + Dump_Array_LONG(_outBuff+23+4, 1); + fprintf(m_pOutFile, " R2 "); + Dump_Array_LONG(_outBuff+23+12, 1); + fprintf(m_pOutFile, " SP "); + Dump_Array_LONG(_outBuff+23+20, 1); + fprintf(m_pOutFile, " AC "); + Dump_Array_LONG(_outBuff+23+28, 1); + fprintf(m_pOutFile, " ?? "); + Dump_Array_LONG(_outBuff+23+36, 2); + } + else + if (!_strnicmp("5300", _sendCmd, 4)) + { + fprintf(m_pOutFile, "\n Move XYZ :5300 "); + Dump_Array_LONG(_outBuff+23+12, 20); + } + else + if (!_strnicmp("590001", _sendCmd, 6)) // only show poll with data + { + fprintf(m_pOutFile, "\n Poll Status 590001 :"); + fprintf(m_pOutFile, " 10:"); + fputc(*(_outBuff+10), m_pOutFile); + fputc(*(_outBuff+11), m_pOutFile); + fprintf(m_pOutFile, " 12:"); + fputc(*(_outBuff+12), m_pOutFile); + fputc(*(_outBuff+13), m_pOutFile); + fprintf(m_pOutFile, " 20:"); + fputc(*(_outBuff+20), m_pOutFile); + fputc(*(_outBuff+21), m_pOutFile); + fprintf(m_pOutFile, " 22:"); + fputc(*(_outBuff+22), m_pOutFile); + fputc(*(_outBuff+23), m_pOutFile); + fprintf(m_pOutFile, " 32:"); + fputc(*(_outBuff+32), m_pOutFile); + fputc(*(_outBuff+33), m_pOutFile); + fprintf(m_pOutFile, " 34:"); + fputc(*(_outBuff+34), m_pOutFile); + fputc(*(_outBuff+35), m_pOutFile); + fprintf(m_pOutFile, " 36:"); + fputc(*(_outBuff+36), m_pOutFile); + fputc(*(_outBuff+37), m_pOutFile); + fprintf(m_pOutFile, " 38:"); + fputc(*(_outBuff+38), m_pOutFile); + fputc(*(_outBuff+39), m_pOutFile); + fprintf(m_pOutFile, " 68:"); + fputc(*(_outBuff+68), m_pOutFile); + fputc(*(_outBuff+69), m_pOutFile); + fprintf(m_pOutFile, " 70:"); + fputc(*(_outBuff+70), m_pOutFile); + fputc(*(_outBuff+71), m_pOutFile); + } +}; + +// ========================================================================================== +void CMv_Proto_Dump::DoMicroVuReceiveDetailLine(char *outBuff, char *sendCmd) +{ + char *_outBuff = outBuff+23; + char *_sendCmd = sendCmd; + fprintf(m_pOutFile, "\n"); + if (!_strnicmp("28", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Unk :"); + Dump_Array_UINT(_outBuff+4, 8); + } + else + if (!_strnicmp("29", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Config :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("2B", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Servo :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("2C", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Scale :"); + Dump_Array_UINT(_outBuff, 16); + } + else + if (!_strnicmp("4103", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Read Zm Speed :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4110", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Rotary Speed :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4203", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Read Zm Accel :"); + Dump_Array_LONG(_outBuff+6, 1); + } + else + if (!_strnicmp("4210", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Rotary Accel :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4302", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get XYZ ?? :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4303", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Read Mag :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4310", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Read Rotary R1 :"); + Dump_Array_LONG(_outBuff+4, 2); + } + else + if (!_strnicmp("4503", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Read Zm Decel :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4A10", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Rotary Count :"); + Dump_Array_LONG(_outBuff+4, 1); + } + else + if (!_strnicmp("4C02", _sendCmd, 4)) + { + fprintf(m_pOutFile, " ACCEL/DECEL :"); + Dump_Array_LONG(_outBuff+6, 4); + } + else + if (!_strnicmp("4C03", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Move Mag :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4C10", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Move Rotary Reply :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4E00", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Index X :"); + Dump_Array_LONG(_outBuff+6, 1); + } + else + if (!_strnicmp("4E01", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Index Y :"); + Dump_Array_LONG(_outBuff+6, 1); + } + else + if (!_strnicmp("4E02", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Index Z :"); + Dump_Array_LONG(_outBuff+6, 1); + } + else + if (!_strnicmp("4E10", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Index Rotary :"); + Dump_Array_LONG(_outBuff+6, 1); + } + else + if (!_strnicmp("4F00", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Seek Idx X :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4F01", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Seek Idx Y :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4F02", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Seek Idx Z :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4F03", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Seek Idx Zm :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("4F10", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Seek Rot Idx :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("50", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Max XYZZm Speed :"); + Dump_Array_LONG(_outBuff+2, 4); + } + else + if (!_strnicmp("51", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Max XYZZm Accel :"); + Dump_Array_LONG(_outBuff+2, 4); + } + else + if (!_strnicmp("53", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Move XYZ Reply :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("56", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Limits :"); + Dump_Array_LONG(_outBuff+2, 6); + } + else + if (!_strnicmp("58", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Poll 58 :"); + fprintf(m_pOutFile, " X: "); + Dump_Array_LONG(_outBuff+2, 1); + fprintf(m_pOutFile, " Y: "); + Dump_Array_LONG(_outBuff+10, 1); + fprintf(m_pOutFile, " Z: "); + Dump_Array_LONG(_outBuff+18, 1); + fprintf(m_pOutFile, " Zm: "); + Dump_Array_LONG(_outBuff+26, 1); + } + else + if (!_strnicmp("5E", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Stage Limit :"); + Dump_Array_LONG(_outBuff+10,24); + } + else + if (!_strnicmp("60", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Config :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("590100", _sendCmd, 6)) // only show poll with data + { + fprintf(m_pOutFile, " Poll Long Status 00 :"); + fprintf(m_pOutFile, " 10X:"); + fputc(*(_outBuff+10), m_pOutFile); + fputc(*(_outBuff+11), m_pOutFile); + if (*(_outBuff+11) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 12Y:"); + fputc(*(_outBuff+12), m_pOutFile); + fputc(*(_outBuff+13), m_pOutFile); + if (*(_outBuff+13) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 20Z:"); + fputc(*(_outBuff+20), m_pOutFile); + fputc(*(_outBuff+21), m_pOutFile); + if (*(_outBuff+21) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 22Zm:"); + fputc(*(_outBuff+22), m_pOutFile); + fputc(*(_outBuff+23), m_pOutFile); + if (*(_outBuff+23) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 32X:"); + fputc(*(_outBuff+32), m_pOutFile); + fputc(*(_outBuff+33), m_pOutFile); + if (*(_outBuff+33) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 34Y:"); + fputc(*(_outBuff+34), m_pOutFile); + fputc(*(_outBuff+35), m_pOutFile); + if (*(_outBuff+35) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 36Z:"); + fputc(*(_outBuff+36), m_pOutFile); + fputc(*(_outBuff+37), m_pOutFile); + if (*(_outBuff+37) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 38Zm:"); + fputc(*(_outBuff+38), m_pOutFile); + fputc(*(_outBuff+39), m_pOutFile); + if (*(_outBuff+39) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 68R1:"); + fputc(*(_outBuff+68), m_pOutFile); + fputc(*(_outBuff+69), m_pOutFile); + if (*(_outBuff+69) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 70R2:"); + fputc(*(_outBuff+70), m_pOutFile); + fputc(*(_outBuff+71), m_pOutFile); + if (*(_outBuff+71) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + } + else + if (!_strnicmp("590101", _sendCmd, 6)) // only show poll with data + { + fprintf(m_pOutFile, " Poll Long Status 01 :"); + fprintf(m_pOutFile, " 10X:"); + fputc(*(_outBuff+10), m_pOutFile); + fputc(*(_outBuff+11), m_pOutFile); + if (*(_outBuff+11) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 12Y:"); + fputc(*(_outBuff+12), m_pOutFile); + fputc(*(_outBuff+13), m_pOutFile); + if (*(_outBuff+13) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 20Z:"); + fputc(*(_outBuff+20), m_pOutFile); + fputc(*(_outBuff+21), m_pOutFile); + if (*(_outBuff+21) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 22Zm:"); + fputc(*(_outBuff+22), m_pOutFile); + fputc(*(_outBuff+23), m_pOutFile); + if (*(_outBuff+23) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 32X:"); + fputc(*(_outBuff+32), m_pOutFile); + fputc(*(_outBuff+33), m_pOutFile); + if (*(_outBuff+33) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 34Y:"); + fputc(*(_outBuff+34), m_pOutFile); + fputc(*(_outBuff+35), m_pOutFile); + if (*(_outBuff+35) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 36Z:"); + fputc(*(_outBuff+36), m_pOutFile); + fputc(*(_outBuff+37), m_pOutFile); + if (*(_outBuff+37) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 38Zm:"); + fputc(*(_outBuff+38), m_pOutFile); + fputc(*(_outBuff+39), m_pOutFile); + if (*(_outBuff+39) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 68R1:"); + fputc(*(_outBuff+68), m_pOutFile); + fputc(*(_outBuff+69), m_pOutFile); + if (*(_outBuff+69) == '1') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fprintf(m_pOutFile, " 70R2:"); + fputc(*(_outBuff+70), m_pOutFile); + fputc(*(_outBuff+71), m_pOutFile); + if (*(_outBuff+71) == '0') + fprintf(m_pOutFile, " moving "); + else + fprintf(m_pOutFile, " stopped "); + fputc(' ', m_pOutFile); + fprintf(m_pOutFile, "R1 "); + Dump_Array_LONG(_outBuff+76, 1); + fprintf(m_pOutFile, "R2 "); + Dump_Array_LONG(_outBuff+84, 1); + fprintf(m_pOutFile, "?? "); + Dump_Array_LONG(_outBuff+92, 4); + } + else + if (!_strnicmp("6500", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Unk 65 :"); + Dump_BYTES(_outBuff+4, 16); + } + else + if (!_strnicmp("66", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Rotary Comp :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("69", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Set Config :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("6F", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Signature :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("70", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Get Light :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("76", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Max XYZZm Decel :"); + Dump_Array_LONG(_outBuff+2, 4); + } + else + if (!_strnicmp("7C03", _sendCmd, 4)) + { + fprintf(m_pOutFile, " Get Zm Slack count :"); + Dump_Array_UINT(_outBuff+4, 1); + } + else + if (!_strnicmp("7D", _sendCmd, 2)) + { + fprintf(m_pOutFile, " Rotary ID :"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("590100", _sendCmd, 6)) + { + fprintf(m_pOutFile, " 590100 *:"); + fprintf(m_pOutFile, _outBuff); + } + else + if (!_strnicmp("000101", _sendCmd, 6)) + { + fprintf(m_pOutFile, " Callback Status :"); + fprintf(m_pOutFile, " X: "); + Dump_Array_LONG(_outBuff, 1); + fprintf(m_pOutFile, " Y: "); + Dump_Array_LONG(_outBuff+8, 1); + fprintf(m_pOutFile, " Z: "); + Dump_Array_LONG(_outBuff+16, 1); + fprintf(m_pOutFile, " Zm: "); + Dump_Array_LONG(_outBuff+24, 1); + } + else + { + fprintf(m_pOutFile, " UNK ??????? *:"); + fprintf(m_pOutFile, _outBuff); + }; +}; + + +//=========================================================================================== + +// ========================================================================================== +void CMv_Proto_Dump::DoSo7SendDetailLine(char *outBuff, char *sendCmd) +{ + char *_outBuff = outBuff+23; + char *_sendCmd = sendCmd; + //union L2C X,Y,Z; + + fprintf(m_pOutFile, "\n"); + + if (!_strnicmp("0100", _sendCmd, 4)) + { + fprintf(m_pOutFile, "MOVE X :"); + fprintf(m_pOutFile, " Gear "); + Dump_BYTES(_outBuff+4,2); + } + else if (!_strnicmp("0101", _sendCmd, 4)) + { + fprintf(m_pOutFile, "MOVE Y :"); + fprintf(m_pOutFile, " Gear "); + Dump_BYTES(_outBuff+4,2); + } + else if (!_strnicmp("0102", _sendCmd, 4)) + { + fprintf(m_pOutFile, "MOVE Z :"); + fprintf(m_pOutFile, " Gear "); + Dump_BYTES(_outBuff+4,2); + } + else if (!_strnicmp("0119", _sendCmd, 4)) + { + fprintf(m_pOutFile, "STOP XYZ :"); + } + else if (!_strnicmp("0141", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET WHEELBASE :"); + fprintf(m_pOutFile, " X: "); + Dump_BYTES(_outBuff+4,8); + fprintf(m_pOutFile, " Y: "); + Dump_BYTES(_outBuff+12, 8); + fprintf(m_pOutFile, " Z: "); + Dump_BYTES(_outBuff+20, 8); + + } + else if (!_strnicmp("014b", _sendCmd, 4)) + { + fprintf(m_pOutFile, "LASER EN :"); + } + else if (!_strnicmp("014c", _sendCmd, 4)) + { + fprintf(m_pOutFile, "PROBE ON :"); + } + else if (!_strnicmp("014e", _sendCmd, 4)) + { + fprintf(m_pOutFile, "MOVETO :"); + fprintf(m_pOutFile, " X: "); + Dump_Array_LONG(_outBuff+4,1); + fprintf(m_pOutFile, " Y: "); + Dump_Array_LONG(_outBuff+10, 1); + fprintf(m_pOutFile, " Z: "); + Dump_Array_LONG(_outBuff+16, 1); + } + else if (!_strnicmp("0148", _sendCmd, 4)) + { + fprintf(m_pOutFile, "HOME LEFT :"); + } + else if (!_strnicmp("0153", _sendCmd, 4)) + { + fprintf(m_pOutFile, "BCL ON :"); + } + else if (!_strnicmp("0154", _sendCmd, 4)) + { + fprintf(m_pOutFile, "BCL OFF :"); + } + else if (!_strnicmp("0216", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET SECTION X :"); + } + else if (!_strnicmp("0217", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET SECTION Y :"); + } + else if (!_strnicmp("021a", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET LINE X :"); + } + else if (!_strnicmp("021b", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET LINE Y :"); + } + else if (!_strnicmp("021c", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET LINE Z :"); + } + else if (!_strnicmp("021f", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET VER NO. :"); + Dump_BYTES(_outBuff+4,2); + } + else if (!_strnicmp("0309", _sendCmd, 4)) + { + fprintf(m_pOutFile, "SET LIGHT :"); + fprintf(m_pOutFile, " BOT: "); + Dump_BYTES(_outBuff+6,2); + fprintf(m_pOutFile, " TOP: "); + Dump_BYTES(_outBuff+8, 2); + fprintf(m_pOutFile, " RING: "); + Dump_BYTES(_outBuff+10, 2); + fprintf(m_pOutFile, " COA: "); + Dump_BYTES(_outBuff+12, 2); + fprintf(m_pOutFile, " NONE: "); + Dump_BYTES(_outBuff+14, 2); + fprintf(m_pOutFile, " RING_INNER_SEG: "); + Dump_BYTES(_outBuff+16, 2); + fprintf(m_pOutFile, " RING_OUTER_SEG: "); + Dump_BYTES(_outBuff+18, 2); + } + else if (!_strnicmp("0500", _sendCmd, 4)) + { + + } + else if (!_strnicmp("055a", _sendCmd, 4)) + { + } + else + { + fprintf(m_pOutFile, _outBuff); + }; + +}; + +// ========================================================================================== +void CMv_Proto_Dump::DoSo7ReceiveDetailLine(char *outBuff, char *sendCmd) +{ + char *_outBuff = outBuff+23; + char *_sendCmd = sendCmd; + fprintf(m_pOutFile, "\n"); + if(!_strnicmp("0301", _outBuff, 4)) + { + fprintf(m_pOutFile, "Motion Finished :"); + } + else if (!_strnicmp("0500", _sendCmd, 4)) + { + fprintf(m_pOutFile, "Get XYZ :"); + Dump_Array_LONG(_outBuff,3); + } + else if (!_strnicmp("055a", _sendCmd, 4)) + { + fprintf(m_pOutFile, "Get V :"); + Dump_Array_LONG(_outBuff,1); + } + else + { + fprintf(m_pOutFile, "SO7 ??????? *:"); + //fprintf(m_pOutFile, _outBuff); + }; +}; + + +// ========================================================================================== +void CMv_Proto_Dump::OutputMicroVuCondensedLine(char *outBuff) +{ + fprintf(m_pOutFile, outBuff); +}; + +// ========================================================================================== +// Analyze Dms Trace +// ========================================================================================== +int CMv_Proto_Dump::MainDmsFunction(LPCTSTR fname, _out_type_e _out_type, _machine_e _machine) +{ + CString outname_proto; + outname_proto = fname; + static char cPrev; + + char _ep[24] = "[endpoint 0x0000000_]"; + switch (_out_type) + { + case OUT_CONDENSED: + outname_proto += ".condensed.txt"; + break; + case OUT_REPLAY: + outname_proto += ".replay.txt"; + break; + case OUT_DETAIL: + outname_proto += ".detail.txt"; + break; + }; + inBuff = (char *)malloc(MAX_IN_BUFF_SIZE); + outBuff = (char *)malloc(MAX_OUT_BUFF_SIZE); + _wfopen_s(&m_pOutFile, outname_proto, _T("wt")); + if (!m_pOutFile) + { + MessageBox(NULL, _T("Unable to open output file."), _T("Error Message"), MB_OK); + return(-1); + }; + _wfopen_s(&pInFile, fname, _T("r")); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // pick up the first line + if (feof(pInFile)) goto exit; + memset(outBuff, 0, sizeof(outBuff)); + while (!feof(pInFile)) + { + if (strstr(inBuff, "Pipe Handle:")) + { + if (inBuff[45] == '8') + { + _ep[18] = inBuff[45]; + _ep[19] = inBuff[46]; + } + else + { + _ep[18] = '0'; + _ep[19] = inBuff[45]; + } + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); + }; + + if (strncmp(inBuff, "Send", 4) == 0) + { + if ((strlen(outBuff) > 24) && (cPrev != *outBuff)) + { + SendToFile(outBuff, _out_type, _machine); + cPrev = *outBuff; + memset(outBuff, 0, sizeof(outBuff)); + } + strcpy(outBuff, "> "); + strcat(outBuff, _ep); + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); + if (feof(pInFile)) goto exit; + DoAppendDmsOutputLine(inBuff, outBuff); + SendToFile(outBuff, _out_type, _machine); + cPrev = *outBuff; + memset(outBuff, 0, sizeof(outBuff)); + } + else + if (strncmp(inBuff, "Get", 3) == 0) + { + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); + if (feof(pInFile)) goto exit; + if (strlen(outBuff) == 0) + { + strcpy(outBuff, "< "); + strcat(outBuff, _ep); + }; + DoAppendDmsOutputLine(inBuff, outBuff); + } + fgets((char *)inBuff, MAX_IN_BUFF_SIZE, pInFile ); // + if (feof(pInFile)) goto exit; + }; +exit: + fclose(pInFile); + fclose(m_pOutFile); + free(inBuff); + free(outBuff); + return 0; +} + +//===================================================================================== +void CMv_Proto_Dump::Print_Line(int iLen, unsigned char *cBuff) +{ + int k; + for (k=0; k1) && (k%16 == 0)) fprintf(m_pOutFile, "\n"); + fprintf(m_pOutFile, "%2.2X", *(cBuff+k)); + if (k%2>0) fprintf(m_pOutFile, " "); + }; + if ((k-1)%32 != 0) + fprintf(m_pOutFile, "\n"); +}; + +//===================================================================================== +// +//===================================================================================== +void CMv_Proto_Dump::Dump_Array_LONG(char *cBuff, int iLen) +{ + char cLong_array[64][9]; + long lLong_array[64]; + for (int i=0;ii; i++) + { + iLen = strlen(cPOSITION_GROUP[i]); + if (iLen == 0) break; + if (!_strnicmp(cBuff, cPOSITION_GROUP[i], iLen)) + { + Build_Mitutoyo_Print_Line(matrix_print_line, cBuff); + return; + }; + }; + + for (int i=0; MAX_SUBGROUPS>i; i++) + { + iLen = strlen(cJS_MOVED_GROUP[i]); + if ( iLen == 0) break; + if (!_strnicmp(cBuff, cJS_MOVED_GROUP[i], iLen)) + { + Build_Mitutoyo_Print_Line(matrix_print_line, cBuff); + return; + }; + }; + + for (int i=0; MAX_SUBGROUPS > i; i++) + { + iLen = strlen(cTS_XYZ_GROUP[i]); + if ( iLen == 0) break; + if (!_strnicmp(cBuff, cTS_XYZ_GROUP[i], iLen)) + { + Build_Mitutoyo_Print_Line(matrix_print_line, cBuff); + return; + }; + }; + + for (int i=0; i') // Process outgoing commands// + { + _sendCmd[0] = *(outBuff+23); + _sendCmd[1] = *(outBuff+24); + _sendCmd[2] = *(outBuff+25); + _sendCmd[3] = *(outBuff+26); + _sendCmd[4] = *(outBuff+27); + _sendCmd[5] = *(outBuff+28); + _sendCmd[6] = 0; + DoMicroVuSendDetailLine(outBuff, _sendCmd); + } + else + { + }; + // +}; +//================================================================= +//detail foe so7 + +//=================================================================== +//=================================================================== +void CMv_Proto_Dump::OutputSo7DetailLine(char *outBuff) +{ + static char _sendCmd[7]; + if (strlen(outBuff) < 20) + return; + // + if (*outBuff == '<') // Process incoming commands// + { + fprintf(m_pOutFile, outBuff); // first print the condensed line. + DoSo7ReceiveDetailLine(outBuff, _sendCmd); + memset(_sendCmd, 0, sizeof(_sendCmd)); + } + else if (*outBuff == '>') // Process outgoing commands// + { + _sendCmd[0] = *(outBuff+23); + _sendCmd[1] = *(outBuff+24); + _sendCmd[2] = *(outBuff+25); + _sendCmd[3] = *(outBuff+26); + _sendCmd[4] = *(outBuff+27); + _sendCmd[5] = *(outBuff+28); + _sendCmd[6] = 0; + DoSo7SendDetailLine(outBuff, _sendCmd); + } + else + { + }; + // +}; + + + +/* +//=================================================================== +void CMv_Proto_Dump::OutputMitutoyoDetailLine(char *cBuff) +{ +char cResult[MAX_BUFF_SIZE]; +// prep command prefix +strcpy(cmd_hdr, "\n "); +strcat(cmd_hdr, cmd_hdr0); +// +int iLen = strlen(cBuff+0x22); +char ch = *(cBuff+21); +if (iLen == 0) +{ +return; +} +else +if (ch == '1') +{ +// prep ascii prefix +strcpy(rcv_hdr, "\n "); +strcat(rcv_hdr, ascii_hdr0); +fprintf(m_pOutFile, rcv_hdr); +Dump_Array_Ascii(cBuff+35, ch, cResult); +strcpy(last_mt_send, cResult); +} +else +if (ch == '2') +{ +// prep ascii prefix +strcpy(rcv_hdr, "\n "); +strcat(rcv_hdr, ascii_hdr0); +fprintf(m_pOutFile, rcv_hdr); +Dump_Array_Ascii(cBuff+35, ch, cResult); +} +else +{ +if (ch == '3') +{ +// prep lighting prefix +strcpy(rcv_hdr, "\n "); +strcat(rcv_hdr, cmd_hdr0); +} +else +{ +// prep lighting prefix +strcpy(rcv_hdr, "\n "); +strcat(rcv_hdr, lighting_hdr0); +}; +fprintf(m_pOutFile, rcv_hdr); +Dump_Lighting(cBuff+35, ch); +} +}; +*/ + +//=================================================================== +const char *CMv_Proto_Dump::byte_to_binary ( int x ) +{ + static char b[9]; + b[0] = '\0'; + + int z; + for (z = 256; z > 0; z >>= 1) + { + strcat(b, ((x & z) == z) ? "1" : "0"); + } + + return b; +} + +/* +int main(void) +{ +{ +// binary string to int + +char *tmp; +char *b = "0101"; + +printf("%d\n", strtol(b, &tmp, 2)); +} + +{ +// byte to binary string + +printf("%s\n", byte_to_binary(5)); +} + +return 0; +} +*/ + +//===================================================================================== +CMv_Proto_Dump::CMv_Proto_Dump(void) +{ + memset(matrix_print_line, 0, MAX_BUFF_SIZE); + memset(cSC_Data, 0, MAX_BUFF_SIZE); + memset(cISL_Data, 0, MAX_BUFF_SIZE); + memset(cTSX_Data, 0, MAX_BUFF_SIZE); + memset(cTSY_Data, 0, MAX_BUFF_SIZE); + memset(cTSZ_Data, 0, MAX_BUFF_SIZE); + bPrint_Data_Matrix_Ready = false; +} + +//===================================================================================== +CMv_Proto_Dump::~CMv_Proto_Dump(void) +{ +} + +//===================================================================================== +void CMv_Proto_Dump::_clear_blanks(char *cBuff) +{ + char pBuff[MAX_BUFF_SIZE]; + int j = strlen(cBuff); + int k = 0; + for (int i=0; iGetCheck()) + _machine = MACHINE_MICROVU; // MicroVu + else + if (((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->GetCheck()) + _machine = MACHINE_MITUTOYO; // Mitutoyo + else + _machine = MACHINE_GENERIC; // Generic + + _out_type_e _out_type; + if (((CButton *)GetDlgItem(IDC_RADIO_FULL))->GetCheck()) + _out_type = OUT_DETAIL; + else + if (((CButton *)GetDlgItem(IDC_RADIO_EXTRACT))->GetCheck()) + _out_type = OUT_CONDENSED; + else + if (((CButton *)GetDlgItem(IDC_RADIO_REPLAY_FILE))->GetCheck()) + _out_type = OUT_REPLAY; // Replay + else + _out_type=OUT_SEGMENT; + + CMv_Proto_Dump* mv_proto_dump = new CMv_Proto_Dump; + cMsg = _T("Sytem Ready."); + + _fmt_e _fmt; + if (((CButton *)GetDlgItem(IDC_RADIO_FORMAT_SNOOPY))->GetCheck()) + _fmt = FMT_SNOOPY; + else + _fmt = FMT_DMS; + + if (_out_type == OUT_SEGMENT) + { + if (mv_proto_dump->MainSegmentFunction(m_csLogFile, _out_type, _machine)) + { + cMsg += _T("\r\nSnoopy Input File not found."); + } else { + cMsg += _T("\r\nInput File :") + m_csLogFile; + cMsg += _T("\r\nMachine Signature : "); + cMsg += m_pMv_Proto->g_machine.s_machine_config._str_6f00_signature; + cMsg += _T("\r\n7000 Lighting Signature : "); + cMsg += m_pMv_Proto->g_machine.s_machine_config._str_7000_signature; + cMsg += _T("\r\n "); + cMsg += m_csLogFile; + cMsg += _T("\r\nProcessing Completed."); + }; + + } + else + { + switch (_fmt) + { + case FMT_SNOOPY: + if (mv_proto_dump->MainSnoopyFunction(m_csLogFile, _out_type, _machine)) + { + cMsg += _T("\r\nSnoopy Input File not found."); + } else { + cMsg += _T("\r\nInput File :") + m_csLogFile; + cMsg += _T("\r\nMachine Signature : "); + cMsg += m_pMv_Proto->g_machine.s_machine_config._str_6f00_signature; + cMsg += _T("\r\n7000 Lighting Signature : "); + cMsg += m_pMv_Proto->g_machine.s_machine_config._str_7000_signature; + cMsg += _T("\r\n "); + cMsg += m_csLogFile; + cMsg += _T("\r\nProcessing Completed."); + }; + break; + case FMT_DMS: + if (mv_proto_dump->MainDmsFunction(m_csLogFile, _out_type, _machine)) + { + cMsg += _T("\r\nDms Input File not found."); + } else { + cMsg += _T("\r\n"); + cMsg += m_csLogFile; + cMsg += _T("\r\nProcessing Completed."); + }; + break; + default: + break; + }; + } + delete mv_proto_dump; + GetDlgItem(IDC_EDIT_MESSAGE)->SetWindowText(cMsg); + MessageBox( _T("Processing Completed."), _T("Message"), MB_OK); +} + +//============================================================================= +BOOL CMv_ProtocolAnalyzerDlg::OnInitDialog() +{ + ((CButton *)GetDlgItem(IDC_RADIO_FORMAT_SNOOPY))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_FORMAT_DMS))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_EXTRACT))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_FULL))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_GENERIC))->SetCheck(0); + switch (m_machine) + { + case 0: + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_GENERIC))->SetCheck(1); + break; + case 1: + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MICROVU))->SetCheck(1); + break; + case 2: + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_MITUTOYO))->SetCheck(1); + break; + default: + ((CButton *)GetDlgItem(IDC_RADIO_MACHINE_GENERIC))->SetCheck(1); + break; + }; + GetDlgItem(IDC_EDIT_MESSAGE)->SetWindowText(_T("System Ready.")); + return TRUE; +}; + +//=========================================================================== +void CMv_ProtocolAnalyzerDlg::OnBnClickedButtonBrowse() +{ + CString strFilters; + CString strExt; + strFilters = _T("All Files (*.*)|*.*||"); + strExt = _T("Log"); + m_csLogFile = "UsbSnoop.Log"; + CFileDialog fileDlg(TRUE, strExt, (LPCTSTR) m_csLogFile, OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, strFilters, this); + + if ( fileDlg.DoModal ()==IDOK ) + { + m_csLogFile = fileDlg.GetPathName(); + GetDlgItem(IDC_EDIT_INPUT_FILE)->SetWindowText(m_csLogFile); + } + delete fileDlg; +} + +//=========================================================================== +void CMv_ProtocolAnalyzerDlg::OnBnClickedCancel() +{ + CDialogEx::OnCancel(); +} + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ProtocolAnalyzerDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ProtocolAnalyzerDlg.h new file mode 100644 index 0000000..81fb196 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_ProtocolAnalyzerDlg.h @@ -0,0 +1,27 @@ +#pragma once +#include "..\..\..\MicroVu\Mv_Proto.h" + +// CMv_ProtocolAnalyzerDlg dialog + +class CMv_ProtocolAnalyzerDlg : public CDialogEx +{ + DECLARE_DYNAMIC(CMv_ProtocolAnalyzerDlg) + +public: + CMv_ProtocolAnalyzerDlg(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_ProtocolAnalyzerDlg(); + +// Dialog Data + enum { IDD = IDD_DIALOG_PROTOCOL_ANALYZER }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedOk(); + CString m_csLogFile; + afx_msg void OnBnClickedButtonBrowse(); + int m_machine; + afx_msg void OnBnClickedCancel(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.cpp new file mode 100644 index 0000000..6da5a66 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.cpp @@ -0,0 +1,106 @@ +// Mv_SetLights.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "Mv_SetLights.h" +#include "afxdialogex.h" + +#include "..\..\..\MicroVu\Mv_Proto.h" + +extern CMv_Proto* m_pMv_Proto; + +// CMv_SetLights dialog + +IMPLEMENT_DYNAMIC(CMv_SetLights, CDialog) + +CMv_SetLights::CMv_SetLights(CWnd* pParent /*=NULL*/) + : CDialog(CMv_SetLights::IDD, pParent) +{ + +} + +CMv_SetLights::~CMv_SetLights() +{ +} + +void CMv_SetLights::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CMv_SetLights, CDialog) + ON_BN_CLICKED(IDC_BUTTON_ALL_ON, &CMv_SetLights::OnBnClickedButtonAllOn) + ON_BN_CLICKED(IDOK, &CMv_SetLights::OnBnClickedOk) + ON_BN_CLICKED(IDC_BUTTON_ALL_OFF, &CMv_SetLights::OnBnClickedButtonAllOff) +END_MESSAGE_MAP() + +//========================================================================= +// CMv_SetLights message handlers +//========================================================================= +// Set the lighting values +void CMv_SetLights::OnBnClickedButtonAllOn() +{ + if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 3) + { + m_pMv_Proto->g_machine.s_lights_300._axial_light = 150; + m_pMv_Proto->g_machine.s_lights_300._bottom_light = 150; + } + else +// if (g_machine.s_machine_config._vector_light_model == 2) + { + m_pMv_Proto->g_machine.s_lights_200._axial_light = 150; + m_pMv_Proto->g_machine.s_lights_200._bottom_light = 150; + }; + m_pMv_Proto->mv_set_full_ringlight_data(150); + m_pMv_Proto->mv_light_set_light(); +} + +//========================================================================= +// Set the lighting values (6e) +//========================================================================= +void CMv_SetLights::OnBnClickedOk() +{ + CString str; + UINT val; + + OnBnClickedButtonAllOff(); + if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 3) + { + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->GetWindowText(str); + val = _wtoi(str); + m_pMv_Proto->g_machine.s_lights_300._axial_light = val; + + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->GetWindowText(str); + val = _wtoi(str); + m_pMv_Proto->g_machine.s_lights_300._bottom_light = val; + } + else + { + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->GetWindowText(str); + val = _wtoi(str); + m_pMv_Proto->g_machine.s_lights_200._axial_light = val; + + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->GetWindowText(str); + val = _wtoi(str); + m_pMv_Proto->g_machine.s_lights_200._bottom_light = val; + }; + m_pMv_Proto->mv_light_set_light(); + + // CDialog::OnOK(); +} + +//========================================================================= +// Set the lighting values (6e) +//========================================================================= +void CMv_SetLights::OnBnClickedButtonAllOff() +{ + m_pMv_Proto->mv_light_set_light_off(); +} + +//========================================================================= +BOOL CMv_SetLights::OnInitDialog() +{ + UpdateData(FALSE); + return TRUE; +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.h new file mode 100644 index 0000000..e4fedac --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_SetLights.h @@ -0,0 +1,25 @@ +#pragma once + + +// CMv_SetLights dialog + +class CMv_SetLights : public CDialog +{ + DECLARE_DYNAMIC(CMv_SetLights) + +public: + CMv_SetLights(CWnd* pParent = NULL); // standard constructor + virtual ~CMv_SetLights(); + +// Dialog Data + enum { IDD = IDD_DIALOG_SET_LIGHTS }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedButtonAllOn(); + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedButtonAllOff(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.cpp new file mode 100644 index 0000000..a56f5b5 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.cpp @@ -0,0 +1,103 @@ + +// Mv_Util.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "afxdialogex.h" +#include "Mv_Util.h" +#include "Mv_MainDlg.h" + + +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "ProcessButton.h" +#include "VideoCardDefine.h" +#include "..\..\..\Videocard\SDK3000\sdk3000_7130.h" +#include "Videocard_SDK3000.h" +#include "..\..\..\Videocard\SV2000E\datastru.h" +#include "..\..\..\Videocard\SV2000E\DXMediaCap.h" +#include "..\..\..\Videocard\SV2000E\dataAcq.h" +#include "Videocard_SV2000E.h" +#include "SO7_UtilDlg.h" +#include "afxdialogex.h" +#include "So7_Option.h" + + +//#define _ONLY_USE_FOR_SO7 + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +// CMv_UtilApp + +BEGIN_MESSAGE_MAP(CMv_UtilApp, CWinAppEx) + ON_COMMAND(ID_HELP, &CWinApp::OnHelp) +END_MESSAGE_MAP() + +// CMv_UtilApp construction + +CMv_UtilApp::CMv_UtilApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + + +// The one and only CMv_UtilApp object + +CMv_UtilApp theApp; + +// CMv_UtilApp initialization + +BOOL CMv_UtilApp::InitInstance() +{ + // InitCommonControlsEx() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // Set this to include all the common control classes you want to use + // in your application. + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + CWinAppEx::InitInstance(); + + AfxEnableControlContainer(); + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need + // Change the registry key under which our settings are stored + // TODO: You should modify this string to be something appropriate + // such as the name of your company or organization + SetRegistryKey(_T("Local AppWizard-Generated Applications")); + +#ifdef _ONLY_USE_FOR_SO7 + CSo7_Option pSo7_Option; + m_pMainWnd = &pSo7_Option; + INT_PTR nResponse = pSo7_Option.DoModal(); +#else + CMv_MainDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); +#endif + + + + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.h new file mode 100644 index 0000000..f598182 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.h @@ -0,0 +1,32 @@ + +// Mv_Util.h : main header file for the PROJECT_NAME application +// + +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + + +// CMv_UtilApp: +// See Mv_Util.cpp for the implementation of this class +// + +class CMv_UtilApp : public CWinAppEx +{ +public: + CMv_UtilApp(); + +// Overrides + public: + virtual BOOL InitInstance(); + +// Implementation + + DECLARE_MESSAGE_MAP() +}; + +extern CMv_UtilApp theApp; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.rc b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.rc new file mode 100644 index 0000000..ea0809b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.rc @@ -0,0 +1,1477 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Chinese (Simplified, PRC) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) +LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED +#pragma code_page(936) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_SO7_UTIL_DIALOG DIALOGEX 0, 0, 418, 486 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "SevenOcean Utility" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Start_Machine",IDC_BUTTON_START_SO7MACHINE,23,40,63,18 + PUSHBUTTON "Stop_Machine",IDC_BUTTON_STOP_SO7MACHINE,23,75,63,18 + PUSHBUTTON "Read XYZ Axis",IDC_BUTTON_SO7_READ_AXIS_XYZ,132,28,62,13 + PUSHBUTTON "Read Probe Axis",IDC_BUTTON_READ_PROBE,132,47,62,13 + PUSHBUTTON "Read V Axis",IDC_BUTTON_SO7_READ_AXIS_V,132,66,62,13 + PUSHBUTTON "Get Fixture Value",IDC_BUTTON_GET_FIXTURE_FLAG,132,85,62,13 + PUSHBUTTON "Get Reset Flag",IDC_BUTTON_SO7_GET_RESET_FLAG,132,104,62,13 + EDITTEXT IDC_EDIT_AXIAL_LIGHT,261,27,41,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_BOTTOM_LIGHT,261,41,41,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_RING_LIGHT,261,55,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_COAXIAL_LIGHT3,261,69,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_COAXIAL_LIGHT4,261,83,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_COAXIAL_LIGHT,261,97,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_COAXIAL_LIGHT2,261,111,41,12,ES_AUTOHSCROLL + PUSHBUTTON "Motion",IDC_BUTTON_LOAD_SO7CONFIG,20,143,44,23,BS_MULTILINE + PUSHBUTTON "V+",IDC_BUTTON_SO7_MOVE_ZOOM_IN,77,159,25,12 + PUSHBUTTON "V-",IDC_BUTTON_SO7_MOVE_ZOOM_OUT,77,180,25,12 + PUSHBUTTON "Z+",IDC_BUTTON_SO7_MOVE_Z_UP,112,152,25,12 + PUSHBUTTON "Z-",IDC_BUTTON_SO7_MOVE_Z_DOWN,112,186,25,12 + PUSHBUTTON "X-",IDC_BUTTON_SO7_MOVE_X_LEFT,128,169,25,12 + PUSHBUTTON "Y+",IDC_BUTTON_SO7_MOVE_Y_FRONT,154,159,25,12 + PUSHBUTTON "Y-",IDC_BUTTON_SO7_MOVE_Y_BACK,154,180,25,12 + PUSHBUTTON "X+",IDC_BUTTON_SO7_MOVE_X_RIGHT,180,169,25,12 + CONTROL "Fourth",IDC_RADIO_SPEED_GEAR4,"Button",BS_AUTORADIOBUTTON | WS_GROUP,216,190,37,10 + CONTROL "Third",IDC_RADIO_SPEED_GEAR3,"Button",BS_AUTORADIOBUTTON,216,175,32,10 + CONTROL "Second",IDC_RADIO_SPEED_GEAR2,"Button",BS_AUTORADIOBUTTON,216,160,39,10 + CONTROL "First",IDC_RADIO_SPEED_GEAR1,"Button",BS_AUTORADIOBUTTON,216,145,30,10 + PUSHBUTTON "Home XYZ",IDC_BUTTON_SO7_RESET_XYZ,274,140,76,14,BS_MULTILINE + PUSHBUTTON "Hoom Manual",IDC_BUTTON_MANUAL_HOME,274,157,76,14 + PUSHBUTTON "Home Worktable Left",IDC_BUTTON_RESET_WORKTABLE,274,174,76,14 + PUSHBUTTON "Home Worktable Right",IDC_BUTTON_RESET_WORKTABLE_RIGHT,274,191,76,14 + PUSHBUTTON "Move\n To",IDC_BUTTON_MOVE_TO,359,142,32,27,BS_MULTILINE + PUSHBUTTON "Auto Zoom",IDC_BUTTON_AUTO_ZOOM,359,177,32,27,BS_MULTILINE + PUSHBUTTON "Set Reset Flag",IDC_BUTTON_SET_RESET_FLAG,27,234,61,14 + PUSHBUTTON "To Get Laser",IDC_BUTTON_GET_LASER,93,234,61,14 + PUSHBUTTON "Home V",IDC_BUTTON_RESET_V,159,234,61,14 + EDITTEXT IDC_EDIT_LIGHT_SIZE_VALUE,349,92,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_LIGHT_SWITCH,349,108,41,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_X_SCALE_COEFFICIENT,46,284,54,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_Y_SCALE_COEFFICIENT,109,284,54,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_Z_SCALE_COEFFICIENT,172,284,54,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SET_VER_NO,325,279,45,14,ES_AUTOHSCROLL + GROUPBOX "USB Control",IDC_STATIC,15,12,89,115 + GROUPBOX "Config",IDC_STATIC,13,129,55,83 + GROUPBOX "Get_Data",IDC_STATIC,114,13,98,115 + GROUPBOX "Cmd",IDC_STATIC,17,216,378,46 + PUSHBUTTON "ǰ̽ͷ",IDC_BUTTON_PROBE_ONOFF,231,231,48,20,BS_MULTILINE + PUSHBUTTON "ǰ״̬о߿",IDC_BUTTON_FIXTURE_ONOFF,285,231,48,20,BS_MULTILINE + PUSHBUTTON "ǰ״̬о",IDC_BUTTON_FIXTURE_UPDOWN,339,231,48,20,BS_MULTILINE + GROUPBOX "Ver NO.",IDC_STATIC,252,265,145,37 + LTEXT "Set Ver NO.",IDC_STATIC,273,282,39,8 + GROUPBOX "Common Cmd",IDC_STATIC,253,307,144,54 + CONTROL "X",IDC_RADIO_SELECT_X,"Button",BS_AUTORADIOBUTTON,274,316,20,10 + CONTROL "Y",IDC_RADIO_SELECT_Y,"Button",BS_AUTORADIOBUTTON,317,316,20,10 + CONTROL "Z",IDC_RADIO_SELECT_Z,"Button",BS_AUTORADIOBUTTON,360,316,20,10 + PUSHBUTTON "Set Section",IDC_BUTTON_SET_SECTION,271,336,46,21,BS_MULTILINE + PUSHBUTTON "Correction Scale",IDC_BUTTON_CORRECTION_SCALE,327,336,46,21,BS_MULTILINE + GROUPBOX "Light Control",IDC_STATIC,226,14,85,113 + LTEXT "Top",IDC_STATIC,236,28,18,11 + LTEXT "Bottom",IDC_STATIC,234,43,22,11 + LTEXT "Ring",IDC_STATIC,235,58,15,8 + LTEXT "Coaxial",IDC_STATIC,231,99,24,8 + LTEXT "SegI",IDC_STATIC,236,72,16,8 + LTEXT "SegII",IDC_STATIC,236,86,18,8 + GROUPBOX "Light Size",IDC_STATIC,324,14,72,112 + CONTROL "Light1",IDC_RADIO_LIGHT1_SIZE,"Button",BS_AUTORADIOBUTTON,348,28,35,10 + CONTROL "Light2",IDC_RADIO_LIGHT2_SIZE,"Button",BS_AUTORADIOBUTTON,348,44,35,10 + CONTROL "Light3",IDC_RADIO_LIGHT3_SIZE,"Button",BS_AUTORADIOBUTTON,348,60,35,10 + CONTROL "Light4",IDC_RADIO_LIGHT4_SIZE,"Button",BS_AUTORADIOBUTTON,348,76,35,10 + PUSHBUTTON "Exit",IDCANCEL,366,465,39,14 + LTEXT "x",IDC_STATIC,23,324,8,11 + LTEXT "y",IDC_STATIC,23,338,8,11 + LTEXT "z",IDC_STATIC,23,352,8,11 + LTEXT "Zm",IDC_STATIC,21,365,13,11 + EDITTEXT IDC_EDIT_X_AXIS,34,323,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_AXIS,34,337,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_AXIS,34,351,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_AXIS,34,365,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_X_POSITION_58,103,323,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POSITION_58,103,337,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POSITION_58,103,351,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_POSITION_58,103,365,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + LTEXT "Scale Pulse",IDC_STATIC,40,309,36,8 + LTEXT "mm",IDC_STATIC,123,310,12,8 + EDITTEXT IDC_EDIT_STATUS,15,404,385,56,ES_MULTILINE | ES_AUTOHSCROLL,WS_EX_CLIENTEDGE + LTEXT "ms",IDC_STATIC_SEC,212,384,16,9 + EDITTEXT IDC_EDIT_UPDATE_FREQ,183,383,25,13,ES_AUTOHSCROLL | ES_READONLY + GROUPBOX "Scale Display",IDC_STATIC,15,264,224,136 + GROUPBOX "Motion",IDC_STATIC,73,129,324,84 + EDITTEXT IDC_EDIT_X_POSITION_59,174,322,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POSITION_59,174,336,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POSITION_59,174,350,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_POSITION_59,174,364,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + LTEXT "Probe",IDC_STATIC,189,310,20,8 + LTEXT "Pos Update Frequency",IDC_STATIC,104,384,74,8 + LTEXT "Spare1",IDC_STATIC,232,112,24,8 + LTEXT "Size",IDC_STATIC,328,94,15,8 + LTEXT "Switch",IDC_STATIC,326,110,20,8 + CTEXT "X",IDC_STATIC,70,273,8,8 + CTEXT "Y",IDC_STATIC,133,273,8,8 + CTEXT "Z",IDC_STATIC,195,273,8,8 + LTEXT " ϵ",IDC_STATIC,23,281,18,18 + GROUPBOX "Set Gear",IDC_STATIC,208,132,56,81 + PUSHBUTTON "so7_config",IDC_BUTTON_SETUP_SO7CONFIG,20,184,44,23 +END + +IDD_S07_UTIL_SEND_PARAMETER DIALOGEX 0, 0, 753, 471 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Send Parameter" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "X",IDC_RADIO_SAMPLE_X,"Button",BS_AUTORADIOBUTTON | WS_GROUP,397,403,20,10 + CONTROL "Y",IDC_RADIO_SAMPLE_Y,"Button",BS_AUTORADIOBUTTON,397,414,20,10 + CONTROL "Z",IDC_RADIO_SAMPLE_Z,"Button",BS_AUTORADIOBUTTON,397,425,20,10 + CONTROL "ٶ-ʱ",IDC_RADIO_CANVAS_SPEED_TIME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,322,406,51,10 + CONTROL "λ-ʱ",IDC_RADIO_CANVAS_POSTION_TIME,"Button",BS_AUTORADIOBUTTON,322,420,51,10 + EDITTEXT IDC_EDIT_BASESPEED_X1,43,55,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_X1,93,55,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_X1,143,55,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_X1,193,55,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_X1,243,55,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_X2,43,69,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_X2,93,69,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_X2,143,69,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_X2,193,69,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_X2,243,69,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_X3,43,83,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_X3,93,83,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_X3,143,83,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_X3,193,83,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_X3,243,83,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_X4,43,97,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_X4,93,97,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_X4,143,97,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_X4,193,97,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_X4,243,97,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_X5,43,111,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_X5,93,111,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_X5,143,111,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_X5,193,111,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_X5,243,111,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Y1,43,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Y1,93,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Y1,143,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Y1,193,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Y1,243,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Y2,43,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Y2,93,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Y2,143,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Y2,193,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Y2,243,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Y3,43,156,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Y3,93,156,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Y3,143,156,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Y3,193,156,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Y3,243,156,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Y4,43,170,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Y4,93,170,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Y4,143,170,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Y4,193,170,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Y4,243,170,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Y5,43,184,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Y5,93,184,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Y5,143,184,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Y5,193,184,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Y5,243,184,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Z1,43,203,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Z1,93,203,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Z1,143,203,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Z1,193,203,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Z1,243,203,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Z2,43,217,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Z2,93,217,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Z2,143,217,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Z2,193,217,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Z2,243,217,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Z3,43,231,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Z3,93,231,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Z3,143,231,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Z3,193,231,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Z3,243,231,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Z4,43,245,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Z4,93,245,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Z4,143,245,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Z4,193,245,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Z4,243,245,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BASESPEED_Z5,43,259,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MAXSPEED_Z5,93,259,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_STARTSPEED_Z5,143,259,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_FRESHSPEED_Z5,193,259,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SLOWDIS_Z5,243,259,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_WHEELBASE_X,43,293,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_WHEELBASE_Y,104,293,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_WHEELBASE_Z,167,293,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_WHEELBASE_PULSENUM,246,294,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_PRECISION_X,43,328,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_PRECISION_Y,104,328,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_PRECISION_Z,167,328,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_X,118,363,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_Y,180,363,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_Z,243,363,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_X,118,380,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_Y,180,380,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_Z,243,380,40,12,ES_AUTOHSCROLL + PUSHBUTTON "Save To Controller",IDC_BUTTON_SAVE_PARAMETER,46,410,50,24,BS_MULTILINE + PUSHBUTTON "Read From Controller",IDC_BUTTON_READ_PARAMETER_FROM_CONTROLLER,120,410,50,24,BS_MULTILINE + PUSHBUTTON "Save...",IDC_BUTTON_SAVE,194,410,50,24 + PUSHBUTTON "Exit",IDCANCEL,696,426,50,14 + LTEXT "Z=",IDC_STATIC,229,381,10,8 + LTEXT "Y=",IDC_STATIC,90,296,10,8 + EDITTEXT IDC_EDIT_INPUT_FILE,58,12,186,14,ES_AUTOHSCROLL + LTEXT "Input_File",IDC_STATIC,18,15,33,8 + PUSHBUTTON "Browse...",IDC_BUTTON_BROWSE,252,12,36,14 + GROUPBOX "ٶȲ",IDC_STATIC,15,31,275,246 + LTEXT "X-1",IDC_STATIC,27,57,12,8 + LTEXT "X-2",IDC_STATIC,27,72,12,8 + LTEXT "",IDC_STATIC,48,41,33,8 + LTEXT "",IDC_STATIC,98,41,33,8 + CONTROL "ʼ",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,146,41,33,8 + LTEXT "ˢ",IDC_STATIC,197,41,33,8 + LTEXT "پ",IDC_STATIC,247,41,33,8 + LTEXT "X-3",IDC_STATIC,27,85,12,8 + LTEXT "X-4",IDC_STATIC,27,99,12,8 + LTEXT "X-5",IDC_STATIC,27,113,12,8 + LTEXT "Y-1",IDC_STATIC,27,131,12,8 + LTEXT "Y-2",IDC_STATIC,27,146,12,8 + LTEXT "Y-3",IDC_STATIC,27,159,12,8 + LTEXT "Y-4",IDC_STATIC,27,173,12,8 + LTEXT "Y-5",IDC_STATIC,27,187,12,8 + LTEXT "Z-1",IDC_STATIC,27,205,12,8 + LTEXT "Z-2",IDC_STATIC,27,220,12,8 + LTEXT "Z-3",IDC_STATIC,27,233,12,8 + LTEXT "Z-4",IDC_STATIC,27,247,12,8 + LTEXT "Z-5",IDC_STATIC,27,261,12,8 + GROUPBOX "",IDC_STATIC,15,279,275,36 + GROUPBOX "",IDC_STATIC,16,316,274,30 + LTEXT "X=",IDC_STATIC,28,296,10,8 + LTEXT "Z=",IDC_STATIC,153,296,10,8 + LTEXT "PulseNo.",IDC_STATIC,216,296,27,8 + LTEXT "X=",IDC_STATIC,28,330,10,8 + LTEXT "Y=",IDC_STATIC,90,330,10,8 + LTEXT "Z=",IDC_STATIC,153,330,10,8 + GROUPBOX "̨趨",IDC_STATIC,16,347,274,49 + LTEXT "X=",IDC_STATIC,104,364,10,8 + LTEXT "Y=",IDC_STATIC,166,364,10,8 + LTEXT "Z=",IDC_STATIC,229,364,10,8 + LTEXT "NEG WORKING LIMIT",IDC_STATIC,20,364,69,8 + LTEXT "POS WORKING LIMIT",IDC_STATIC,20,382,69,8 + LTEXT "X=",IDC_STATIC,104,381,10,8 + LTEXT "Y=",IDC_STATIC,166,381,10,8 + EDITTEXT IDC_EDIT_SAMPLE_SCURVE_DIS,473,408,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SAMPLE_TIME_SCURVE,564,408,40,14,ES_AUTOHSCROLL + PUSHBUTTON "ʼ",IDC_BUTTON_START_SAMPLE_SCURVE,628,407,50,14 + LTEXT "Ծ",IDC_STATIC,436,410,33,8 + LTEXT "ʱ",IDC_STATIC,529,410,33,8 + PUSHBUTTON "Stop",IDC_BUTTON_STOP_SAMPLE_SCURVE,627,425,50,14 + CONTROL "˶ͼ",IDC_CUSTOM_CANVAS,"CDrawGraph",WS_TABSTOP,309,34,423,349 + GROUPBOX "",IDC_STATIC,315,392,66,48 + EDITTEXT IDC_EDIT_SET_PARAMETER_MSGOUTPUT,443,431,165,25,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + GROUPBOX "",IDC_STATIC,386,392,50,48 +END + +IDD_SO7_UTIL_AUTO_ZOOM DIALOGEX 0, 0, 426, 431 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Auto Zoom(SO7)" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Exit",IDCANCEL,359,385,50,14 + PUSHBUTTON "Send",IDC_BUTTON_SEND_DATA,284,284,50,17 + LISTBOX IDC_LIST_SHOWMESSAGE,86,315,191,54,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_EDIT_DATASEND,86,285,191,16,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN + PUSHBUTTON "Clear",IDC_BUTTON_CLEARMESSAGE,284,332,50,17 + GROUPBOX "Serial Communication",IDC_STATIC,11,269,398,117 + GROUPBOX "Move Test",IDC_STATIC,13,7,393,239 + EDITTEXT IDC_EDIT_ZOOM_ANGLE,129,104,81,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Zm",IDC_STATIC,109,107,10,8 + CTEXT "",IDC_STATIC,213,103,8,8 + CONTROL "MoveTest",IDC_RADIO_MOVETEST,"Button",BS_AUTORADIOBUTTON,124,251,47,10 + CONTROL "SendCmd",IDC_RADIO_SENDCMD,"Button",BS_AUTORADIOBUTTON,194,251,46,10 + PUSHBUTTON "Zero Set",IDC_BUTTON_ZOOM_SETZERO,263,105,50,14,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_REPETEST_PAUSE,179,67,54,14,ES_AUTOHSCROLL + CTEXT "ms",IDC_STATIC,235,68,11,8 + EDITTEXT IDC_EDIT_ZOOM_LOG,47,129,250,110,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + PUSHBUTTON "Save as...",IDC_BUTTON_SAVELOG,320,178,39,19 + COMBOBOX IDC_COMBO_REPETEST_FROM,85,47,54,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_REPETEST_TO,179,43,54,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Begin",IDC_BUTTON_REPETEST_BEGIN,263,56,50,14 + EDITTEXT IDC_EDIT_REPETEST_TIMES,85,67,54,14,ES_AUTOHSCROLL + GROUPBOX "Repeatability Test",IDC_STATIC,47,36,279,64 + LTEXT "Times",IDC_STATIC,59,71,19,8 + LTEXT "Pause",IDC_STATIC,155,69,20,8 + LTEXT "To",IDC_STATIC,165,47,9,8 + LTEXT "From",IDC_STATIC,61,52,17,8 + CONTROL "Continue",IDC_CHECK_AUTOZOOM_CONTINUE_READ,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,61,107,40,10 + PUSHBUTTON "V+",IDC_BUTTON_MOVEV_IN,48,204,50,14,NOT WS_VISIBLE + PUSHBUTTON "V-",IDC_BUTTON_MOVEV_OUT,48,221,50,14,NOT WS_VISIBLE + PUSHBUTTON "Home V",IDC_BUTTON_HOME_V,48,187,50,14,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_ZOOM_MOVETO,235,190,54,14,ES_AUTOHSCROLL | NOT WS_VISIBLE + EDITTEXT IDC_EDIT_ZOOM_DEADBAND,235,209,54,14,ES_AUTOHSCROLL | NOT WS_VISIBLE + PUSHBUTTON "MoveTo",IDC_BUTTON_ZOOM_MOVETO,173,190,50,14,NOT WS_VISIBLE + CONTROL "DeadBand",IDC_CHECK_ZOOM_DEADBAND,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,176,213,49,10 + CTEXT "",IDC_STATIC,292,210,8,8,NOT WS_VISIBLE + CTEXT "",IDC_STATIC,292,190,8,8,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_SETSPEED,235,171,54,14,ES_AUTOHSCROLL | NOT WS_VISIBLE + CONTROL "Gear1",IDC_RADIO_ZOOM_GEAR1,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,108,170,35,10 + CONTROL "Gear2",IDC_RADIO_ZOOM_GEAR2,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,108,186,35,10 + CONTROL "Gear3",IDC_RADIO_ZOOM_GEAR3,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,108,202,35,10 + CONTROL "Gear4",IDC_RADIO_ZOOM_GEAR4,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,108,218,35,10 + PUSHBUTTON "SetSpeed",IDC_BUTTON_ZOOM_SETSPEED,173,170,50,14,NOT WS_VISIBLE + CONTROL "Forward",IDC_CHECK_CONTINUEMOVE,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,176,230,43,10 + CTEXT "Hz",IDC_STATIC,295,173,8,8,NOT WS_VISIBLE + PUSHBUTTON "Calibrate",IDC_BUTTON_CALIBRATE_ENCODER,48,170,50,14,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_ZOOM_REPE_TIME,235,228,54,14,ES_AUTOHSCROLL | NOT WS_VISIBLE + CTEXT "ms",IDC_STATIC,292,231,11,8,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_TESTZOOM_PRODUCTID,159,16,124,14,ES_AUTOHSCROLL | ES_READONLY + LTEXT "䱶ͷƷţ",IDC_STATIC,80,18,73,8 +END + +IDD_ANIMATICS_UTIL_DIALOG DIALOGEX 0, 0, 514, 527 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "ANIMATICS Utility" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Start_Machine",IDC_BUTTON_START_ANIMATICS_MACHINE,23,20,63,15 + PUSHBUTTON "Stop_Machine",IDC_BUTTON_STOP_ANIMATICS_MACHINE,23,59,63,15 + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_X1,40,101,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_X1,90,101,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_X1,140,101,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_X2,40,115,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_X2,90,115,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_X2,140,115,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_X3,40,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_X3,90,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_X3,140,129,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_X4,40,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_X4,90,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_X4,140,143,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_X5,40,157,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_X5,90,157,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_X5,140,157,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Y1,40,175,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Y1,90,175,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Y1,140,175,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Y2,40,189,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Y2,90,189,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Y2,140,189,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Y3,40,202,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Y3,90,202,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Y3,140,202,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Y4,40,216,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Y4,90,216,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Y4,140,216,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Y5,40,230,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Y5,90,230,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Y5,140,230,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Z1,40,249,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Z1,90,249,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Z1,140,249,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Z2,40,263,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Z2,90,263,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Z2,140,263,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Z3,40,277,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Z3,90,277,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Z3,140,277,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Z4,40,291,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Z4,90,291,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Z4,140,291,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_SPEED_Z5,40,305,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_ACCEL_Z5,90,305,40,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_DECEL_Z5,140,305,40,12,ES_AUTOHSCROLL + PUSHBUTTON "Read",IDC_BUTTON_READ_CONFIG,38,325,50,14 + PUSHBUTTON "Save",IDC_BUTTON_SAVE_CONFIG,115,325,50,14 + PUSHBUTTON "Z+",IDC_BUTTON_ANIMATICS_MOVE_Z_UP,203,103,25,12 + PUSHBUTTON "Z-",IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN,203,137,25,12 + PUSHBUTTON "X-",IDC_BUTTON_ANIMATICS_MOVE_X_LEFT,219,119,25,12 + PUSHBUTTON "X+",IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT,271,119,25,12 + PUSHBUTTON "Y+",IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT,245,109,25,12 + PUSHBUTTON "Y-",IDC_BUTTON_ANIMATICS_MOVE_Y_BACK,245,130,25,12 + CONTROL "First",IDC_RADIO_ANIMATICS_SPEED_GEAR_1,"Button",BS_AUTORADIOBUTTON | WS_GROUP,309,107,30,10 + CONTROL "Second",IDC_RADIO_ANIMATICS_SPEED_GEAR_2,"Button",BS_AUTORADIOBUTTON,309,120,39,10 + CONTROL "Third",IDC_RADIO_ANIMATICS_SPEED_GEAR_3,"Button",BS_AUTORADIOBUTTON,309,134,32,10 + CONTROL "Fourth",IDC_RADIO_ANIMATICS_SPEED_GEAR_4,"Button",BS_AUTORADIOBUTTON,309,147,37,10 + EDITTEXT IDC_EDIT_ANIMATICS_MOVE_TO_X,374,108,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_MOVE_TO_Y,374,125,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_MOVE_TO_Z,374,141,53,12,ES_AUTOHSCROLL + PUSHBUTTON "X",IDC_BUTTON_ANIMATICS_MOVE_TO_X,434,107,23,13,BS_MULTILINE + PUSHBUTTON "Y",IDC_BUTTON_ANIMATICS_MOVE_TO_Y,435,124,23,13 + PUSHBUTTON "Z",IDC_BUTTON_ANIMATICS_MOVE_TO_Z,435,141,23,13 + PUSHBUTTON "XYZ",IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ,461,124,30,13 + CONTROL "x",IDC_CHECK_REPETESTX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,193,20,10 + CONTROL "y",IDC_CHECK_REPETESTY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,218,20,10 + CONTROL "z",IDC_CHECK_REPETESTZ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,217,243,20,10 + EDITTEXT IDC_EDIT_REPETEST_DIS_TO,304,207,57,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_REPETEST_TIMES,304,228,57,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_REPETEST_INTERVAL,304,249,45,12,ES_RIGHT | ES_AUTOHSCROLL + PUSHBUTTON "Begin",IDC_BUTTON_BEGIN_REPE_TEST,390,200,50,14 + PUSHBUTTON "Save...",IDC_BUTTON_SAVE_REPETEST,390,233,50,14 + EDITTEXT IDC_EDIT_X_SCALE_COEFFICIENT,75,377,38,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_Y_SCALE_COEFFICIENT,75,391,38,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_Z_SCALE_COEFFICIENT,75,406,38,12,ES_CENTER | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_CMD,61,460,70,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ANIMATICS_CMD_RESPONSE,61,484,70,14,ES_AUTOHSCROLL + PUSHBUTTON "Set Zero",IDC_BUTTON_POS_SET_ZERO,433,389,50,14 + GROUPBOX "Motor Status",IDC_STATIC,112,8,382,72 + GROUPBOX "Motor Control",IDC_STATIC,15,8,89,71 + PUSHBUTTON "Exit",IDCANCEL,468,506,39,14 + LTEXT "x",IDC_STATIC,53,377,8,11 + LTEXT "y",IDC_STATIC,53,391,8,11 + LTEXT "z",IDC_STATIC,53,406,8,11 + EDITTEXT IDC_EDIT_X_POS,233,377,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POS,233,391,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POS,233,406,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_X_POS_MM,299,377,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POS_MM,299,391,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POS_MM,299,406,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + LTEXT "Scale Pulse",IDC_STATIC,239,361,36,8 + LTEXT "mm",IDC_STATIC,319,361,12,8 + EDITTEXT IDC_EDIT_STATUS,144,438,351,64,ES_MULTILINE | ES_AUTOHSCROLL,WS_EX_CLIENTEDGE + GROUPBOX "Position",IDC_STATIC,17,350,477,78 + GROUPBOX "Motion",IDC_STATIC,197,80,157,89 + LTEXT "Scale Resolution",IDC_STATIC,67,361,54,9 + GROUPBOX "Set Gear",IDC_STATIC,299,90,56,79 + LTEXT "X-1",IDC_STATIC,24,103,12,8 + LTEXT "X-2",IDC_STATIC,24,118,12,8 + LTEXT "Speed",IDC_STATIC,47,87,21,8 + LTEXT "Accel",IDC_STATIC,101,87,18,8 + CONTROL "Decel",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,151,87,18,8 + LTEXT "X-3",IDC_STATIC,24,131,12,8 + LTEXT "X-4",IDC_STATIC,24,145,12,8 + LTEXT "X-5",IDC_STATIC,24,159,12,8 + LTEXT "Y-1",IDC_STATIC,24,177,12,8 + LTEXT "Y-2",IDC_STATIC,24,192,12,8 + LTEXT "Y-3",IDC_STATIC,24,205,12,8 + LTEXT "Y-4",IDC_STATIC,24,219,12,8 + LTEXT "Y-5",IDC_STATIC,24,233,12,8 + LTEXT "Z-1",IDC_STATIC,24,251,12,8 + LTEXT "Z-2",IDC_STATIC,24,266,12,8 + LTEXT "Z-3",IDC_STATIC,24,279,12,8 + LTEXT "Z-4",IDC_STATIC,24,293,12,8 + LTEXT "Z-5",IDC_STATIC,24,307,12,8 + GROUPBOX "Motion Parameter",IDC_STATIC,17,78,171,270 + GROUPBOX "Repeatability Test",IDC_STATIC,199,172,296,174 + LTEXT "To",IDC_STATIC,285,208,8,8 + LTEXT "Times",IDC_STATIC,277,228,19,8 + LTEXT "Pause",IDC_STATIC,275,251,20,8 + LTEXT "ms",IDC_STATIC,353,250,10,8 + LTEXT "x",IDC_STATIC,363,108,8,8 + LTEXT "y",IDC_STATIC,363,126,8,8 + LTEXT "z",IDC_STATIC,363,144,8,8 + CONTROL "Reverse",IDC_CHECK_ANIMATICS_REVERSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,374,157,41,10 + GROUPBOX "Mve To Location",IDC_STATIC,359,80,135,89 + EDITTEXT IDC_EDIT_ANIMATICS_REPRETEST,203,279,288,58,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + EDITTEXT IDC_EDIT_X_POS_MM_CHANGE,369,377,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POS_MM_CHANGE,369,391,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POS_MM_CHANGE,369,406,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + LTEXT "mm'",IDC_STATIC,387,361,13,8 + GROUPBOX "Static",IDC_STATIC,19,431,120,72 + CONTROL "X",IDC_RADIO_ANIMATICS_CMD_X,"Button",BS_AUTORADIOBUTTON,45,444,20,10 + CONTROL "Y",IDC_RADIO_ANIMATICS_CMD_Y,"Button",BS_AUTORADIOBUTTON,75,444,20,10 + CONTROL "Z",IDC_RADIO_ANIMATICS_CMD_Z,"Button",BS_AUTORADIOBUTTON,107,444,20,10 + LTEXT "Cmd",IDC_STATIC,33,463,15,8 + LTEXT "Response",IDC_STATIC,25,487,32,8 + CONTROL "Absolute",IDC_RADIO_MOVE_TO_ABSOLUTE,"Button",BS_AUTORADIOBUTTON,379,93,44,10 + CONTROL "Relative",IDC_RADIO_MOVE_TO_RELATIVE,"Button",BS_AUTORADIOBUTTON,436,93,42,10 + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_X,127,377,38,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_Y,127,391,38,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_NEG_WORKLIMIT_Z,127,406,38,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_X,180,377,38,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_Y,180,391,38,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_POS_WORKLIMIT_Z,180,406,38,12,ES_AUTOHSCROLL + LTEXT "Neg Limit",IDC_STATIC,132,361,30,8 + LTEXT "Pos Limit",IDC_STATIC,184,361,28,8 + LTEXT "x",IDC_STATIC,134,28,8,11 + LTEXT "y",IDC_STATIC,134,45,8,11 + LTEXT "z",IDC_STATIC,134,62,8,11 + LTEXT "MoveDone",IDC_STATIC,177,18,35,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_MOVING_X,184,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_MOVING_Y,184,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_MOVING_Z,184,60,19,14,BS_ICON + LTEXT "HomeDone",IDC_STATIC,137,18,36,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_HOME_X,146,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_HOME_Y,146,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_HOME_z,146,60,19,14,BS_ICON + LTEXT "NegLimit",IDC_STATIC,217,18,28,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_NEGLIMIT_X,222,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_NEGLIMIT_Y,222,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_NEGLIMIT_Z,222,60,19,14,BS_ICON + LTEXT "PosLimit",IDC_STATIC,255,18,26,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_POSLIMIT_X,260,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_POSLIMIT_Y,260,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_POSLIMIT_Z,260,60,19,14,BS_ICON + LTEXT "DriverRdy",IDC_STATIC,291,18,33,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_DRIVER_RDY_X,298,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_DRIVER_RDY_Y,298,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_DRIVER_RDY_Z,298,60,19,14,BS_ICON + LTEXT "MotorOff",IDC_STATIC,329,18,30,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_MOTOR_OFF_X,336,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_MOTOR_OFF_Y,336,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_MOTOR_OFF_Z,336,60,19,14,BS_ICON + LTEXT "VolFault",IDC_STATIC,369,18,26,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_VOLFAULT_X,374,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_VOLFAULT_Y,374,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_VOLFAULT_Z,374,60,19,14,BS_ICON + LTEXT "PosErr",IDC_STATIC,410,18,22,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_POSERR_X,412,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_POSERR_Y,412,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_POSERR_Z,412,60,19,14,BS_ICON + LTEXT "OverHeat",IDC_STATIC,445,18,32,8 + PUSHBUTTON "",IDC_BUTTON_STATUS_OVERHEAT_X,450,28,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_OVERHEAT_Y,450,44,19,14,BS_ICON + PUSHBUTTON "",IDC_BUTTON_STATUS_OVERHEAT_Z,450,60,19,14,BS_ICON + EDITTEXT IDC_EDIT_REPETEST_DIS_FROM,304,186,57,12,ES_AUTOHSCROLL + LTEXT "From",IDC_STATIC,282,189,19,8 + PUSHBUTTON "Home",IDC_BUTTON_ANIMATICS_HOME,35,40,63,15 +END + +IDD_S07_OPTION_DIALOG DIALOGEX 0, 0, 297, 150 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Option Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDC_RADIO_CONTROLLER,"Button",BS_AUTORADIOBUTTON,175,39,40,10 + CONTROL "LK-G",IDC_RADIO_KEYENCE_LASER_LK_G,"Button",BS_AUTORADIOBUTTON,175,64,47,10 + CONTROL "SDK3000Ƶ",IDC_RADIO_VIDEOCARD_SDK3000,"Button",BS_AUTORADIOBUTTON,48,39,69,10 + CONTROL "SV2000EƵ",IDC_RADIO_VIDEOCARD_SV2000E,"Button",BS_AUTORADIOBUTTON,48,64,69,10 + CONTROL "TC4000Ƶ",IDC_RADIO_VIDEOCARD_TC4000,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,48,89,69,10 + DEFPUSHBUTTON "OK",IDOK,181,129,50,14 + PUSHBUTTON "Cancel",IDCANCEL,240,129,50,14 + GROUPBOX "ѡ",IDC_STATIC,23,17,263,92 +END + +IDD_SO7_VIDEOCARD_SDK3000 DIALOGEX 0, 0, 488, 316 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "SDK3000Ƶ" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "ɫͼ",IDC_RADIO_RGB,"Button",BS_AUTORADIOBUTTON,435,49,48,10 + CONTROL "ڰͼ",IDC_RADIO_GRAY,"Button",BS_AUTORADIOBUTTON,435,67,48,10 + CONTROL "ֱ",IDC_CHECK_MIRROR_VERTICALLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,435,93,48,10 + PUSHBUTTON "ͼƬ",IDC_BUTTON_SAVE_PICTURE,435,117,50,14 + DEFPUSHBUTTON "ʼ",IDOK,372,298,50,14 + PUSHBUTTON "˳",IDCANCEL,435,298,50,14 + CONTROL "",IDC_STATIC_SDK3000_PICTURE,"Static",SS_BLACKFRAME | NOT WS_VISIBLE,228,296,68,16 +END + +IDD_SO7_VIDEOCARD_SV2000E DIALOGEX 0, 0, 488, 316 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "SV2000Ƶ" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "ɫͼ",IDC_RADIO_SV2000E_RGB,"Button",BS_AUTORADIOBUTTON,435,37,48,10 + CONTROL "ڰͼ",IDC_RADIO_SV2000E_GRAY,"Button",BS_AUTORADIOBUTTON,435,58,48,10 + CONTROL "ֱ",IDC_CHECK_SV2000E_MIRROR_VERTICALLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,435,85,48,10 + PUSHBUTTON "ͼƬ",IDC_BUTTON_SV2000E_SAVEFILE,435,115,50,14 + DEFPUSHBUTTON "ʼ",IDOK,372,298,50,14 + PUSHBUTTON "˳",IDCANCEL,435,298,50,14 +END + +IDD_SO7_UTIL_SETUP_CONFIGURE DIALOGEX 0, 0, 476, 451 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "so7_configure.ini" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_EDIT_SO7CONFIG_ZOOMID,136,44,108,14,ES_AUTOHSCROLL + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_STEP1,304,41,36,19 + PUSHBUTTON "У",IDC_BTN_CONFIGURE_CALIBRATEV,253,78,36,19 + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_STEP2,304,78,36,19 + EDITTEXT IDC_EDIT_SO7CONFIG_ZOOM_FASTSPEED,154,159,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SO7CONFIG_ZOOM_SLOWSPEED,243,159,40,14,ES_AUTOHSCROLL + PUSHBUTTON "V-",IDC_BTN_CONFIGURE_MOVEVOUT,383,194,45,19 + PUSHBUTTON "V+",IDC_BTN_CONFIGURE_MOVEVIN,383,232,45,19 + CONTROL "",IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST,"Button",BS_AUTORADIOBUTTON,387,149,32,10 + CONTROL "",IDC_RADIO_SO7CONFIG_ZOOM_MOVE_SLOW,"Button",BS_AUTORADIOBUTTON,387,171,32,10 + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_SET_SPEED,303,156,36,19 + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_ZOOM_NEGLIMIT,303,194,36,19 + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_ZOOM_POSLIMIT,303,232,36,19 + LTEXT "",IDC_STATIC,227,274,8,8 + PUSHBUTTON "",IDC_BUTTON_SO7CONFIG_ZOOM_PRECISION,303,272,36,19 + PUSHBUTTON "Exit",IDCANCEL,419,430,50,14 + GROUPBOX "Step2",IDC_STATIC,55,68,297,36 + GROUPBOX "Step5",IDC_STATIC,55,185,297,36 + GROUPBOX "Step6",IDC_STATIC,55,223,297,36 + LTEXT "Уͷ:",IDC_STATIC,78,85,37,12 + LTEXT "䱶С",IDC_STATIC,134,203,56,12 + LTEXT "䱶",IDC_STATIC,134,238,58,12 + GROUPBOX "䱶ͷ",IDC_STATIC,27,19,432,290 + EDITTEXT IDC_EDIT_CONFIGURE_MSGOUT,28,317,431,75,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + GROUPBOX "Step1",IDC_STATIC,55,30,297,36 + GROUPBOX "Step4",IDC_STATIC,55,147,297,36 + LTEXT "Ʒţ",IDC_STATIC,78,46,41,8 + LTEXT "ٶ:",IDC_STATIC,78,161,36,8 + LTEXT "",IDC_STATIC,134,161,17,8 + LTEXT "",IDC_STATIC,222,161,17,8 + LTEXT "ѡͬʽУ",IDC_STATIC,134,85,97,8 + LTEXT "λ:",IDC_STATIC,78,203,28,8 + LTEXT "Զλ:",IDC_STATIC,78,238,28,8 + GROUPBOX "Step7",IDC_STATIC,55,262,297,36 + LTEXT ":",IDC_STATIC,78,277,20,8 + EDITTEXT IDC_EDIT_SO7CONFIG_ZOOM_PRECISION,182,275,40,14,ES_AUTOHSCROLL + LTEXT "λ ",IDC_STATIC,134,277,42,8 + GROUPBOX "Motion",IDC_STATIC,369,30,72,267 + EDITTEXT IDC_EDIT_SO7CONFIG_READZOOM,383,100,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + GROUPBOX "Step3",IDC_STATIC,55,108,297,36 + LTEXT "ϸ:",IDC_STATIC,78,125,28,8 + EDITTEXT IDC_EDIT_SO7CONFIG_MOTOR_SUBDIVISION,207,122,40,14,ES_AUTOHSCROLL + PUSHBUTTON "һ",IDC_BUTTON_SO7CONFIG_SET_SUBDIVISION,304,118,36,19 + LTEXT "ϸ",IDC_STATIC,134,124,65,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_SO7_UTIL_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 405 + TOPMARGIN, 7 + BOTTOMMARGIN, 479 + END + + IDD_S07_UTIL_SEND_PARAMETER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 746 + TOPMARGIN, 7 + BOTTOMMARGIN, 463 + END + + IDD_SO7_UTIL_AUTO_ZOOM, DIALOG + BEGIN + RIGHTMARGIN, 419 + TOPMARGIN, 7 + BOTTOMMARGIN, 424 + END + + IDD_ANIMATICS_UTIL_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 507 + TOPMARGIN, 7 + BOTTOMMARGIN, 520 + END + + IDD_S07_OPTION_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 290 + TOPMARGIN, 7 + BOTTOMMARGIN, 143 + END + + IDD_SO7_VIDEOCARD_SDK3000, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 485 + VERTGUIDE, 435 + TOPMARGIN, 7 + BOTTOMMARGIN, 312 + END + + IDD_SO7_VIDEOCARD_SV2000E, DIALOG + BEGIN + LEFTMARGIN, 1 + RIGHTMARGIN, 485 + VERTGUIDE, 435 + END + + IDD_SO7_UTIL_SETUP_CONFIGURE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 469 + TOPMARGIN, 7 + BOTTOMMARGIN, 444 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON "res\\Mv_Util.ico" +IDI_ICON_GREEN ICON "res\\green.ico" +IDI_ICON_GRAY ICON "res\\Gray.ico" +IDI_ICON_WHITE ICON "res\\White.ico" +IDI_ICON_RED ICON "res\\red.ico" +IDI_ICON_BLACK ICON "res\\Black.ico" +#endif // Chinese (Simplified, PRC) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOGEX 0, 0, 198, 63 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "About Mv_Util" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + ICON 103,IDC_STATIC,14,14,21,20 + LTEXT "Mv/Mitu_Util Version 1.0",IDC_STATIC,42,14,114,8,SS_NOPREFIX + LTEXT "Hexagon Metrology., Copyright (C) 2012",IDC_STATIC,42,26,139,8 + DEFPUSHBUTTON "OK",IDOK,141,42,50,14,WS_GROUP +END + +IDD_MV_UTIL_DIALOG DIALOGEX 0, 0, 407, 389 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "MicroVu Utility" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Init_MvUSB",IDC_BUTTON_INIT_MVUSB,15,14,48,13 + PUSHBUTTON "Start_Machine",IDC_BUTTON_START_MACHINE,33,29,63,13 + PUSHBUTTON "Exit_MvUsb",IDC_BUTTON_TERM_MVUSB,15,117,50,13 + PUSHBUTTON "Stop_Machine",IDC_BUTTON_STOP_MACHINE,33,102,63,13 + PUSHBUTTON "Exit",IDCANCEL,343,368,39,14 + PUSHBUTTON "Start Poll_59",IDC_BUTTON_START_POLL_59,54,44,55,13 + GROUPBOX "Machine Control",IDC_STATIC,7,153,375,86 + LTEXT "x",IDC_STATIC,17,179,8,11 + LTEXT "y",IDC_STATIC,17,193,8,11 + LTEXT "z",IDC_STATIC,17,207,8,11 + LTEXT "Zm",IDC_STATIC,15,220,13,11 + EDITTEXT IDC_EDIT_X_POSITION_59,28,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POSITION_59,28,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POSITION_59,28,206,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_POSITION_59,28,220,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "Bottom",IDC_STATIC,307,194,22,11 + LTEXT "Axial",IDC_STATIC,307,183,18,11 + EDITTEXT IDC_EDIT_BOTTOM_LIGHT,334,192,39,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_AXIAL_LIGHT,334,178,39,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + PUSHBUTTON "Cycle Ring",IDC_BUTTON_CYCLE_RING,54,86,55,13 + EDITTEXT IDC_EDIT_X_POSITION_58,97,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POSITION_58,97,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POSITION_58,97,206,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_POSITION_58,97,220,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "Lighting",IDC_STATIC,335,167,26,8 + PUSHBUTTON "DCC_Home",IDC_BUTTON_SEEK_HOME,176,86,55,13 + PUSHBUTTON "Move To",IDC_BUTTON_MOVE_TO,238,86,55,13 + LTEXT "Poll Location 59",IDC_STATIC,29,167,50,8 + LTEXT "Poll Location 58",IDC_STATIC,98,167,50,8 + EDITTEXT IDC_EDIT_STATUS,7,242,375,120,ES_MULTILINE | ES_AUTOHSCROLL,WS_EX_CLIENTEDGE + PUSHBUTTON "Start Poll_58",IDC_BUTTON_START_POLL_58,115,44,55,13 + PUSHBUTTON "Start Poll_2b",IDC_BUTTON_START_POLL_2B,176,44,55,13 + EDITTEXT IDC_EDIT_X_INDEX,232,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_INDEX,232,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_INDEX,232,206,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_INDEX,232,220,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "Index Position",IDC_STATIC,232,167,46,8 + PUSHBUTTON "Set Light",IDC_BUTTON_SET_LIGHT,115,86,55,13 + PUSHBUTTON "Load Mv_Config",IDC_BUTTON_LOAD_CONFIG,238,29,65,13 + PUSHBUTTON "_get_config",IDC_BUTTON_GET_CONFIG,54,58,55,13 + PUSHBUTTON "Pos Update Frequency",IDC_POLLING_SPEEDTEST,216,118,85,13 + EDITTEXT IDC_EDIT_SAMPLING,340,120,10,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER + PUSHBUTTON "_get_xyz_index",IDC_BUTTON_GET_INDEX,115,58,55,13 + LTEXT "/Sec",IDC_STATIC_SEC,354,120,16,9 + PUSHBUTTON "Poll EP02 Scale",IDC_BUTTON_POLL_EP_02,176,58,55,13 + EDITTEXT IDC_EDIT_X_POSITION_EP02,165,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_POSITION_EP02,165,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_POSITION_EP02,165,206,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_POSITION_EP02,165,220,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "EP_02 Poll",IDC_STATIC,165,167,34,8 + PUSHBUTTON "_disable_joy",IDC_BUTTON_DISABLE_JOYSTICK,54,72,55,13 + PUSHBUTTON "_enable_joy",IDC_BUTTON_ENABLE_JOYSTICK,115,72,55,13 + EDITTEXT IDC_EDIT1,304,118,25,13,ES_AUTOHSCROLL +END + +IDD_MV_UTIL_MOVE_LOCATION DIALOGEX 0, 0, 261, 335 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Move to location" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Move XYZ",IDOK,188,274,55,14 + PUSHBUTTON "Exit",IDCANCEL,222,312,32,14 + EDITTEXT IDC_EDIT_MOVE_TO_X,37,24,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MOVE_TO_Y,37,40,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MOVE_TO_Z,37,56,53,12,ES_AUTOHSCROLL + GROUPBOX "Move Type",IDC_STATIC,106,56,64,36 + CONTROL "Relative",IDC_RADIO_MOVE_RELATIVE,"Button",BS_AUTORADIOBUTTON,119,67,42,10 + CONTROL "Absolute",IDC_RADIO_MOVE_ABSOLUTE,"Button",BS_AUTORADIOBUTTON,119,77,44,10 + GROUPBOX "System",IDC_STATIC,106,10,64,46 + CONTROL "inch",IDC_RADIO_INCH,"Button",BS_AUTORADIOBUTTON,119,20,29,10 + CONTROL "mm",IDC_RADIO_MM,"Button",BS_AUTORADIOBUTTON,119,30,27,10 + LTEXT "x",IDC_STATIC,26,24,8,8 + LTEXT "y",IDC_STATIC,26,40,8,8 + LTEXT "z",IDC_STATIC,26,57,8,8 + LTEXT "zm",IDC_STATIC,22,73,8,8 + EDITTEXT IDC_EDIT_MOVE_TO_ZM,37,72,53,12,ES_AUTOHSCROLL + GROUPBOX "Move Speed",IDC_STATIC,175,10,69,46 + CONTROL "Fast",IDC_RADIO_SPEED_FAST,"Button",BS_AUTORADIOBUTTON,186,21,30,10 + CONTROL "Slow",IDC_RADIO_SPEED_SLOW,"Button",BS_AUTORADIOBUTTON,186,31,31,10 + CONTROL "User Defined",IDC_RADIO_SPEED_USER_DEFINED,"Button",BS_AUTORADIOBUTTON,186,41,54,10 + GROUPBOX "Auto Motion Parameters",IDC_STATIC,7,94,247,82 + EDITTEXT IDC_EDIT_SPEED_X,35,123,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SPEED_Y,35,139,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SPEED_Z,35,155,53,12,ES_AUTOHSCROLL + LTEXT "x",IDC_STATIC,25,105,8,8 + LTEXT "y",IDC_STATIC,25,139,8,8 + LTEXT "z",IDC_STATIC,25,155,8,8 + EDITTEXT IDC_EDIT_ACC_X,112,123,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ACC_Y,112,139,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_ACC_Z,112,155,53,12,ES_AUTOHSCROLL + LTEXT "y",IDC_STATIC,101,139,8,8 + LTEXT "z",IDC_STATIC,101,156,8,8 + EDITTEXT IDC_EDIT_DEC_X,188,123,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_DEC_Y,188,139,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_DEC_Z,188,155,53,12,ES_AUTOHSCROLL + LTEXT "x",IDC_STATIC,177,123,8,8 + LTEXT "y",IDC_STATIC,177,139,8,8 + LTEXT "z",IDC_STATIC,177,156,8,8 + LTEXT "Speed",IDC_STATIC,25,108,21,8 + LTEXT "Acceleration",IDC_STATIC,101,109,40,8 + LTEXT "Deceleration",IDC_STATIC,177,109,41,8 + GROUPBOX "Manual Motion Parameters",IDC_STATIC,7,184,247,85 + EDITTEXT IDC_EDIT_MANUAL_SPEED_X,35,215,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_SPEED_Y,35,231,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_SPEED_Z,35,247,53,12,ES_AUTOHSCROLL + LTEXT "x",IDC_STATIC,25,124,8,8 + LTEXT "y",IDC_STATIC,25,232,8,8 + LTEXT "z",IDC_STATIC,25,248,8,8 + EDITTEXT IDC_EDIT_MANUAL_ACC_X,112,215,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_ACC_Y,112,231,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_ACC_Z,112,247,53,12,ES_AUTOHSCROLL + LTEXT "x",IDC_STATIC,102,216,8,8 + LTEXT "y",IDC_STATIC,101,231,8,8 + LTEXT "z",IDC_STATIC,101,248,8,8 + EDITTEXT IDC_EDIT_MANUAL_DEC_X,188,215,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_DEC_Y,188,231,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MANUAL_DEC_Z,188,247,53,12,ES_AUTOHSCROLL + LTEXT "x",IDC_STATIC,177,215,8,8 + LTEXT "y",IDC_STATIC,177,231,8,8 + LTEXT "z",IDC_STATIC,177,248,8,8 + LTEXT "Speed",IDC_STATIC,25,200,21,8 + LTEXT "Acceleration",IDC_STATIC,101,200,40,8 + LTEXT "Deceleration",IDC_STATIC,177,200,41,8 + LTEXT "x",IDC_STATIC,26,216,8,8 + LTEXT "x",IDC_STATIC,102,123,8,8 + CONTROL "Use Manual Motion Parameters",IDC_CHECK_USE_MANUAL_MOTION_PARAMETERS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,275,115,10 + CONTROL "scale",IDC_RADIO_SCALE,"Button",BS_AUTORADIOBUTTON,119,40,32,10 + LTEXT "Stage Position",IDC_STATIC,14,10,52,11 + GROUPBOX "W-Axis",IDC_STATIC,7,296,154,30 + EDITTEXT IDC_EDIT_MOVE_W,18,307,76,12,ES_AUTOHSCROLL + DEFPUSHBUTTON "Move W",IDC_BUTTON_MOVE_W,99,307,50,14 +END + +IDD_DIALOG_SET_LIGHTS DIALOGEX 0, 0, 128, 87 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Set Lights" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Execute",IDOK,32,59,37,14 + PUSHBUTTON "Exit",IDCANCEL,72,59,37,14 + LTEXT "Axial Light:",IDC_STATIC,18,16,40,10 + LTEXT "Bottom Light:",IDC_STATIC,18,32,43,11 + EDITTEXT IDC_EDIT_AXIAL_LIGHT,66,14,43,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_BOTTOM_LIGHT,66,31,43,12,ES_AUTOHSCROLL +END + +IDD_DIALOG_MAIN_MENU DIALOGEX 0, 0, 304, 426 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "PCDMIS Interface Utility" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + GROUPBOX "Select Mode",IDC_STATIC,16,7,262,32 + CONTROL "Demo",IDC_RADIO_DEMO_MODE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,30,22,33,8 + CONTROL "Engineering",IDC_RADIO_ENGINEERING_MODE,"Button",BS_AUTORADIOBUTTON,83,22,53,8 + CONTROL "Data Capture",IDC_RADIO_DATA_CAPTURE_MODE,"Button",BS_AUTORADIOBUTTON,156,22,57,8 + GROUPBOX "Target Machine",IDC_STATIC,16,40,263,32 + CONTROL "MicroVu",IDC_RADIO_MACHINE_MICROVU,"Button",BS_AUTORADIOBUTTON | WS_GROUP,30,55,38,8 + CONTROL "Mitutoyo",IDC_RADIO_MACHINE_MITUTOYO,"Button",BS_AUTORADIOBUTTON,72,55,40,8 + CONTROL "SevenOcean",IDC_RADIO_MACHINE_SevenOcean,"Button",BS_AUTORADIOBUTTON,116,55,54,8 + CONTROL "Animatics",IDC_RADIO_MACHINE_ANIMATICS,"Button",BS_AUTORADIOBUTTON,174,55,46,10 + CONTROL "Generic",IDC_RADIO_MACHINE_GENERIC,"Button",BS_AUTORADIOBUTTON,224,55,39,8 + PUSHBUTTON "Auto Test",IDC_BUTTON_AUTO_TEST,23,78,79,30 + PUSHBUTTON "Diagnostics",IDC_BUTTON_DIAGNOSTICS,23,112,79,30 + PUSHBUTTON "Replay Startup",IDC_BUTTON_REPLAY_STARTUP,23,146,79,30 + PUSHBUTTON "Protocol Analyzer",IDC_BUTTON_PROTOCOL_ANALYZER,23,180,79,30 + PUSHBUTTON "Collects Usb Data",IDC_BUTTON_START_CAPTURE,23,214,79,30 + PUSHBUTTON "Create Config",IDC_BUTTON_CREATE_CONFIG,23,248,79,30 + PUSHBUTTON "File Utilities",IDC_BUTTON_FILE_UTILITIES,23,282,79,30 + LTEXT "This is a one-click exercise of the target machine.\n\rPlease clear the stage prior to start.\n\rYou will be prompted to confirm this operation later.",IDC_STATIC_AUTO_TEST,114,80,167,28 + LTEXT "Reserved for WAI programmers.",IDC_STATIC_DIAGNOSTICS,114,118,118,9 + LTEXT "Advanced Option to replay a captured file.",IDC_STATIC_REPLAY,114,153,145,9 + LTEXT "Analyze Captured Data.",IDC_STATIC_PROTOCOL_ANALYZER,114,188,96,12 + LTEXT "Intercepts the target machine Usb commands using a custom device driver. You will be prompted for the file destination when done.",IDC_STATIC_COLLECTS_TEXT,114,215,168,27 + LTEXT "Creates/updates mv_config.cfg file. In most cases, you should run the Collects Usb Data prior to building the mv_config.cfg file.",IDC_STATIC_MV_CONFIG,114,250,173,25 + DEFPUSHBUTTON "Exit",IDOK,247,397,50,22 +END + +IDD_DIALOG_PROTOCOL_ANALYZER DIALOGEX 0, 0, 311, 221 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Protocol Analyzer" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Browse",IDC_BUTTON_BROWSE,260,16,33,14 + EDITTEXT IDC_EDIT_INPUT_FILE,52,16,199,12,ES_AUTOHSCROLL + LTEXT "Input File : ",IDC_STATIC,12,17,38,10 + GROUPBOX "Machine",IDC_STATIC_FORMAT,15,38,177,28,WS_GROUP + CONTROL "MicoVu",IDC_RADIO_MACHINE_MICROVU,"Button",BS_AUTORADIOBUTTON,20,51,37,8 + CONTROL "Mitutoyo",IDC_RADIO_MACHINE_MITUTOYO,"Button",BS_AUTORADIOBUTTON,61,51,41,8 + CONTROL "Keyence",IDC_RADIO_MACHINE_KEYENCE_TM3000,"Button",BS_AUTORADIOBUTTON,106,51,37,8 + CONTROL "Generic",IDC_RADIO_MACHINE_GENERIC,"Button",BS_AUTORADIOBUTTON,152,51,37,8 + GROUPBOX "Data Capture Format",IDC_STATIC,204,38,94,28,WS_GROUP + CONTROL "Snoopy",IDC_RADIO_FORMAT_SNOOPY,"Button",BS_AUTORADIOBUTTON,210,51,36,8 + CONTROL "DMS",IDC_RADIO_FORMAT_DMS,"Button",BS_AUTORADIOBUTTON,262,51,25,8 + GROUPBOX "Output Format",IDC_STATIC_OPTION,16,72,204,28,WS_GROUP + CONTROL "Detail",IDC_RADIO_FULL,"Button",BS_AUTORADIOBUTTON,26,84,42,8 + CONTROL "Condensed",IDC_RADIO_EXTRACT,"Button",BS_AUTORADIOBUTTON,66,84,50,8 + CONTROL "Replay",IDC_RADIO_REPLAY_FILE,"Button",BS_AUTORADIOBUTTON,124,84,34,8 + CONTROL "Segment",IDC_RADIO_SEGMENT_FILE,"Button",BS_AUTORADIOBUTTON,167,84,38,8 + CONTROL "De-Dupe",IDC_CHECK_DE_DUPE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,234,84,44,9 + EDITTEXT IDC_EDIT_MESSAGE,17,112,277,82,ES_MULTILINE | ES_AUTOHSCROLL | WS_VSCROLL | WS_HSCROLL + DEFPUSHBUTTON "OK",IDOK,221,200,38,14 + PUSHBUTTON "Exit",IDCANCEL,266,200,38,14 +END + +IDD_DIALOG_AUTO_TEST DIALOGEX 0, 0, 270, 273 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "MicroVu Auto Test Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Go",IDOK,189,243,36,23 + PUSHBUTTON "Exit",IDCANCEL,226,243,36,23 + LTEXT "Iterations (0 for infinite) : ",IDC_STATIC,140,188,84,13 + EDITTEXT IDC_EDIT_ITERATIONS,228,186,22,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_AUTO_TEST_TEXT,9,10,252,113,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL + DEFPUSHBUTTON "Break",IDSTOP,151,243,37,23 + LTEXT "Motion Speed: ",IDC_STATIC,140,202,49,13 + EDITTEXT IDC_EDIT_MOTION_SPEED,228,201,22,12,ES_RIGHT | ES_AUTOHSCROLL + CONTROL "Cycle Ring Lights",IDC_CHECK_CYCLE_RING_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,202,67,10 + CONTROL "Cycle Top/Bottom Lights",IDC_CHECK_CYCLE_TOP_BOTTOM_LIGHTS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,216,90,10 + CONTROL "Cycle Zoom",IDC_CHECK_CYCLE_ZOOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,230,90,10 + CONTROL "Cycle Stage",IDC_CHECK_CYCLE_STAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,188,67,10 + GROUPBOX "Scales",IDC_STATIC,14,126,240,52 + LTEXT "X:",IDC_STATIC,26,143,12,10 + LTEXT "Y:",IDC_STATIC,103,143,12,10 + LTEXT "Z:",IDC_STATIC,180,143,12,10 + LTEXT "Zm:",IDC_STATIC,22,162,12,10 + EDITTEXT IDC_EDIT_SCALE_X,35,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_Y,112,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_Z,189,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_ZM,35,158,58,13,ES_RIGHT | ES_AUTOHSCROLL + CONTROL "Cycle Rotary",IDC_CHECK_CYCLE_ROTARY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,244,90,10 +END + +IDD_DIALOG_UPDATE_MV_CONFIG DIALOGEX 0, 0, 369, 288 +STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE | WS_EX_STATICEDGE +CAPTION "Extract Machine Dependent Strings" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Exit",IDCANCEL,328,263,35,20 + EDITTEXT IDC_EDIT_STATUS_WINDOW,7,156,356,103,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL + PUSHBUTTON "Go",IDC_BUTTON_UPDATE_CONFIG,323,119,38,27 + EDITTEXT IDC_EDIT_MV_CONFIG_FILE,79,134,216,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_GET_MV_CONFIG,298,134,20,12 + LTEXT "Old mv_config.cfg",IDC_STATIC_MV_CONFIG,15,135,61,9 + EDITTEXT IDC_EDIT_SNOOP_LOG_FILE,79,119,216,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_BROWSE_LOG,298,119,20,12 + LTEXT "UsbSnoop.Log",IDC_STATIC_USBSNOOP,15,121,46,9 + CONTROL "Create new _temp_mv_config.cfg file",IDC_RADIO_CREATE_MV_CONFIG, + "Button",BS_AUTORADIOBUTTON,16,100,137,9 + CONTROL "Create _temp_mv_config.cfg from mv_config.cfg",IDC_RADIO_UPDATE_MV_CONFIG, + "Button",BS_AUTORADIOBUTTON,16,87,181,13 + CONTROL " 1. You can create a _temp_mv_config.cfg file from an existing mv_config, or \r\n 2. Create a new _temp_mv_config.cfg without an existing mv_config.cfg file.",IDC_STATIC, + "Static",SS_SIMPLE | SS_SUNKEN | WS_GROUP,13,35,341,23 + LTEXT "The mv_config.cfg file contains parameters that are unique to a specific machine. This program is used to extract machine dependent information from the captured data. ",IDC_STATIC,10,10,315,19 + LTEXT "Remember to rename the _temp_mv_config.cfg file to mv_config.cfg and copy it to the PcDmis execution directory.",IDC_STATIC,14,63,310,19 +END + +IDD_MITU_UTIL_DIALOG DIALOGEX 0, 0, 390, 382 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_APPWINDOW +CAPTION "Mitutoyo Utility" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Exit",IDCANCEL,342,358,39,14 + EDITTEXT IDC_EDIT_HWS_1,326,213,28,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + PUSHBUTTON "start idle poll",IDC_BUTTON_START_POSITION_POLL,146,22,52,14 + PUSHBUTTON "stop machine",IDC_BUTTON_STOP_MACHINE,35,53,52,14 + EDITTEXT IDC_EDIT_STATUS,7,240,375,115,ES_MULTILINE | ES_AUTOHSCROLL,WS_EX_CLIENTEDGE + PUSHBUTTON "Init_MituUSB",IDC_BUTTON_INIT_MITUUSB,15,6,52,14 + PUSHBUTTON "start machine",IDC_BUTTON_START_MACHINE,35,22,52,14 + PUSHBUTTON "Exit_MituUsb",IDC_BUTTON_TERM_MITUUSB,15,69,52,14 + LTEXT "Coaxial",-1,268,21,24,11 + EDITTEXT IDC_EDIT_NEW_STAGE_LIGHT,308,33,28,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + PUSHBUTTON "cycle ring",IDC_BUTTON_CYCLE_RING,92,53,52,14 + PUSHBUTTON "dcc home",IDC_BUTTON_SEEK_HOME,92,22,52,14 + EDITTEXT IDC_EDIT_NEW_COAXIAL_LIGHT,308,19,28,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_NEW_RING_POSITION,308,47,28,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_TS_0,46,102,50,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_SC_X,60,118,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_SC_Y,103,118,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_SC_Z,147,118,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + PUSHBUTTON "disable js",IDC_BUTTON_DISABLE_JOYSTICK,146,38,52,14 + PUSHBUTTON "enable js",IDC_BUTTON_ENABLE_JOYSTICK,92,38,52,14 + EDITTEXT IDC_EDIT_TS_XYZ,147,100,60,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_MOVE_TO_X,275,108,51,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_MOVE_TO_Y,275,122,51,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_MOVE_TO_Z,275,136,51,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LISTBOX IDC_LIST_RING_POSITION,275,150,51,12,LBS_SORT | LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_DISABLED | WS_VSCROLL | WS_TABSTOP,WS_EX_RIGHT + PUSHBUTTON "Move Rel",IDC_BUTTON_MOVE_RELATIVE,336,108,38,12 + CONTROL "Move Abs",IDC_BUTTON_MOVE_ABSOLUTE,"Button",BS_OWNERDRAW | WS_TABSTOP,336,121,38,12 + EDITTEXT IDC_EDIT_TPX_POSITION,25,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_TPY_POSITION,25,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_TPZ_POSITION,25,206,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_DPX_POSITION,84,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_DPY_POSITION,84,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_DPZ_POSITION,84,207,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_RPX_POSITION,143,178,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_RPY_POSITION,143,192,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_RPZ_POSITION,143,207,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_STAGE_STATUS_X,201,178,41,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_STAGE_STATUS_Y,201,192,41,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_STAGE_STATUS_Z,201,206,41,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_JS_MOVED,326,184,28,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_HWS_0,326,198,28,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + GROUPBOX "Stage Position",-1,7,151,243,87 + LTEXT "x",-1,14,179,8,11 + LTEXT "y",-1,14,193,8,11 + LTEXT "z",-1,14,207,8,11 + LTEXT "Zm",-1,12,220,13,11 + EDITTEXT IDC_EDIT_TPZM_POSITION,25,220,54,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "Stage",-1,268,34,24,9 + LTEXT "TP",-1,26,167,9,8 + LTEXT "DP",-1,85,167,10,8 + PUSHBUTTON "Load MITU_Config",IDC_BUTTON_LOAD_MITU_CONFIG,184,68,65,14 + LTEXT "Ring (1-10)",-1,267,49,40,8 + GROUPBOX "Lighting Control",-1,253,6,128,85 + LTEXT "RP",-1,144,167,10,8 + LTEXT "!HWS,?;",-1,265,214,43,11 + GROUPBOX "Machine Status",-1,253,169,128,68 + LTEXT "!HWS?; E-STOP",-1,265,201,50,9 + LTEXT "Y",-1,261,122,9,11 + GROUPBOX "Move XYZ-Zm",-1,253,92,128,76 + LTEXT "X",-1,261,108,9,11 + LTEXT "Zm",-1,261,150,9,11 + LTEXT "Z",-1,261,135,9,11 + LTEXT "JS_MOVED",-1,266,186,30,11 + LTEXT "Status",-1,204,167,27,8 + LTEXT "SC ",-1,17,121,11,10 + LTEXT "Y",-1,96,121,8,10 + LTEXT "Z",-1,139,121,8,10 + LTEXT "TS",-1,18,104,19,10 + GROUPBOX "Move XYZ-Zm",-1,7,92,244,58 + LTEXT "TS_XYZ",-1,115,103,26,10 + CONTROL "Set Zm",IDC_BUTTON_SET_ZOOM,"Button",BS_OWNERDRAW | WS_TABSTOP,335,150,38,12 + EDITTEXT IDC_EDIT_TSX,61,132,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_TSY,103,132,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_TSZ,147,132,27,12,ES_AUTOHSCROLL | NOT WS_TABSTOP + LTEXT "Y",-1,96,134,8,10 + LTEXT "Z",-1,140,134,8,10 + LTEXT "TSX",-1,18,134,8,10 + CONTROL "Set",IDC_BUTTON_SET_LIGHTS,"Button",BS_OWNERDRAW | WS_TABSTOP,350,47,26,12 + LTEXT "Elliptic Mirror",-1,264,67,44,10 + CONTROL "",IDC_SPIN_ELLIPTIC_MIRROR,"msctls_updown32",UDS_ARROWKEYS,336,64,13,14 + EDITTEXT IDC_EDIT_MIRROR,308,65,28,12,ES_AUTOHSCROLL + LTEXT "X",-1,51,121,8,10 +END + +IDD_DIALOG_AUTO_TEST_MITUTOYO DIALOGEX 0, 0, 270, 260 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Mitutoyo Auto Test Dialog" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "Go",IDOK,190,230,36,23 + PUSHBUTTON "Exit",IDCANCEL,227,230,36,23 + LTEXT "Iterations (0 for infinite) : ",IDC_STATIC,142,188,84,13 + EDITTEXT IDC_EDIT_ITERATIONS,230,186,22,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_AUTO_TEST_TEXT,9,10,252,113,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_BORDER | WS_VSCROLL | WS_HSCROLL + DEFPUSHBUTTON "Break",IDSTOP,152,230,37,23 + LTEXT "Motion Speed: ",IDC_STATIC,142,202,49,13 + EDITTEXT IDC_EDIT_MOTION_SPEED,230,201,22,12,ES_RIGHT | ES_AUTOHSCROLL + CONTROL "Cycle Ring Lights",IDC_CHECK_CYCLE_RING_LIGHTS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,202,67,10 + CONTROL "Cycle Top/Bottom Lights",IDC_CHECK_CYCLE_TOP_BOTTOM_LIGHTS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,216,90,10 + CONTROL "Cycle Zoom",IDC_CHECK_CYCLE_ZOOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,230,90,10 + CONTROL "Cycle Stage",IDC_CHECK_CYCLE_STAGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,188,67,10 + GROUPBOX "Scales",IDC_STATIC,14,126,240,52 + LTEXT "X:",IDC_STATIC,26,143,12,10 + LTEXT "Y:",IDC_STATIC,103,143,12,10 + LTEXT "Z:",IDC_STATIC,180,143,12,10 + LTEXT "Zm:",IDC_STATIC,22,162,12,10 + EDITTEXT IDC_EDIT_SCALE_X,35,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_Y,112,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_Z,189,140,58,13,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_SCALE_ZM,35,158,58,13,ES_RIGHT | ES_AUTOHSCROLL +END + +IDD_DIALOG_FILE_UTILITIES DIALOGEX 0, 0, 308, 148 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "File Utilities" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "Binary to HEX ASCII",IDC_RADIO_HEX_BIN2ASCII,"Button",BS_AUTORADIOBUTTON,26,41,87,10 + CONTROL "De-Dupe Text Lines",IDC_RADIO_DEDUPE,"Button",BS_AUTORADIOBUTTON,26,53,78,14 + CONTROL "Hex ASCII to Binary",IDC_RADIO_HEX_ASCII2BIN,"Button",BS_AUTORADIOBUTTON,26,69,91,14 + CONTROL "Dump binary",IDC_RADIO_DUMP_BINARY,"Button",BS_AUTORADIOBUTTON,26,85,64,14 + CONTROL "Extract",IDC_RADIO_EXTRACT,"Button",BS_AUTORADIOBUTTON,26,101,38,14 + EDITTEXT IDC_EDIT_CRITERIA,67,102,179,12,ES_AUTOHSCROLL + CONTROL "Exclude",IDC_CHECK_NEGATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,251,103,43,11 + DEFPUSHBUTTON "OK",IDOK,198,127,50,14 + PUSHBUTTON "Cancel",IDCANCEL,251,127,50,14 + LTEXT "Input File : ",IDC_STATIC,27,19,38,10 + EDITTEXT IDC_EDIT_INPUT_FILE,67,18,179,12,ES_AUTOHSCROLL + PUSHBUTTON "Browse",IDC_BUTTON_BROWSE,250,17,33,14 +END + +IDD_SO7_UTIL_MOVE_LOCATION DIALOGEX 0, 0, 283, 436 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Move To Location(SO7)" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + EDITTEXT IDC_EDIT_MOVE_TO_X,41,78,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MOVE_TO_Y,41,94,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MOVE_TO_Z,41,110,53,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_MOVE_TO_ZM,41,126,53,12,ES_AUTOHSCROLL + CONTROL "Reverse",IDC_CHECK_REVERSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,119,79,43,10 + PUSHBUTTON "Move To XYZ",ID_OK_START,102,101,71,13,BS_MULTILINE + PUSHBUTTON "Move To Zoom",IDC_BUTTON_MOVE_TO_ZOOM,102,124,71,13 + PUSHBUTTON "Move To XYZ(JM)",IDC_BUTTON_MOVE_TO_XYZ_JM,180,78,71,13 + PUSHBUTTON "Move To XYZ(Laser)",IDC_BUTTON_MOVE_TO_XYZ_LASER,180,101,71,13 + PUSHBUTTON "Move To XYZV",IDC_BUTTON_MOVE_TO_XYZV,180,124,71,13 + EDITTEXT IDC_EDIT_REPETEST_DIS,124,224,57,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_REPETEST_TIMES,124,248,57,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_REPETEST_INTERVAL,124,272,45,12,ES_RIGHT | ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_REPETEST_ERRORRANGE,124,296,45,12,ES_RIGHT | ES_AUTOHSCROLL + PUSHBUTTON "Begin",IDC_BUTTON_BEGIN_REPE_TEST,194,234,56,13 + PUSHBUTTON "Save...",IDC_BUTTON_SAVE_REPETEST,194,269,56,13 + GROUPBOX "System",IDC_STATIC,19,9,64,46 + CONTROL "inch",IDC_RADIO_INCH,"Button",BS_AUTORADIOBUTTON | WS_GROUP,33,20,29,10 + CONTROL "mm",IDC_RADIO_MM,"Button",BS_AUTORADIOBUTTON,33,30,27,10 + CONTROL "pulse",IDC_RADIO_SCALE,"Button",BS_AUTORADIOBUTTON,33,40,33,10 + GROUPBOX "Move Type",IDC_STATIC,102,10,68,45 + CONTROL "Relative",IDC_RADIO_MOVE_RELATIVE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,116,22,42,10 + CONTROL "Absolute",IDC_RADIO_MOVE_ABSOLUTE,"Button",BS_AUTORADIOBUTTON,116,38,44,10 + GROUPBOX "Move Speed",IDC_STATIC,185,9,69,46 + CONTROL "Fast",IDC_RADIO_SPEED_FAST,"Button",BS_AUTORADIOBUTTON | WS_GROUP,195,20,30,10 + CONTROL "Slow",IDC_RADIO_SPEED_SLOW,"Button",BS_AUTORADIOBUTTON,195,30,31,10 + CONTROL "User Defined",IDC_RADIO_SPEED_USER_DEFINED,"Button",BS_AUTORADIOBUTTON,195,40,54,10 + PUSHBUTTON "EXIT",IDCANCEL,226,415,50,14 + LTEXT "x",IDC_STATIC,29,78,8,8 + LTEXT "y",IDC_STATIC,29,94,8,8 + LTEXT "z",IDC_STATIC,29,111,8,8 + LTEXT "zm",IDC_STATIC,25,127,8,8 + LTEXT "x",IDC_STATIC,29,172,8,11 + LTEXT "y",IDC_STATIC,29,190,8,11 + LTEXT "z",IDC_STATIC,109,172,8,11 + LTEXT "zm",IDC_STATIC,107,193,11,11 + EDITTEXT IDC_EDIT_X_AXIS,40,171,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Y_AXIS,40,190,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_Z_AXIS,121,171,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + EDITTEXT IDC_EDIT_ZM_AXIS,121,190,54,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_TABSTOP + GROUPBOX "Move To Position",IDC_STATIC,20,63,236,90 + GROUPBOX "Position",IDC_STATIC,18,157,238,50 + PUSHBUTTON "Zero Set",IDC_BUTTON_ZERO_SET,191,179,56,13 + GROUPBOX "Repeatability Test",IDC_STATIC,19,209,238,106 + LTEXT "To",IDC_STATIC,102,225,8,8 + LTEXT "Times",IDC_STATIC,97,251,19,8 + EDITTEXT IDC_EDIT_REPRETEST,22,322,236,67,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + CONTROL "x",IDC_CHECK_REPETESTX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,225,20,10 + CONTROL "y",IDC_CHECK_REPETESTY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,239,20,10 + CONTROL "z",IDC_CHECK_REPETESTZ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,253,20,10 + LTEXT "Pause",IDC_STATIC,95,274,20,8 + LTEXT "ms",IDC_STATIC,172,274,10,8 + CONTROL "Absolute",IDC_CHECK_REPETEST_ABSOLUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,297,44,10 + LTEXT "Deadband",IDC_STATIC,86,298,34,8 + LTEXT "um",IDC_STATIC_DEADBAND_UNITS,172,298,19,8 + CONTROL "VolComp",IDC_CHECK_REPETEST_VOLCOMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,283,43,10 + CONTROL "V",IDC_CHECK_REPETESTV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,37,267,20,10 +END + +IDD_DIALOG_TEST_KEYENCE DIALOGEX 0, 0, 409, 214 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Test Keyence" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + PUSHBUTTON "Exit",IDCANCEL,352,193,50,14 + PUSHBUTTON "Get_Data",IDC_BUTTON_INIT_KEYENCE_LASER,125,41,50,14 + EDITTEXT IDC_EDIT_LASER_VALUE1,30,25,69,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDIT_LASER_VALUE2,30,48,69,14,ES_AUTOHSCROLL + PUSHBUTTON "Run CNC",IDC_BUTTON_RUNCNC,379,25,6,14,NOT WS_VISIBLE + GROUPBOX "LKIF.dll",IDC_STATIC,11,10,380,98 + GROUPBOX "libusb.lib",IDC_STATIC,355,16,35,27,NOT WS_VISIBLE + PUSHBUTTON "Init_KeyenceUsb",IDC_BUTTON_INIT_KEYENCE_USB,359,25,6,14,NOT WS_VISIBLE + PUSHBUTTON "Reset",IDC_BUTTON_RESET_KEYENCE_USB,365,25,7,14,NOT WS_VISIBLE + PUSHBUTTON "Exit_Keyence_Usb",IDC_BUTTON_EXIT_KEYENCE_USB,373,25,6,14,NOT WS_VISIBLE + EDITTEXT IDC_EDIT_TEST_KEYENCE_MESSAGE,15,115,377,73,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + PUSHBUTTON "Begin Scan",IDC_BUTTON_SCAN_KEYENCE_LK_GLASER,200,27,50,14 + CONTROL "Continue",IDC_CHECK_CONTINUE_READ_LASER_VALUE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,133,27,45,10 + PUSHBUTTON "Stop Scan",IDC_BUTTON_STOP_SCAN_KEYENCE_LK_GLASER,200,46,50,14 + PUSHBUTTON "Get Data",IDC_BUTTON_GET_SCAN_DATA_KEYENCE_LK_GLASER,200,64,50,14 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_ABOUTBOX, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 191 + TOPMARGIN, 7 + BOTTOMMARGIN, 56 + END + + IDD_MV_UTIL_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 400 + TOPMARGIN, 6 + BOTTOMMARGIN, 382 + END + + IDD_MV_UTIL_MOVE_LOCATION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 3 + BOTTOMMARGIN, 327 + END + + IDD_DIALOG_SET_LIGHTS, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 121 + TOPMARGIN, 7 + BOTTOMMARGIN, 80 + END + + IDD_DIALOG_MAIN_MENU, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 297 + TOPMARGIN, 7 + BOTTOMMARGIN, 419 + END + + IDD_DIALOG_PROTOCOL_ANALYZER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 304 + TOPMARGIN, 7 + BOTTOMMARGIN, 214 + END + + IDD_DIALOG_AUTO_TEST, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 263 + TOPMARGIN, 7 + BOTTOMMARGIN, 266 + END + + IDD_DIALOG_UPDATE_MV_CONFIG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 363 + TOPMARGIN, 4 + BOTTOMMARGIN, 283 + END + + IDD_MITU_UTIL_DIALOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 382 + TOPMARGIN, 6 + BOTTOMMARGIN, 375 + END + + IDD_DIALOG_AUTO_TEST_MITUTOYO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 263 + TOPMARGIN, 7 + BOTTOMMARGIN, 253 + END + + IDD_DIALOG_FILE_UTILITIES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 301 + TOPMARGIN, 7 + BOTTOMMARGIN, 141 + END + + IDD_SO7_UTIL_MOVE_LOCATION, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 276 + TOPMARGIN, 7 + BOTTOMMARGIN, 429 + END + + IDD_DIALOG_TEST_KEYENCE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 402 + TOPMARGIN, 7 + BOTTOMMARGIN, 207 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "#define _AFX_NO_SPLITTER_RESOURCES\r\n" + "#define _AFX_NO_OLE_RESOURCES\r\n" + "#define _AFX_NO_TRACKER_RESOURCES\r\n" + "#define _AFX_NO_PROPERTY_RESOURCES\r\n" + "\r\n" + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""res\\Mv_Util.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#include ""afxres.rc"" // Standard components\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2012,0,0,1 + PRODUCTVERSION 2012,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Hexagon" + VALUE "FileDescription", "Hexagon" + VALUE "FileVersion", "1.0.0.1" + VALUE "InternalName", "Usb_Util.exe" + VALUE "LegalCopyright", "(c) . All rights reserved." + VALUE "OriginalFilename", "Usb_Util.exe" + VALUE "ProductName", "Utility" + VALUE "ProductVersion", "1.0.0.1" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_ABOUTBOX "&About Mv_Util..." +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#define _AFX_NO_SPLITTER_RESOURCES +#define _AFX_NO_OLE_RESOURCES +#define _AFX_NO_TRACKER_RESOURCES +#define _AFX_NO_PROPERTY_RESOURCES + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "res\Mv_Util.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.sln b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.sln new file mode 100644 index 0000000..d43dd77 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mv_Util", "Mv_Util\Mv_Util.vcproj", "{50B21A79-C887-4F7E-8911-7E3A685BFA25}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.ActiveCfg = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.Build.0 = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.ActiveCfg = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.filters b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.filters new file mode 100644 index 0000000..607b256 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.filters @@ -0,0 +1,158 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.user b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.cpp new file mode 100644 index 0000000..a6d292d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.cpp @@ -0,0 +1,827 @@ +// Mv_UtilDlg.cpp : implementation file +// + +#include "stdafx.h" +#include "Mv_Util.h" +#include "Mv_UtilDlg.h" +#include "Mv_Move_Location.h" +#include "Mv_SetLights.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +char *str_limits_x = "\r\nStage Limits X: "; +char *str_limits_y = "\r\nStage Limits Y: "; +char *str_limits_z = "\r\nStage Limits Z: "; +char *str_scale_range_x = "\r\nScale Range X : "; +char *str_scale_range_y = "\r\nScale Range Y : "; +char *str_scale_range_z = "\r\nScale Range Z : "; +char *str_max_speed_x = "\r\nMax Speed X : "; +char *str_max_speed_y = "\r\nMax Speed Y : "; +char *str_max_speed_z = "\r\nMax Speed Z : "; +char *str_max_accel_x = "\r\nMax Accel X : "; +char *str_max_accel_y = "\r\nMax Accel Y : "; +char *str_max_accel_z = "\r\nMax Accel Z : "; +char *str_max_decel_x = "\r\nMax Decel X : "; +char *str_max_decel_y = "\r\nMax Decel Y : "; +char *str_max_decel_z = "\r\nMax Decel Z : "; +char *str_index_x = "\r\nIndex Positions X: "; +char *str_index_y = "\r\nIndex Positions Y: "; +char *str_index_z = "\r\nIndex Positions Z: "; +char *str_model = "\r\nModel : "; +char *str_serial_no = "\r\nSerial No : "; + +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialog +{ +public: + CAboutDlg(); + +// Dialog Data + enum { IDD = IDD_ABOUTBOX }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + +// Implementation +protected: + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +{ +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) +END_MESSAGE_MAP() + +// CMv_UtilDlg dialog + +CMv_UtilDlg::CMv_UtilDlg(CWnd* pParent /*=NULL*/) + : CDialog(CMv_UtilDlg::IDD, pParent) + , m_lPositionSpeedTestPerSec(0) + , m_Mode(0) // set to Auto Test Mode +{ + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); +} + +void CMv_UtilDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_X_POSITION_58, m_X_Pos_58); + DDX_Text(pDX, IDC_EDIT_Y_POSITION_58, m_Y_Pos_58); + DDX_Text(pDX, IDC_EDIT_Z_POSITION_58, m_Z_Pos_58); + DDX_Text(pDX, IDC_EDIT_X_POSITION_59, m_X_Pos_59); + DDX_Text(pDX, IDC_EDIT_Y_POSITION_59, m_Y_Pos_59); + DDX_Text(pDX, IDC_EDIT_Z_POSITION_59, m_Z_Pos_59); + DDX_Text(pDX, IDC_EDIT1, m_lPositionSpeedTestPerSec); +} + +BEGIN_MESSAGE_MAP(CMv_UtilDlg, CDialog) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + //}}AFX_MSG_MAP + ON_BN_CLICKED(IDC_BUTTON_INIT_MVUSB, &CMv_UtilDlg::OnBnClickedButtonInitMvusb) + ON_BN_CLICKED(IDC_BUTTON_TERM_MVUSB, &CMv_UtilDlg::OnBnClickedButtonTermMvusb) + ON_BN_CLICKED(IDC_BUTTON_STOP_MACHINE, &CMv_UtilDlg::OnBnClickedButtonStopMachine) + ON_BN_CLICKED(IDC_BUTTON_START_MACHINE, &CMv_UtilDlg::OnBnClickedButtonStartMachine) + ON_BN_CLICKED(IDC_BUTTON_START_POLL_59, &CMv_UtilDlg::OnBnClickedButtonStartPoll59) + ON_BN_CLICKED(IDC_BUTTON_CYCLE_RING, &CMv_UtilDlg::OnBnClickedButtonCycleRing) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BUTTON_START_POLL_58, &CMv_UtilDlg::OnBnClickedButtonStartPoll58) + ON_BN_CLICKED(IDC_BUTTON_SEEK_HOME, &CMv_UtilDlg::OnBnClickedButtonDccSeekHome) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO, &CMv_UtilDlg::OnBnClickedButtonMoveTo) + ON_BN_CLICKED(IDCANCEL, &CMv_UtilDlg::OnBnClickedExit) + ON_BN_CLICKED(IDC_BUTTON_START_POLL_2B, &CMv_UtilDlg::OnBnClickedButtonStartPoll2b) + ON_BN_CLICKED(IDC_BUTTON_SET_LIGHT, &CMv_UtilDlg::OnBnClickedButtonSetLight) + ON_BN_CLICKED(IDC_BUTTON_LOAD_CONFIG, &CMv_UtilDlg::OnBnClickedButtonLoadConfig) + ON_BN_CLICKED(IDC_BUTTON_GET_CONFIG, &CMv_UtilDlg::OnBnClickedButtonGetConfig) + ON_BN_CLICKED(IDC_POLLING_SPEEDTEST, &CMv_UtilDlg::OnBnClickedPollingSpeedtest) + ON_BN_CLICKED(IDC_BUTTON_GET_INDEX, &CMv_UtilDlg::OnBnClickedButtonGetIndex) + ON_BN_CLICKED(IDC_BUTTON_DISABLE_JOYSTICK, &CMv_UtilDlg::OnBnClickedButtonDisableJoystick) + ON_BN_CLICKED(IDC_BUTTON_ENABLE_JOYSTICK, &CMv_UtilDlg::OnBnClickedButtonEnableJoystick) + ON_BN_CLICKED(IDC_BUTTON_POLL_EP_02, &CMv_UtilDlg::OnBnClickedButtonPollEp02) +END_MESSAGE_MAP() + +// CMv_UtilDlg message handlers + +BOOL CMv_UtilDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(true); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(false); + + m_OutMessage = _T("System Ready.\r\nPress 'Init_MvUSB' to start."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + ((CButton *)GetDlgItem(IDC_POLLING_SPEEDTEST))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_STATIC_SEC))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_EDIT_SAMPLING))->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_BUTTON_GET_INDEX))->EnableWindow(false); + + return TRUE; // return TRUE unless you set the focus to a control +} + +//================================================================================================ +void CMv_UtilDlg::OnSysCommand(UINT nID, LPARAM lParam) +{ + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialog::OnSysCommand(nID, lParam); + } +} + +//================================================================================================ +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CMv_UtilDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, reinterpret_cast(dc.GetSafeHdc()), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } +} + +//================================================================================================ +// The system calls this function to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CMv_UtilDlg::OnQueryDragIcon() +{ + return static_cast(m_hIcon); +} + +//============================================================================================= +// +//============================================================================================= +void CMv_UtilDlg::OnBnClickedButtonInitMvusb() +{ + if (0) + { + AXISMOVE X; + AXISMOVE Y; + AXISMOVE Z; + X.dFromMM = 0.0; + X.dToMM = 100.0; + Y.dFromMM = 0.0; + Y.dToMM = 100.0; + Z.dFromMM = 0.0; + Z.dToMM = 10.0; + m_pMv_Proto->g_machine.s_machine_config.x_axis._max_speed = 100000; + m_pMv_Proto->g_machine.s_machine_config.x_axis._scale_resolution = 0.001; + m_pMv_Proto->g_machine.s_machine_config.y_axis._max_speed = 100000; + m_pMv_Proto->g_machine.s_machine_config.y_axis._scale_resolution = 0.001; + m_pMv_Proto->g_machine.s_machine_config.z_axis._max_speed = 100000; + m_pMv_Proto->g_machine.s_machine_config.z_axis._scale_resolution = 0.001; + + m_pMv_Proto->_calculate_straightline_motion(X, Y, Z, 20.0); + m_pMv_Proto->_set_position_xyz(X, Y, Z); + ASSERT(0); + } + + if (m_pMv_Proto) + { + if (m_pMv_Proto->Init_MvUsb()) + { + ((CButton *)GetDlgItem(IDC_RADIO_FORMAT_SNOOPY))->SetCheck(1); + m_OutMessage = _T("Usb Port Error"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + return; + }; + }; + + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(false); + m_OutMessage = _T("Usb Port Initialized.\r\n"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + GetDlgItem(IDCANCEL)->EnableWindow(false); +}; + +//================================================================================================== +// +//================================================================================================== +void CMv_UtilDlg::OnBnClickedButtonTermMvusb() +{ + m_pMv_Proto->Exit_MvUsb(); + m_OutMessage = _T("Ready - Usb Port Released"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_INDEX)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(false); + GetDlgItem(IDCANCEL)->EnableWindow(true); + KillTimer(1); +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonStopMachine() +{ + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_INDEX)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(false); + KillTimer(1); + m_pMv_Proto->g_machine.s_status._poll_59_active = false; + m_pMv_Proto->g_machine.s_status._poll_58_active = false; + m_pMv_Proto->g_machine.s_status._poll_2b_active = false; + m_pMv_Proto->_shutdown_machine(); +} + +//================================================================================================ +// Start Machine is actually getting configuration data. +// If Index is not found, do homing initialization automatically. +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonStartMachine() +{ + m_pMv_Proto->_start_machine(); + OnBnClickedButtonGetIndex(); + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(true); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(true); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(true); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(true); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(true); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(true); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(true); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + GetDlgItem(IDC_BUTTON_GET_INDEX)->EnableWindow(true); + GetDlgItem(IDCANCEL)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(true); + SetTimer(1, 20, 0); +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonStartPoll59() +{ + if (m_pMv_Proto->g_machine.s_status._poll_59_active) + { + m_pMv_Proto->g_machine.s_status._poll_59_active = false; + m_pMv_Proto->g_machine.s_status._poll_2b_active = false; + m_pMv_Proto->_poll_machine_59(); + } + else + { + m_pMv_Proto->g_machine.s_status._poll_59_active = true; + m_pMv_Proto->g_machine.s_status._poll_2b_active = true; + m_pMv_Proto->_poll_machine_59(); + } +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonCycleRing() +{ + if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 2) + { + for (int ii=0 ; iig_machine.s_lights_200._segment[ii][jj] = 256; + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + m_pMv_Proto->g_machine.s_lights_200._segment[ii][jj] = 0; + m_pMv_Proto->mv_light_set_light(); + } + } + } + else +// if (m_pMv_Proto->g_machine.s_machine_config._vector_light_model == 3) + { + for (int ii=0 ; iig_machine.s_lights_300._segment[ii][jj] = 256; + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + m_pMv_Proto->g_machine.s_lights_300._segment[ii][jj] = 0; + m_pMv_Proto->mv_light_set_light(); + } + } + } + MessageBeep(MB_ICONINFORMATION); + + for (int lIntensity = 0 ; lIntensity < MAXINTENSITY ; lIntensity += (long)(MAXINTENSITY*0.05)) + { + m_pMv_Proto->mv_set_full_ringlight_data(lIntensity); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + + MessageBeep(MB_ICONINFORMATION); + + for (int lIntensity = MAXINTENSITY ; lIntensity > 0 ; lIntensity -= (long)(MAXINTENSITY*0.05)) + { + m_pMv_Proto->mv_set_full_ringlight_data(lIntensity); + m_pMv_Proto->mv_light_set_light(); + Sleep(100); + } + MessageBeep(MB_ICONINFORMATION); +} + +//================================================================================================ +//================================================================================================ +void CMv_UtilDlg::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + static long lCount=0; + if (m_pMv_Proto) + { + static bool bOld = false; + if (bOld) + { + m_X_Pos_59.Format(_T("%8ld"),(m_pMv_Proto->g_machine.x._pos_59)); + GetDlgItem(IDC_EDIT_X_POSITION_59)->SetWindowText(m_X_Pos_59); + m_Y_Pos_59.Format(_T("%8ld"),(m_pMv_Proto->g_machine.y._pos_59)); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->SetWindowText(m_Y_Pos_59); + m_Z_Pos_59.Format(_T("%8ld"),(m_pMv_Proto->g_machine.z._pos_59)); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->SetWindowText(m_Z_Pos_59); + + m_X_Pos_58.Format(_T("%8ld"), m_pMv_Proto->g_machine.x._pos_58); + GetDlgItem(IDC_EDIT_X_POSITION_58)->SetWindowText(m_X_Pos_58); + m_Y_Pos_58.Format(_T("%8ld"), m_pMv_Proto->g_machine.y._pos_58); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->SetWindowText(m_Y_Pos_58); + m_Z_Pos_58.Format(_T("%8ld"), m_pMv_Proto->g_machine.z._pos_58); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->SetWindowText(m_Z_Pos_58); + } + else + { + ++lCount; + if (m_pMv_Proto->g_machine.s_status._machine_running) + { + if (lCount%10 == 0 && m_pMv_Proto->g_machine.s_status._poll_58_active) + { + long lX=0, lY=0, lZ=0; + m_pMv_Proto->_send_cmd_MV_CMD_GET_SCALE_58(lX, lY, lZ); + double dX, dY, dZ; + dX = m_pMv_Proto->ScaleToMM(lX, m_pMv_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + dY = m_pMv_Proto->ScaleToMM(lY, m_pMv_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + dZ = m_pMv_Proto->ScaleToMM(lZ, m_pMv_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + + m_X_Pos_58.Format(_T("%8.4lf"), dX); + GetDlgItem(IDC_EDIT_X_POSITION_58)->SetWindowText(m_X_Pos_58); + m_Y_Pos_58.Format(_T("%8.4lf"), dY); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->SetWindowText(m_Y_Pos_58); + m_Z_Pos_58.Format(_T("%8.4lf"), dZ); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->SetWindowText(m_Z_Pos_58); + m_ZM_Pos_58.Format(_T("%8ld"), m_pMv_Proto->g_machine.zm._pos_58); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->SetWindowText(m_ZM_Pos_58); + } + + if (m_pMv_Proto->g_machine.s_status._poll_59_active) + { + double dX=0.0, dY=0.0, dZ=0.0; + m_pMv_Proto->mv_motion_get_position_xyz(dX, dY, dZ); + m_X_Pos_59.Format(_T("%8.4lf"), dX); + GetDlgItem(IDC_EDIT_X_POSITION_59)->SetWindowText(m_X_Pos_59); + m_Y_Pos_59.Format(_T("%8.4lf"), dY); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->SetWindowText(m_Y_Pos_59); + m_Z_Pos_59.Format(_T("%8.4lf"), dZ); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->SetWindowText(m_Z_Pos_59); + m_ZM_Pos_59.Format(_T("%8ld"), m_pMv_Proto->g_machine.zm._pos_59); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->SetWindowText(m_ZM_Pos_59); + } + + if (lCount%20 == 0 && m_pMv_Proto->g_machine.s_status._poll_2b_active) + m_pMv_Proto->_poll_machine_2b(); + } + } + } + CDialog::OnTimer(nIDEvent); +} + +//================================================================================================ +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonStartPoll58() +{ +// GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); +#pragma message("why do we set something twice") + if (m_pMv_Proto->g_machine.s_status._poll_58_active) + { + m_pMv_Proto->g_machine.s_status._poll_58_active = false; + } + else + { + m_pMv_Proto->g_machine.s_status._poll_58_active = true; + } +} + +//================================================================================================ +// 530001010000000000000000000000000000000000000003d08f0003d08f0000000000000000000f423b000f423b0000000000000000003d08ee003d08ee00000000000000000000000000000000000000000000000000000000000000000000 +// *Speed : 00249999 00249999 00000000 00000000 +// *Unk1 : 00999995 00999995 00000000 00000000 +// *Unk2 : 03999982 03999982 00000000 00000000 +//================================================================================================ +// Set to slow speed, find the homing marks. +// There is one standard homing mark where we keep it from manual homing. +// Duplicate from Cold Start 2.91 InSpec +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonDccSeekHome() +{ + m_pMv_Proto->mv_motion_Dcc_Home(); + return; +} + +//================================================================================================ +/* +> [endpoint 0x00000001] 00000060 : 530001010100000170d30000b52d0000cd2f000000000000a796000064510000003200000000000f423b000922390000138800000000003d08ef002488e500030d40000000000000000000000000000000000000000000000000000000000000 + [317683 ms] *Command : 53 Move To -- X Y Z ZM Scale00094419 00046381 00052527 00000000 + *Speed : 00042902 00025681 00000050 00000000 + *Unk1 : 00999995 00598585 00005000 00000000 + *Unk2 : 03999983 02394341 00200000 00000000 +*/ +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonMoveTo() +{ + CMv_Move_Location* pMove_Location = new CMv_Move_Location(); + pMove_Location->DoModal(); + delete pMove_Location; + return; +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedExit() +{ + CDialog::OnCancel(); +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonStartPoll2b() +{ + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + m_pMv_Proto->g_machine.s_status._poll_2b_active = true; +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonSetLight() +{ + CMv_SetLights* pSetLights = new CMv_SetLights(); + pSetLights->DoModal(); + delete pSetLights; +} + +//================================================================================================ +void CMv_UtilDlg::OnBnClickedButtonLoadConfig() +{ + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(false); + ((CButton *)GetDlgItem(IDC_RADIO_FORMAT_SNOOPY))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_CHECK_ANNOTATED))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_CHECK_CONDENSED))->SetCheck(0); + m_pMv_Proto->Load_MicroVu_Config(); + m_OutMessage += _T("\r\nConfiguration Retrieved. Ready to start the machine."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); +} + +//================================================================ +void CMv_UtilDlg::OnBnClickedButtonGetConfig() +{ + m_pMv_Proto->_get_config(); + m_OutMessage += _T("\r\n Get config done"); + ShowConfig(); +} + +//================================================================================ +void CMv_UtilDlg::ShowConfig() +{ + +#pragma message("Expand and clean up the ShowConfig code to show parameters in the UI after a get config") + + CString strTemp; + m_OutMessage += str_limits_x; + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._neg_working_limit); + m_OutMessage += _T(" : "); + m_OutMessage += strTemp; + m_OutMessage += _T(" : "); + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._pos_working_limit); + m_OutMessage += strTemp; + + m_OutMessage += str_scale_range_x; + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._scale_range); + m_OutMessage += _T(" : "); + m_OutMessage += strTemp; + + m_OutMessage += str_max_speed_x; + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._max_speed); + m_OutMessage += _T(" : "); + m_OutMessage += strTemp; + + m_OutMessage += str_max_accel_x; + m_OutMessage += _T(" : "); + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._max_accel); + m_OutMessage += strTemp; + + m_OutMessage += str_max_decel_x; + m_OutMessage += _T(" : "); + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._max_decel); + m_OutMessage += strTemp; + + m_OutMessage += str_index_x; + m_OutMessage += _T(" : "); + strTemp.Format(_T("%d"), m_pMv_Proto->g_machine.s_machine_config.x_axis._index_03); + m_OutMessage += strTemp; + + m_OutMessage += str_model; + m_OutMessage += m_pMv_Proto->g_machine.s_machine_config._str_model; + m_OutMessage += str_serial_no; + m_OutMessage += m_pMv_Proto->g_machine.s_machine_config._str_serial_no; + + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); // + + // update index postion + CString _Index; + _Index.Format(_T("%f"),(m_pMv_Proto->g_machine.s_machine_config.x_axis._index_03)); + GetDlgItem(IDC_EDIT_X_INDEX)->SetWindowText(_Index); + _Index.Format(_T("%f"),(m_pMv_Proto->g_machine.s_machine_config.y_axis._index_03)); + GetDlgItem(IDC_EDIT_Y_INDEX)->SetWindowText(_Index); + _Index.Format(_T("%f"),(m_pMv_Proto->g_machine.s_machine_config.z_axis._index_03)); + GetDlgItem(IDC_EDIT_Z_INDEX)->SetWindowText(_Index); +}; + +void CMv_UtilDlg::OnBnClickedPollingSpeedtest() +{ + double dX, dY, dZ; + double dStartTime = m_pMv_Proto->TimeInSecs(); + long lCount = 0; + double dSeconds = 3.0; + while (m_pMv_Proto->TimeInSecs() - dStartTime < dSeconds) + { + m_pMv_Proto->mv_motion_get_position_xyz( dX, dY, dZ ); + ++lCount; + } + m_lPositionSpeedTestPerSec = (long)(lCount / dSeconds); + UpdateData(FALSE); +} + +//======================================================== +void CMv_UtilDlg::OnBnClickedButtonGetIndex() +{ + m_pMv_Proto->_get_xyz_index(); + CString _Index; + _Index.Format(_T("%8d"),(m_pMv_Proto->g_machine.s_machine_config.x_axis._index_03)); + GetDlgItem(IDC_EDIT_X_INDEX)->SetWindowText(_Index); + _Index.Format(_T("%8d"),(m_pMv_Proto->g_machine.s_machine_config.y_axis._index_03)); + GetDlgItem(IDC_EDIT_Y_INDEX)->SetWindowText(_Index); + _Index.Format(_T("%8d"),(m_pMv_Proto->g_machine.s_machine_config.z_axis._index_03)); + GetDlgItem(IDC_EDIT_Z_INDEX)->SetWindowText(_Index); +} + +//======================================================== +void CMv_UtilDlg::OnBnClickedButtonDiagnostic() +{ + GetDlgItem(IDC_BUTTON_INIT_MVUSB)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_START_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_59)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_58)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_START_POLL_2B)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEEK_HOME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_59)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZM_POSITION_58)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CYCLE_RING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_TERM_MVUSB)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_LOAD_CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_GET_CONFIG)->EnableWindow(false); + m_OutMessage = _T("Diagnostics Mode Active.\r\nPress 'InitUsb' to start."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + GetDlgItem(IDC_POLLING_SPEEDTEST)->EnableWindow(false); + GetDlgItem(IDC_STATIC_SEC)->EnableWindow(false); + GetDlgItem(IDC_EDIT_SAMPLING)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_INDEX)->EnableWindow(false); + GetDlgItem(IDC_EDIT_X_INDEX)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Y_INDEX)->EnableWindow(false); + GetDlgItem(IDC_EDIT_Z_INDEX)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_DISABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ENABLE_JOYSTICK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_POLL_EP_02)->EnableWindow(false); +} + +//======================================================== +void CMv_UtilDlg::OnBnClickedButtonDisableJoystick() +{ + m_pMv_Proto->_send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(false); +} + +//======================================================== +void CMv_UtilDlg::OnBnClickedButtonEnableJoystick() +{ + m_pMv_Proto->_send_cmd_MV_CMD_SET_JOYSTICK_MODE_47(true); +} + +//======================================================== +void CMv_UtilDlg::OnBnClickedButtonPollEp02() +{ + long lX; + long lY; + long lZ; + long lZM; + m_OutMessage += _T("\r\nGet Fine Scale :"); + m_pMv_Proto->_send_cmd_MV_CMD_GET_FINE_SCALE(lX, lY, lZ, lZM); + // update index postion + CString _Index; + _Index.Format(_T("%d "),lX); + m_OutMessage += _Index; + _Index.Format(_T("%d "),(lY)); + m_OutMessage += _Index; + _Index.Format(_T("%d "),(lZ)); + m_OutMessage += _Index; + _Index.Format(_T("%d "),(lZM)); + m_OutMessage += _Index; + m_OutMessage += _T("\r\n"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + UpdateData(TRUE); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.h new file mode 100644 index 0000000..d79a37d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_UtilDlg.h @@ -0,0 +1,69 @@ +#include "..\..\..\MicroVu\Mv_Proto.h" + + +extern CMv_Proto* m_pMv_Proto; + +#pragma once + +// CMv_UtilDlg dialog +class CMv_UtilDlg : public CDialog +{ +// Construction +public: + CMv_UtilDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + enum { IDD = IDD_MV_UTIL_DIALOG }; + + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + +// Implementation +protected: + HICON m_hIcon; + // Generated message map functions + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + DECLARE_MESSAGE_MAP() +public: + BOOL m_Mode; // 0 - Auto Mode, 1 - Diagnostics + CString m_X_Pos_58; + CString m_Y_Pos_58; + CString m_Z_Pos_58; + CString m_ZM_Pos_58; + CString m_X_Pos_59; + CString m_Y_Pos_59; + CString m_Z_Pos_59; + CString m_ZM_Pos_59; + CString m_OutMessage; + afx_msg void OnBnClickedButtonInitMvusb(); + afx_msg void OnBnClickedButtonTermMvusb(); + afx_msg void OnBnClickedButtonStopMachine(); + afx_msg void OnBnClickedButtonStartMachine(); + afx_msg void OnBnClickedButtonStartPoll59(); + afx_msg void OnEnSetfocusEditBottomLight(); + afx_msg void OnEnSetfocusEditAxial(); + afx_msg void OnBnClickedButtonCycleRing(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnBnClickedButtonStartPoll58(); + afx_msg void OnBnClickedButtonDccSeekHome(); + afx_msg void OnBnClickedButtonMoveTo(); + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedExit(); + afx_msg void OnBnClickedButtonStartPoll2b(); + afx_msg void OnBnClickedButtonSetLight(); + afx_msg void OnBnClickedButtonReplugUsb(); + afx_msg void OnBnClickedButtonLoadConfig(); + afx_msg void OnBnClickedButtonGetConfig(); + void ShowConfig(); + afx_msg void OnBnClickedPollingSpeedtest(); + long m_lPositionSpeedTestPerSec; + afx_msg void OnBnClickedButtonGetIndex(); + afx_msg void OnBnClickedButtonDiagnostic(); + afx_msg void OnBnClickedButtonDisableJoystick(); + afx_msg void OnBnClickedButtonEnableJoystick(); + afx_msg void OnBnClickedButtonPollEp02(); + afx_msg void OnEnChangeEditXPosition59(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2008.sln b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2008.sln new file mode 100644 index 0000000..d43dd77 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2008.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mv_Util", "Mv_Util\Mv_Util.vcproj", "{50B21A79-C887-4F7E-8911-7E3A685BFA25}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.ActiveCfg = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.Build.0 = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.ActiveCfg = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.sln b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.sln new file mode 100644 index 0000000..05dcd41 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mv_Util", "Mv_Util\Mv_Util.vcxproj", "{50B21A79-C887-4F7E-8911-7E3A685BFA25}" + ProjectSection(ProjectDependencies) = postProject + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4} = {C52E6FA6-AFF5-468D-A82F-E9932E8203D4} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb0", "..\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj", "{C52E6FA6-AFF5-468D-A82F-E9932E8203D4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.ActiveCfg = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.Build.0 = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|x64.ActiveCfg = Debug|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|x64.Build.0 = Debug|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.ActiveCfg = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.Build.0 = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|x64.ActiveCfg = Release|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|x64.Build.0 = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Win32.Build.0 = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|x64.ActiveCfg = Debug|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|x64.Build.0 = Debug|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Win32.ActiveCfg = Release|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Win32.Build.0 = Release|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|x64.ActiveCfg = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.suo b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.suo new file mode 100644 index 0000000..3c8923d Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Mv_Util_VS2010.suo differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.cpp new file mode 100644 index 0000000..7ebc872 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.cpp @@ -0,0 +1,223 @@ +// ProcessButton.cpp : ʵļ +// + +#include "stdafx.h" +#include "resource.h" +#include "afxwin.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "..\..\..\SevenOcean\CMMIO_SERIAL.H" +#include "..\..\..\Animatics\Animatics_Proto.h" + +#include "ProcessButton.h" + +extern CSO7_Proto* m_pSO7_Proto; +extern SmartMotor_Proto* pSmartMotor_Proto; +//#include "SO7_Move_Location.h" + +// CProcessButton + +IMPLEMENT_DYNAMIC(CProcessButton, CButton) + +CProcessButton::CProcessButton() +{ + +} + +CProcessButton::~CProcessButton() +{ +} + + +BEGIN_MESSAGE_MAP(CProcessButton, CButton) + ON_WM_LBUTTONDOWN() + ON_WM_LBUTTONUP() + ON_WM_LBUTTONDBLCLK() +END_MESSAGE_MAP() + + +// CProcessButton Ϣ + + +//==================================== +void CProcessButton::OnLButtonDown(UINT nFlags, CPoint point) +{ + if ( point.x>0 ) + { + if (nFlags == MK_LBUTTON) + { + int iCtrlID; + iCtrlID=GetDlgCtrlID(); + + switch (iCtrlID) + { + //====================================================================================== + case IDC_BUTTON_SO7_MOVE_X_LEFT: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_X(-m_pSO7_Proto->g_machine.x._Move_Speed_Gear); + /* if(m_pSO7_Proto->g_machine.x._Move_Speed_Gear==4) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale((m_pSO7_Proto->g_machine.s_machine_config.x_axis._neg_working_limit-m_pSO7_Proto->g_machine.x._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + }*/ + break; + } + case IDC_BUTTON_SO7_MOVE_X_RIGHT: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_X(m_pSO7_Proto->g_machine.x._Move_Speed_Gear); + /* if(m_pSO7_Proto->g_machine.x._Move_Speed_Gear==4) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale((m_pSO7_Proto->g_machine.s_machine_config.x_axis._pos_working_limit-m_pSO7_Proto->g_machine.x._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + }*/ + break; + } + case IDC_BUTTON_SO7_MOVE_Y_FRONT: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Y(m_pSO7_Proto->g_machine.y._Move_Speed_Gear); + /* if(m_pSO7_Proto->g_machine.y._Move_Speed_Gear==4) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale((m_pSO7_Proto->g_machine.s_machine_config.y_axis._pos_working_limit-m_pSO7_Proto->g_machine.y._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + }*/ + break; + } + case IDC_BUTTON_SO7_MOVE_Y_BACK: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Y(-m_pSO7_Proto->g_machine.y._Move_Speed_Gear); + //if(m_pSO7_Proto->g_machine.y._Move_Speed_Gear==4) + //{ + // m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale((m_pSO7_Proto->g_machine.s_machine_config.y_axis._neg_working_limit-m_pSO7_Proto->g_machine.y._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + // m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + // m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + // m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + //} + break; + } + case IDC_BUTTON_SO7_MOVE_Z_UP: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Z(m_pSO7_Proto->g_machine.z._Move_Speed_Gear); + break; + } + case IDC_BUTTON_SO7_MOVE_Z_DOWN: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Z(-m_pSO7_Proto->g_machine.z._Move_Speed_Gear); + break; + } + case IDC_BUTTON_SO7_MOVE_ZOOM_IN: + case IDC_BUTTON_MOVEV_IN: + case IDC_BTN_CONFIGURE_MOVEVIN: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_ZM(m_pSO7_Proto->g_machine.zm._Move_Speed_Gear); + break; + } + case IDC_BUTTON_SO7_MOVE_ZOOM_OUT: + case IDC_BUTTON_MOVEV_OUT: + case IDC_BTN_CONFIGURE_MOVEVOUT: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_ZM(-m_pSO7_Proto->g_machine.zm._Move_Speed_Gear); + break; + } + //======================================================================== + case IDC_BUTTON_ANIMATICS_MOVE_X_LEFT: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEX(FALSE); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEX(TRUE); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Y_BACK: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEY(FALSE); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEY(TRUE); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEZ(FALSE); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Z_UP: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_MOVEZ(TRUE); + break; + } + default: + break; + + } + } + } +} + +//==================================== +void CProcessButton::OnLButtonUp(UINT /*nFlags*/, CPoint/* point*/) +{ + int iCtrlID; + iCtrlID=GetDlgCtrlID(); + switch (iCtrlID) + { + case IDC_BUTTON_SO7_MOVE_X_LEFT: + case IDC_BUTTON_SO7_MOVE_X_RIGHT: + case IDC_BUTTON_SO7_MOVE_Y_FRONT: + case IDC_BUTTON_SO7_MOVE_Y_BACK: + case IDC_BUTTON_SO7_MOVE_Z_UP: + case IDC_BUTTON_SO7_MOVE_Z_DOWN: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_MOVE_XYZ(); + break; + } + case IDC_BUTTON_SO7_MOVE_ZOOM_IN: + case IDC_BUTTON_SO7_MOVE_ZOOM_OUT: + case IDC_BUTTON_MOVEV_OUT: + case IDC_BUTTON_MOVEV_IN: + case IDC_BTN_CONFIGURE_MOVEVOUT: + case IDC_BTN_CONFIGURE_MOVEVIN: + { + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_V(); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_X_LEFT: + case IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_DECEL_STOPX(); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Y_BACK: + case IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_DECEL_STOPY(); + break; + } + case IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN: + case IDC_BUTTON_ANIMATICS_MOVE_Z_UP: + { + pSmartMotor_Proto->_send_cmd_SMARTMOTOR_DECEL_STOPZ(); + break; + } + default: + break; + + } +} + +void CProcessButton::OnLButtonDblClk(UINT nFlags, CPoint point) +{ + OnLButtonUp(nFlags, point); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.h new file mode 100644 index 0000000..eb1b911 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/ProcessButton.h @@ -0,0 +1,23 @@ + +#pragma once + + +// CProcessButton + +class CProcessButton : public CButton +{ + DECLARE_DYNAMIC(CProcessButton) + +public: + CProcessButton(); + virtual ~CProcessButton(); + afx_msg void OnLButtonDown(UINT nFlags, CPoint point); + afx_msg void OnLButtonUp(UINT nFlags, CPoint point); + +protected: + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); +}; + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.cpp new file mode 100644 index 0000000..4e979cc --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.cpp @@ -0,0 +1,1010 @@ +// SO7_Automatic_Zoom.cpp : ʵļ +// + +#include "stdafx.h" +#include "afxdialogex.h" +#include "resource.h" +#include "ProcessButton.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "..\..\..\SevenOcean\CMMIO_SERIAL.H" +#include "SO7_UtilDlg.h" +#include "SO7_Move_Location.h" +#include "SO7_Automatic_Zoom.h" + +extern CSerial* m_pSO7_Serial; +extern CSO7_Proto* m_pSO7_Proto; +extern CLogger* g_pLoggerDebug; +#define PI 3.1415926535897932384626433 + +#define MAXRETRY 10 +// CSO7_Automatic_Zoom Ի +IMPLEMENT_DYNAMIC(CSO7_Automatic_Zoom, CDialog) + + CSO7_Automatic_Zoom::CSO7_Automatic_Zoom(CWnd* pParent /*=NULL*/) + : CDialog(CSO7_Automatic_Zoom::IDD, pParent) +{ + +} + +CSO7_Automatic_Zoom::~CSO7_Automatic_Zoom() +{ +} + +void CSO7_Automatic_Zoom::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + + DDX_Text(pDX, IDC_EDIT_ZOOM_REPE_TIME, m_Zoom_RepeTime); + DDX_Text(pDX, IDC_EDIT_ZOOM_DEADBAND, m_Zoom_Deadband); + DDX_Text(pDX, IDC_EDIT_ZOOM_MOVETO, m_Move_to_V); + DDX_Text(pDX, IDC_EDIT_SETSPEED, m_Set_Speed); + + DDX_Text(pDX, IDC_EDIT_REPETEST_TIMES, m_Zoom_Repe_Times); + DDX_Text(pDX, IDC_EDIT_REPETEST_PAUSE, m_Zoom_Pause_Time); + + DDX_Control(pDX, IDC_COMBO_REPETEST_FROM, m_cmbRepeTestFrom); + DDX_Control(pDX, IDC_COMBO_REPETEST_TO, m_cmbRepeTestTo); + DDX_Control(pDX, IDC_EDIT_ZOOM_LOG, m_edit_Log); + DDX_Control(pDX, IDC_BUTTON_MOVEV_IN, m_Button_MoveV_Zoom_In); + DDX_Control(pDX, IDC_BUTTON_MOVEV_OUT, m_Button_MoveV_Zoom_Out); + +} + + +BEGIN_MESSAGE_MAP(CSO7_Automatic_Zoom, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDCANCEL, &CSO7_Automatic_Zoom::OnBnClickedCancel) + ON_BN_CLICKED(IDC_BUTTON_SEND_DATA, &CSO7_Automatic_Zoom::OnBnClickedButtonSendData) + ON_BN_CLICKED(IDC_BUTTON_CLEARMESSAGE, &CSO7_Automatic_Zoom::OnBnClickedButtonClearmessage) + ON_BN_CLICKED(IDC_BUTTON_HOME_V, &CSO7_Automatic_Zoom::OnBnClickedButtonHomeV) + ON_BN_CLICKED(IDC_RADIO_MOVETEST, &CSO7_Automatic_Zoom::OnBnClickedRadioMovetest) + ON_BN_CLICKED(IDC_RADIO_SENDCMD, &CSO7_Automatic_Zoom::OnBnClickedRadioSendcmd) + ON_BN_CLICKED(IDC_BUTTON_ZOOM_MOVETO, &CSO7_Automatic_Zoom::OnBnClickedButtonZoomMoveto) + ON_EN_KILLFOCUS(IDC_EDIT_ZOOM_MOVETO, &CSO7_Automatic_Zoom::OnEnKillfocusEditZoomMoveto) + ON_EN_KILLFOCUS(IDC_EDIT_ZOOM_DEADBAND, &CSO7_Automatic_Zoom::OnEnKillfocusEditZoomDeadband) + ON_BN_CLICKED(IDC_BUTTON_ZOOM_SETZERO, &CSO7_Automatic_Zoom::OnBnClickedButtonZoomSetzero) + ON_BN_CLICKED(IDC_RADIO_ZOOM_GEAR1, &CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear1) + ON_BN_CLICKED(IDC_RADIO_ZOOM_GEAR2, &CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear2) + ON_BN_CLICKED(IDC_RADIO_ZOOM_GEAR3, &CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear3) + ON_BN_CLICKED(IDC_RADIO_ZOOM_GEAR4, &CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear4) + ON_BN_CLICKED(IDC_BUTTON_ZOOM_SETSPEED, &CSO7_Automatic_Zoom::OnBnClickedButtonZoomSetspeed) + ON_EN_KILLFOCUS(IDC_EDIT_ZOOM_REPE_TIME, &CSO7_Automatic_Zoom::OnEnKillfocusEditZoomRepeTime) + ON_BN_CLICKED(IDC_BUTTON_SAVELOG, &CSO7_Automatic_Zoom::OnBnClickedButtonSavelog) + ON_BN_CLICKED(IDC_BUTTON_CALIBRATE_ENCODER, &CSO7_Automatic_Zoom::OnBnClickedButtonCalibrateEncoder) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_PAUSE, &CSO7_Automatic_Zoom::OnEnKillfocusEditRepetestPause) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_TIMES, &CSO7_Automatic_Zoom::OnEnKillfocusEditRepetestTimes) + ON_BN_CLICKED(IDC_BUTTON_REPETEST_BEGIN, &CSO7_Automatic_Zoom::OnBnClickedButtonRepetestBegin) + ON_EN_SETFOCUS(IDC_EDIT_ZOOM_ANGLE, &CSO7_Automatic_Zoom::OnEnSetfocusEditZoomAngle) + ON_BN_CLICKED(IDC_CHECK_AUTOZOOM_CONTINUE_READ, &CSO7_Automatic_Zoom::OnBnClickedCheckAutozoomContinueRead) +END_MESSAGE_MAP() + + +// CSO7_Automatic_Zoom Ϣ + + +//=================================================== +BOOL CSO7_Automatic_Zoom::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + ((CButton *)GetDlgItem(IDC_RADIO_ZOOM_GEAR2))->SetCheck(true); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit=-160; + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit=60; + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree=-160; + m_pSO7_Proto->g_machine.s_status._bZMHoming=false; + m_bZMHoming=FALSE; + //=============================================================================== + if (!g_pLoggerDebug) + { + g_pLoggerDebug = new CLogger(_T("\\UtilityDebug.Log")); + } + m_cmbRepeTestFrom.ResetContent(); + m_cmbRepeTestTo.ResetContent(); + CString csTmp; + double dGrade=(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit)/11; + for (INT i=0;i<12;i++) + { + m_dZoomMultiple[i]=dGrade*i+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit; + csTmp.Format(_T("Multiple:%d"),i); + m_cmbRepeTestFrom.InsertString(i,csTmp); + m_cmbRepeTestTo.InsertString(i,csTmp); + } + m_cmbRepeTestFrom.SetCurSel(3); + m_cmbRepeTestTo.SetCurSel(6); + m_Zoom_Pause_Time=_T("1"); + m_Zoom_Repe_Times=_T("10"); + m_iZoom_Pause_Time=1; + m_iZoom_Repe_Times=10; + bBeginFlag=FALSE; + //=============================================================================== + CString Param,Params; + // ״̬ + m_StatusBar.Create(WS_CHILD|WS_VISIBLE|SBS_SIZEGRIP, CRect(0, 0, 0, 0), this, 101); + m_StatusBar.SetBkColor(RGB(0xff, 0xff, 0x00));//0xa6, 0xca, 0xf0 + int arWidth[] = {330,450, -1 }; + m_StatusBar.SetParts(3, arWidth); + ((CButton *)GetDlgItem(IDC_RADIO_SENDCMD))->SetCheck(true); + if (m_pSO7_Serial) + { + m_pSO7_Serial->GetPortData(&Port,&Baud,&Parity,&Bits,&StopBits,&HandShake); + Params.Format( TEXT("[COM%d]"), Port ); + Param.Format( TEXT(" Baud=%d"), Baud ); + Params += Param; + Param.Format( TEXT(" Parity=%c"), Parity ); + Params += Param; + Param.Format( TEXT(" Data=%d"), Bits ); + Params += Param; + Param.Format( TEXT(" Stop=%d"), StopBits ); + Params += Param; + m_StatusBar.SetText(Params, 0, 0); + + if(m_pSO7_Serial->Open()) + { + m_StatusBar.SetText(_T("ɹ򿪴ڡ"), 1, 0); + + ((CButton*)GetDlgItem(IDC_RADIO_MOVETEST))->SetCheck(TRUE); + ((CButton*)GetDlgItem(IDC_RADIO_SENDCMD))->SetCheck(FALSE); + + GetDlgItem(IDC_BUTTON_MOVEV_IN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVEV_OUT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_HOME_V) ->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR1)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR2)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR3)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR4)->EnableWindow(false); + GetDlgItem(IDC_CHECK_ZOOM_DEADBAND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_DEADBAND)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_EDIT_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETZERO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_LOG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVELOG)->EnableWindow(false); + GetDlgItem(IDC_CHECK_CONTINUEMOVE)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_REPE_TIME)->EnableWindow(false); + GetDlgItem(IDC_CHECK_AUTOZOOM_CONTINUE_READ)->EnableWindow(false); + + GetDlgItem(IDC_EDIT_DATASEND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEND_DATA)->EnableWindow(false); + + GetDlgItem(IDC_EDIT_ZOOM_LOG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVELOG)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_REPE_TIME)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_REPETEST_BEGIN)->EnableWindow(true); + m_pSO7_Proto->Load_So7_Config(); + GetDlgItem(IDC_EDIT_TESTZOOM_PRODUCTID)->SetWindowText(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._ProductID); + ((CButton *)GetDlgItem(IDC_CHECK_ZOOM_DEADBAND))->SetCheck(TRUE); + double dGrade=(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._EndDegree)/11; + for (INT i=0;i<12;i++) + { + m_dZoomMultiple[i]=dGrade*i+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._EndDegree; + } + + SetTimer(1,200,NULL); + } + else + { + + m_StatusBar.SetText(_T("ڱռá"), 1, 0); + GetDlgItem(IDC_BUTTON_MOVEV_IN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVEV_OUT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_HOME_V) ->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_ANGLE)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR1)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR2)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR3)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR4)->EnableWindow(false); + GetDlgItem(IDC_CHECK_ZOOM_DEADBAND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_DEADBAND)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_EDIT_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETZERO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_LOG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVELOG)->EnableWindow(false); + GetDlgItem(IDC_CHECK_CONTINUEMOVE)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_REPE_TIME)->EnableWindow(false); + GetDlgItem(IDC_CHECK_AUTOZOOM_CONTINUE_READ)->EnableWindow(false); + + GetDlgItem(IDC_EDIT_DATASEND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEND_DATA)->EnableWindow(false); + } + + } + UpdateData(FALSE); + return TRUE; // return TRUE unless you set the focus to a control +} + + +//============================================================ +void CSO7_Automatic_Zoom::OnEnKillfocusEditRepetestPause() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Zoom_Pause_Time); + + m_iZoom_Pause_Time = atoi(cTemp); +} +//==================================================== +void CSO7_Automatic_Zoom::OnEnKillfocusEditZoomRepeTime() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Zoom_RepeTime); + + m_iRepeTime = atoi(cTemp); +} +//============================================================ +void CSO7_Automatic_Zoom::OnEnKillfocusEditRepetestTimes() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Zoom_Repe_Times); + + m_iZoom_Repe_Times = atoi(cTemp); +} + +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedButtonRepetestBegin() +{ + if (bBeginFlag) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_V(); + bBeginFlag=false; + bRepeTestDone=true; + ((CButton*)GetDlgItem(IDC_BUTTON_REPETEST_BEGIN))->SetWindowTextW(_T("Begin")); + } + else + { + KillTimer(1); + bBeginFlag=true; + iRepeTestCnt=0; + iRetryCnt=0; + iRetryCntFrom=0; + iRetryCntTo=0; + iFrom=m_cmbRepeTestFrom.GetCurSel(); + iTo=m_cmbRepeTestTo.GetCurSel(); + m_dRepeTest_Ang=m_dZoomMultiple[iTo]-m_dZoomMultiple[iFrom]; + m_OutMessage=_T(""); + GetDlgItem(IDC_EDIT_ZOOM_LOG)->SetWindowText(m_OutMessage); + m_pSO7_Proto->g_machine.zm._d_cur_pos_=GetZoomCurPos(); + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iFrom]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + bRepeTestDone=false; + ((CButton*)GetDlgItem(IDC_BUTTON_REPETEST_BEGIN))->SetWindowTextW(_T("Stop")); + SetTimer(1,200,NULL); + SetTimer(2,100,NULL); + + } +} +//==================================================== +BOOL CSO7_Automatic_Zoom::RepeTest() +{ + KillTimer(1); + UpdateData(TRUE); + CString csTemp; + m_pSO7_Proto->g_machine.zm._d_cur_pos_=GetZoomCurPos(); + m_dRepeTest_Record_Dis=m_pSO7_Proto->g_machine.zm._d_cur_pos_; + if(iRepeTestCntGetCheck()) + { + + if(((m_dZoomMultiple[iFrom]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)>m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband || (m_dZoomMultiple[iFrom]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)<-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband )&& iRetryCntFrom<=MAXRETRY) + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iFrom]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + iRetryCntFrom++; + bRepeTestDone=false; + return false; + } + else + { + iRetryCntFrom=0; + } + } + if(iRepeTestCnt==0) + { + m_dRepeTest_Record_Dis=m_pSO7_Proto->g_machine.zm._d_cur_pos_; + } + else + { + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis-m_dRepeTest_Record_Dis); + m_OutMessage+=csTemp; + } + + RecordFromDis=m_dRepeTest_Record_Dis; + if (((CButton *)GetDlgItem(IDC_CHECK_ZOOM_DEADBAND))->GetCheck()) + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iTo]-RecordFromDis-3)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + } + else + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iTo]-RecordFromDis)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale);// + } + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + OutputWithScroll(m_OutMessage,m_edit_Log); + csTemp.Format(_T("[%2d] X: From: % .4f "),iRepeTestCnt/2+1,m_dRepeTest_Record_Dis); + m_OutMessage+=csTemp; + + } + else if(iRepeTestCnt%2 == 1) + { + if (((CButton *)GetDlgItem(IDC_CHECK_ZOOM_DEADBAND))->GetCheck()) + { + + if(((m_dZoomMultiple[iTo]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)>m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband || (m_dZoomMultiple[iTo]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)<-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband )&& iRetryCntTo<=MAXRETRY) + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iTo]-m_pSO7_Proto->g_machine.zm._d_cur_pos_)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + iRetryCntTo++; + bRepeTestDone=false; + return false; + } + else + { + iRetryCntTo=0; + } + } + + RecordToDis=m_dRepeTest_Record_Dis; + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis); + m_OutMessage+=csTemp; + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis-RecordFromDis); + m_OutMessage+=csTemp; + if (((CButton *)GetDlgItem(IDC_CHECK_ZOOM_DEADBAND))->GetCheck()) + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iFrom]-RecordToDis-2)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + } + else + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dZoomMultiple[iFrom]-RecordToDis)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + } + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + } + + bRepeTestDone=false; + iRepeTestCnt++; + } + + } + else + { + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis-m_dRepeTest_Record_Dis); + m_OutMessage+=csTemp; + OutputWithScroll(m_OutMessage,m_edit_Log); + bBeginFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_REPETEST_BEGIN))->SetWindowTextW(_T("Begin")); + } + SetTimer(1,200,NULL); + return TRUE; +} + +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedCancel() +{ + delete g_pLoggerDebug; + g_pLoggerDebug=NULL; + delete m_pSO7_Serial; + m_pSO7_Serial=NULL; + KillTimer(1); + KillTimer(2); + KillTimer(3); + CDialog::OnCancel(); +} + + +//=================================================== +void CSO7_Automatic_Zoom::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + + switch(nIDEvent) + { + case 1: + { + CString csTmpData,csTmp,csMsg(_T("")); + double dZoomAng(0); + dZoomAng=ReadZoomAngle(); + m_pSO7_Proto->g_machine.zm._d_cur_pos_=dZoomAng; + csTmpData.Format(_T("%.4f"),m_pSO7_Proto->g_machine.zm._d_cur_pos_-m_pSO7_Proto->g_machine.zm._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_ZOOM_ANGLE)->SetWindowTextW(csTmpData); + m_StatusBar.SetText(_T("Normal!"), 2, 0); + } + break; + case 2: + { + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE(); + if (m_pSO7_Proto->g_machine.InterruptFlag[0] == CT_STOPXYZ && m_pSO7_Proto->g_machine.InterruptFlag[1] == 6) + { + if (!bRepeTestDone) + { + if (bBeginFlag) + { + SetTimer(3,m_iZoom_Pause_Time,NULL); + } + else + { + bRepeTestDone=true; + m_OutMessage=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + } + m_pSO7_Proto->g_machine.InterruptFlag[0]=0; + } + } + } + break; + } + case 3: + { + if (bBeginFlag) + { + bRepeTestDone=true; + RepeTest(); + } + else + { + bRepeTestDone=true; + m_OutMessage=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_REPETEST_BEGIN))->SetWindowTextW(_T("Begin")); + } + KillTimer(3); + break; + } + + } + + CDialog::OnTimer(nIDEvent); + +} + + +//===================================================================================== +//Print message on edit control +void CSO7_Automatic_Zoom::OutputWithScroll(const CString &strText,CEdit &edtOutput) +{ + + int iCount = strText.GetLength(); + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strText); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); +} +//===================================================================================== +void CSO7_Automatic_Zoom::OnBnClickedButtonSavelog() +{ USES_CONVERSION; + +CString FileName; +CString PathName; +FILE* m_pOutFile; + +FileName=_T("TestZoom.txt"); +CString szFilter=_T("TXT Files(*.txt)|*.txt|ALL Files(*.*)|*.*||"); +CFileDialog fdlg(FALSE,_T("INI"),FileName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + +if( fdlg.DoModal()==IDOK) +{ + const char* outBuff=NULL; + PathName=fdlg.GetPathName(); + _wfopen_s(&m_pOutFile, PathName, _T("wt")); + if (!m_pOutFile) + { + MessageBox( _T("File name Error."), _T("Message"), MB_OK); + }; + outBuff=T2A(m_OutMessage); + fprintf(m_pOutFile,"%s", outBuff); + fclose(m_pOutFile); +} +delete fdlg; +} +//=================================================== +double CSO7_Automatic_Zoom::ReadZoomAngle() +{ + double dZoomAngle(-1); + char sendData[6]={'A','D',':','0',13,10}; + DWORD iWriteByte=m_pSO7_Serial->Send(sendData,6); + + INT iRetrys(0); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(10); + } + if (m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(50); + + USES_CONVERSION; + char *cRecvData= NULL; + char *token = NULL; + char cTemp[20]={0}; + cRecvData=T2A(m_pSO7_Serial->m_csRecv); + char seps[] = "$AD:"; + + token = strtok(cRecvData,seps); + if (token) + { + memcpy(cTemp,token,8); + dZoomAngle=atof(cTemp); + dZoomAngle=dZoomAngle*180/PI; + if (dZoomAngle>m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree) + dZoomAngle=dZoomAngle-360; + } + else + { + dZoomAngle=-1; + }; + token=NULL; + cRecvData=NULL; + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + + return dZoomAngle; + + } + else + { + return -2; + } +} +//=================================================== +BOOL CSO7_Automatic_Zoom::CalibrateEncoder() +{ + char sendDataI[12]={'U','P',':','1','1','1','1','1','1','1',13,10}; + char sendDataII[6]={'S','C',':','1',13,10}; + char sendDataIII[6]={'R','F',':','1',13,10}; + CString csRightRecv; + csRightRecv.Format(_T("@OK\r\n")); + INT iRetrys(0); + DWORD iWriteByte(0); + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + + //Phase I + iWriteByte=m_pSO7_Serial->Send(sendDataI,12); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==12) + { + iRetrys++; + Sleep(50); + } + + if (m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + //Phase II + + iWriteByte=m_pSO7_Serial->Send(sendDataII,6); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(50); + } + if(m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + //Phase III + + iWriteByte=m_pSO7_Serial->Send(sendDataIII,6); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(50); + } + if(m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + return TRUE; + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + } + else + { + return FALSE; + } + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + } + else + { + return FALSE; + } + + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + + } + else + { + return FALSE; + } + +} + +//=============================================== +double CSO7_Automatic_Zoom::GetZoomCurPos() +{ + double dZoomPos(0),dZoomAng(0),dZoomPreAng(0); + INT iCnt2(0); + INT iRetryCount(0); + dZoomAng=ReadZoomAngle(); + + while(iCnt2<3 && iRetryCount<20) + { + Sleep(60); + dZoomPreAng=dZoomAng; + dZoomAng=ReadZoomAngle(); + INT iRetrys(0); + while ((dZoomAng==-1 || dZoomAng==-2 || dZoomAng==0 )&&iRetrys<2) + { + iRetrys++; + Sleep(60); + dZoomAng=ReadZoomAngle(); + } + if(dZoomAng!=-1 && dZoomAng!=-2 && dZoomAng!=0) + { + if ((dZoomAng-dZoomPreAng)<1 && (dZoomPreAng-dZoomAng)<1) + { + dZoomPos+=dZoomAng; + iCnt2++; + } + } + iRetryCount++; + + } + if (iCnt2==0) + { + dZoomPos=-2; + } + else + { + dZoomPos=dZoomPos/(iCnt2); + } + return dZoomPos; +} + + +void CSO7_Automatic_Zoom::OnEnSetfocusEditZoomAngle() +{ + m_pSO7_Proto->g_machine.zm._d_cur_pos_=GetZoomCurPos(); +} + + +//*********************************************************************************// + +//=================================================== +//ݲ +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedButtonSendData() +{ + UpdateData(TRUE); + CString csSendData(""); + GetDlgItem(IDC_EDIT_DATASEND)->GetWindowText(csSendData); + m_pSO7_Serial->m_csRecv=_T(""); + USES_CONVERSION; + //ϻسз + CString csTemp; + csTemp.Format(_T("\r\n")); + csSendData+=csTemp; + + const char* cSendData; + cSendData=T2A(csSendData); + DWORD iSendDataLength=csSendData.GetLength(); + DWORD iWriteByte=m_pSO7_Serial->Send(cSendData,iSendDataLength); + + ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->InsertString(-1,CString(_T("[Send]: "))+cSendData);// + + csSendData.Format(_T("Send(%dByte)"),iWriteByte); + m_StatusBar.SetText(csSendData, 1, 0); + // + INT iRetrys(0); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20) + { + iRetrys++; + Sleep(100); + } + if (m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + { + m_pSO7_Serial->m_iRecvState=FALSE; + INT iRetrys2(0); + while(!m_pSO7_Serial->m_iRecvState && iRetrys2<60) + { + iRetrys2++; + Sleep(100); + } + ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->InsertString(-1,CString(_T("[Recv]: "))+m_pSO7_Serial->m_csRecv); + m_pSO7_Serial->m_csRecv=_T(""); + csSendData.Format(_T("Recv(%dByte)"),m_pSO7_Serial->m_iRecvByte); + m_StatusBar.SetText(csSendData, 2, 0); + } + else + { + ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->InsertString(-1,CString(_T("[Recv]: "))+m_pSO7_Serial->m_csRecv); + m_pSO7_Serial->m_csRecv=_T(""); + csSendData.Format(_T("Recv(%dByte)"),m_pSO7_Serial->m_iRecvByte); + m_StatusBar.SetText(csSendData, 2, 0); + + } + m_pSO7_Serial->m_iRecvState=FALSE; + } + else + { + m_StatusBar.SetText(_T("Time Out!"), 2, 0); + } + INT iCnt0 = ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->GetCount(); + ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->SetCurSel(iCnt0-1); +} + + +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedButtonClearmessage() +{ + + ((CListBox *)GetDlgItem(IDC_LIST_SHOWMESSAGE))->ResetContent(); +} + +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedButtonHomeV() +{ + double dTo=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree-m_pSO7_Proto->g_machine.zm._d_cur_pos_; + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast(dTo*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + m_pSO7_Proto->g_machine.s_status._bZMHoming=true; +} +void CSO7_Automatic_Zoom::OnBnClickedCheckAutozoomContinueRead() +{ + //if (((CButton *)GetDlgItem(IDC_CHECK_AUTOZOOM_CONTINUE_READ))->GetCheck()) + //{ + // SetTimer(1,60,NULL); + //} + //else + //{ + // KillTimer(1); + //} + +} +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedRadioMovetest() +{ + SetTimer(1,500,NULL); + GetDlgItem(IDC_BUTTON_MOVEV_IN)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_MOVEV_OUT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_HOME_V) ->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_ANGLE)->EnableWindow(true); + GetDlgItem(IDC_RADIO_ZOOM_GEAR1)->EnableWindow(true); + GetDlgItem(IDC_RADIO_ZOOM_GEAR2)->EnableWindow(true); + GetDlgItem(IDC_RADIO_ZOOM_GEAR3)->EnableWindow(true); + GetDlgItem(IDC_RADIO_ZOOM_GEAR4)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ZOOM_MOVETO)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_DEADBAND)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_MOVETO)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ZOOM_SETSPEED)->EnableWindow(true); + GetDlgItem(IDC_EDIT_SETSPEED)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_ZOOM_SETZERO)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_LOG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVELOG)->EnableWindow(true); + GetDlgItem(IDC_CHECK_CONTINUEMOVE)->EnableWindow(true); + GetDlgItem(IDC_EDIT_ZOOM_REPE_TIME)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_REPETEST_BEGIN)->EnableWindow(true); + GetDlgItem(IDC_CHECK_AUTOZOOM_CONTINUE_READ)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_CALIBRATE_ENCODER)->EnableWindow(false); + GetDlgItem(IDC_EDIT_DATASEND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SEND_DATA)->EnableWindow(false); + +} + +//=================================================== +void CSO7_Automatic_Zoom::OnBnClickedRadioSendcmd() +{ + KillTimer(1); + KillTimer(2); + KillTimer(3); + + GetDlgItem(IDC_BUTTON_MOVEV_IN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MOVEV_OUT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_HOME_V) ->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_ANGLE)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR1)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR2)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR3)->EnableWindow(false); + GetDlgItem(IDC_RADIO_ZOOM_GEAR4)->EnableWindow(false); + GetDlgItem(IDC_CHECK_ZOOM_DEADBAND)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_MOVETO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_EDIT_SETSPEED)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_ZOOM_SETZERO)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_LOG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SAVELOG)->EnableWindow(false); + GetDlgItem(IDC_CHECK_CONTINUEMOVE)->EnableWindow(false); + GetDlgItem(IDC_EDIT_ZOOM_REPE_TIME)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_REPETEST_BEGIN)->EnableWindow(false); + GetDlgItem(IDC_CHECK_AUTOZOOM_CONTINUE_READ)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_CALIBRATE_ENCODER)->EnableWindow(true); + GetDlgItem(IDC_EDIT_DATASEND)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SEND_DATA)->EnableWindow(true); + +} + + +//============================================================= +void CSO7_Automatic_Zoom::OnBnClickedButtonCalibrateEncoder() +{ + // TODO: Add your control notification handler code here + if(CalibrateEncoder()) + { + AfxMessageBox(_T("У׼ɹ"),MB_OK|MB_ICONINFORMATION); + } + else + { + AfxMessageBox(_T("У׼ʧܣ"),MB_OK|MB_ICONEXCLAMATION); + } +} +//==================================================== +void CSO7_Automatic_Zoom::OnEnKillfocusEditZoomMoveto() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Move_to_V); + + m_dMove_to_V_Dis = atof(cTemp); +} +//==================================================== +void CSO7_Automatic_Zoom::OnEnKillfocusEditZoomDeadband() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Zoom_Deadband); + + m_dZoom_Deadband = atof(cTemp); +} +//==================================================== +void CSO7_Automatic_Zoom::OnBnClickedButtonZoomMoveto() +{ + iCnt=1; + //ABSOLUATE + //m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dMove_to_V_Dis-m_pSO7_Proto->g_machine.zm._d_cur_pos_)*m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + //REAL + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast((m_dMove_to_V_Dis)*1); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + + +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedButtonZoomSetzero() +{ + m_pSO7_Proto->g_machine.zm._dSet_Zero_Pos=m_pSO7_Proto->g_machine.zm._d_cur_pos_; + +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear1() +{ + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=5; +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear2() +{ + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=1; +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear3() +{ + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=2; +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedRadioZoomGear4() +{ + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=3; +} +//============================================================ +void CSO7_Automatic_Zoom::OnBnClickedButtonZoomSetspeed() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTemp=T2A(m_Set_Speed); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=static_cast(atoi(cTemp)); + char cSpeedGear(0); + switch(m_pSO7_Proto->g_machine.zm._Move_Speed_Gear) + { + case 3: + { + cSpeedGear=3; + + break; + } + case 2: + { + cSpeedGear=2; + break; + } + case 1: + { + cSpeedGear=1; + break; + } + case 5: + { + cSpeedGear=0; + break; + } + } + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(cSpeedGear); +} +//*********************************************************************************// \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.h new file mode 100644 index 0000000..487c849 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Automatic_Zoom.h @@ -0,0 +1,86 @@ +#pragma once + +// CSO7_Automatic_Zoom Ի + +class CSO7_Automatic_Zoom : public CDialog +{ + DECLARE_DYNAMIC(CSO7_Automatic_Zoom) + +public: + CSO7_Automatic_Zoom(CWnd* pParent = NULL); // ׼캯 + virtual ~CSO7_Automatic_Zoom(); + +// Ի + enum { IDD = IDD_SO7_UTIL_AUTO_ZOOM }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + CStatusBarCtrl m_StatusBar; + CEdit m_edit_Log; + int Port; + int Baud; + char Parity; + int Bits; + int StopBits; + int HandShake; + INT iCnt; + INT iRepeTestCnt; + + CProcessButton m_Button_MoveV_Zoom_In; + CProcessButton m_Button_MoveV_Zoom_Out; + CComboBox m_cmbRepeTestFrom,m_cmbRepeTestTo; + CString m_Move_to_V; + CString m_Set_Speed; + CString m_Zoom_Deadband; + CString m_Zoom_RepeTime; + CString m_OutMessage; + + CString m_Zoom_Pause_Time; + CString m_Zoom_Repe_Times; + int m_iZoom_Pause_Time; + int m_iZoom_Repe_Times; + BOOL bBeginFlag; + BOOL bRepeTestDone; + double m_dMove_to_V_Dis; + double m_dZoom_Deadband; + double m_dRepeTest_Ang; + double m_dRepeTest_Record_Dis; + double RecordFromDis,RecordToDis; + double m_dZoomMultiple[12]; + int m_iRepeTime; + INT iRetryCnt,iRetryCntTo,iRetryCntFrom; + INT iFrom,iTo; + BOOL m_bZMHoming; + double ReadZoomAngle(); + BOOL CalibrateEncoder(); + double GetZoomCurPos(); + BOOL RepeTest(); + void OutputWithScroll(const CString &strText,CEdit &edtOutput); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedButtonSendData(); + afx_msg void OnBnClickedButtonClearmessage(); + afx_msg void OnBnClickedButtonHomeV(); + afx_msg void OnBnClickedRadioMovetest(); + afx_msg void OnBnClickedRadioSendcmd(); + afx_msg void OnBnClickedButtonZoomMoveto(); + afx_msg void OnEnKillfocusEditZoomMoveto(); + afx_msg void OnEnKillfocusEditZoomDeadband(); + afx_msg void OnBnClickedButtonZoomSetzero(); + afx_msg void OnBnClickedRadioZoomGear1(); + afx_msg void OnBnClickedRadioZoomGear2(); + afx_msg void OnBnClickedRadioZoomGear3(); + afx_msg void OnBnClickedRadioZoomGear4(); + afx_msg void OnBnClickedButtonZoomSetspeed(); + afx_msg void OnEnKillfocusEditZoomRepeTime(); + afx_msg void OnBnClickedButtonSavelog(); + afx_msg void OnBnClickedButtonCalibrateEncoder(); + afx_msg void OnEnKillfocusEditRepetestPause(); + afx_msg void OnEnKillfocusEditRepetestTimes(); + afx_msg void OnBnClickedButtonRepetestBegin(); + afx_msg void OnEnSetfocusEditZoomAngle(); + afx_msg void OnBnClickedCheckAutozoomContinueRead(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.cpp new file mode 100644 index 0000000..e65992b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.cpp @@ -0,0 +1,2256 @@ +// SO7_Move_Location.cpp : ʵļ +// +#include "stdafx.h" +#include "afxdialogex.h" +#include "resource.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "..\..\..\SevenOcean\CMMIO_SERIAL.H" +#include "ProcessButton.h" +#include "SO7_UtilDlg.h" +#include "SO7_VolComp.h" +#include "SO7_Move_Location.h" + +#define RETRYNUM 3 +// CSO7_Move_Location Ի +extern CSO7_Proto* m_pSO7_Proto; +//For volcomp test +extern CSO7_VolComp* g_pVolComp; +//===================================================== +//It's for repeatability test.We can judge the motion is "from" or "to" by it; +int iCnt(0); +//It's for repeatability test.When it is true,test has begun;and When it is false,test has stopped; +bool bFlag(false); + +//===================================================== + +IMPLEMENT_DYNAMIC(CSO7_Move_Location, CDialog) + + CSO7_Move_Location::CSO7_Move_Location(CWnd* pParent /*=NULL*/) + : CDialog(CSO7_Move_Location::IDD, pParent) +{ + +} + +CSO7_Move_Location::~CSO7_Move_Location() +{ +} + +void CSO7_Move_Location::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_X, m_Move_to_X); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_Y, m_Move_to_Y); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_Z, m_Move_to_Z); + DDX_Text(pDX, IDC_EDIT_MOVE_TO_ZM, m_Move_to_ZM); + DDX_Text(pDX, IDC_EDIT_REPETEST_DIS, m_RepeTest_Dis); + DDX_Text(pDX, IDC_EDIT_REPETEST_TIMES, m_RepeTest_Times); + DDX_Text(pDX, IDC_EDIT_REPETEST_INTERVAL, m_RepeTest_Interval); + DDX_Text(pDX, IDC_EDIT_REPETEST_ERRORRANGE, m_RepeTest_ErrRange); + + DDX_Control(pDX, IDC_EDIT_REPRETEST, m_edit_RepeTest); + +} + + +BEGIN_MESSAGE_MAP(CSO7_Move_Location, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDCANCEL, &CSO7_Move_Location::OnBnClickedCancel) + ON_BN_CLICKED(ID_OK_START, &CSO7_Move_Location::OnBnClickedOkStart) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO_ZOOM, &CSO7_Move_Location::OnBnClickedButtonMoveToZoom) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO_XYZ_LASER, &CSO7_Move_Location::OnBnClickedButtonMoveToXyzLaser) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO_XYZ_JM, &CSO7_Move_Location::OnBnClickedButtonMoveToXyzJm) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO_XYZV, &CSO7_Move_Location::OnBnClickedButtonMoveToXyzv) + ON_BN_CLICKED(IDC_BUTTON_ZERO_SET, &CSO7_Move_Location::OnBnClickedButtonZeroSet) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_DIS, &CSO7_Move_Location::OnEnKillfocusEditRepetestDis) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_TIMES, &CSO7_Move_Location::OnEnKillfocusEditRepetestTimes) + ON_BN_CLICKED(IDC_BUTTON_BEGIN_REPE_TEST, &CSO7_Move_Location::OnBnClickedButtonBeginRepeTest) + ON_BN_CLICKED(IDC_BUTTON_SAVE_REPETEST, &CSO7_Move_Location::OnBnClickedButtonSaveRepetest) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_INTERVAL, &CSO7_Move_Location::OnEnKillfocusEditRepetestInterval) + ON_EN_KILLFOCUS(IDC_EDIT_REPETEST_ERRORRANGE, &CSO7_Move_Location::OnEnKillfocusEditRepetestRrorrange) + ON_BN_CLICKED(IDC_CHECK_REPETEST_ABSOLUTE, &CSO7_Move_Location::OnBnClickedCheckRepetestAbsolute) + ON_BN_CLICKED(IDC_RADIO_SCALE, &CSO7_Move_Location::OnBnClickedRadioScale) + ON_BN_CLICKED(IDC_RADIO_MM, &CSO7_Move_Location::OnBnClickedRadioMm) +END_MESSAGE_MAP() + + +// CSO7_Move_Location Ϣ +BOOL CSO7_Move_Location::OnInitDialog() +{ + //VOLCOMP + if(g_pVolComp->m_bEnVolComp) + ((CButton *)GetDlgItem(IDC_CHECK_REPETEST_VOLCOMP))->EnableWindow(TRUE); + else + ((CButton *)GetDlgItem(IDC_CHECK_REPETEST_VOLCOMP))->EnableWindow(FALSE); + + ((CButton *)GetDlgItem(IDC_RADIO_INCH))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MM))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_SCALE))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_FAST))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_SLOW))->SetCheck(0); + ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->SetCheck(1); + ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->SetCheck(0); + GetDlgItem(IDC_EDIT_REPETEST_ERRORRANGE)->EnableWindow(false); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + {// scale + m_Move_to_X=_T("0"); + m_Move_to_Y=_T("0"); + m_Move_to_Z=_T("0"); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + {// mm + m_Move_to_X=_T("0.0"); + m_Move_to_Y=_T("0.0"); + m_Move_to_Z=_T("0.0"); + } + else + {// inches + m_Move_to_X=_T("0.0"); + m_Move_to_Y=_T("0.0"); + m_Move_to_Z=_T("0.0"); + }; + + m_move_to_x=0; + m_move_to_y=0; + m_move_to_z=0; + m_move_to_zm=0; + m_dRepeTest_Record_Dis[0]=0; + m_dRepeTest_Record_Dis[1]=0; + m_dRepeTest_Record_Dis[2]=0; + m_dRepeTest_Record_Dis[3]=0; + + m_lRepeTest_Record_Dis[0]=0; + m_lRepeTest_Record_Dis[1]=0; + m_lRepeTest_Record_Dis[2]=0; + m_lRepeTest_Record_Dis[3]=0; + m_lRepeTest_Dis=0; + m_iRepeTest_Interval=0; + m_dRepeTest_ErrRange=0; + m_bRepeTestAxisX=FALSE; + m_bRepeTestAxisY=FALSE; + m_bRepeTestAxisZ=FALSE; + m_RepeTest_Dis=_T("0"); + m_RepeTest_Times=_T("0"); + m_RepeTest_Interval=_T("0"); + m_RepeTest_ErrRange=_T("0"); + bRepeTestDone=false; + UpdateData(FALSE); + SetTimer(1,150,0); + SetTimer(2,200,0); + //SetTimer(4,20,NULL); + return TRUE; +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedCancel() +{ + KillTimer(1); + KillTimer(2); + KillTimer(4); + Sleep(20); + + + CDialog::OnCancel(); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonMoveToZoom() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cMove_to_ZM=T2A(m_Move_to_ZM); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit=0; + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit - (m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + else if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit - (m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)*25.4+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit - (m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + m_move_to_zm = atof(cMove_to_ZM)*25.4+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + + else + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + + + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast(m_move_to_zm); + if (((CButton *)GetDlgItem(IDC_CHECK_REVERSE))->GetCheck()) + { + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=-m_pSO7_Proto->g_machine.zm._pos_fixed._long_; + } + m_pSO7_Proto->g_machine.s_status._bZMMoving=true; + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedOkStart() +{ + + UpdateData(TRUE); + USES_CONVERSION; + + const char* cMove_to_X=T2A(m_Move_to_X); + const char* cMove_to_Y=T2A(m_Move_to_Y); + const char* cMove_to_Z=T2A(m_Move_to_Z); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X) - (m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z); + } + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X) - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4 - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y)*25.4 - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z)*25.4 - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4; + m_move_to_y = atof(cMove_to_Y)*25.4; + m_move_to_z = atof(cMove_to_Z)*25.4; + } + else + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_x,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_y,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_z,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + } + if (((CButton *)GetDlgItem(IDC_CHECK_REVERSE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=-m_pSO7_Proto->g_machine.x._pos_fixed._long_; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=-m_pSO7_Proto->g_machine.y._pos_fixed._long_; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=-m_pSO7_Proto->g_machine.z._pos_fixed._long_; + } + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonMoveToXyzLaser() +{ + + UpdateData(TRUE); + USES_CONVERSION; + + const char* cMove_to_X=T2A(m_Move_to_X); + const char* cMove_to_Y=T2A(m_Move_to_Y); + const char* cMove_to_Z=T2A(m_Move_to_Z); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X) - (m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z); + } + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X) - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4 - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y)*25.4 - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z)*25.4 - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4; + m_move_to_y = atof(cMove_to_Y)*25.4; + m_move_to_z = atof(cMove_to_Z)*25.4; + } + else + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_x,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_y,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_z,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + } + if (((CButton *)GetDlgItem(IDC_CHECK_REVERSE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=-m_pSO7_Proto->g_machine.x._pos_fixed._long_; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=-m_pSO7_Proto->g_machine.y._pos_fixed._long_; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=-m_pSO7_Proto->g_machine.z._pos_fixed._long_; + } + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ_LASE); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonMoveToXyzJm() +{ + + UpdateData(TRUE); + USES_CONVERSION; + + const char* cMove_to_X=T2A(m_Move_to_X); + const char* cMove_to_Y=T2A(m_Move_to_Y); + const char* cMove_to_Z=T2A(m_Move_to_Z); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X) - (m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z); + } + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X) - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4 - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y)*25.4 - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z)*25.4 - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4; + m_move_to_y = atof(cMove_to_Y)*25.4; + m_move_to_z = atof(cMove_to_Z)*25.4; + } + else + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + } + + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_x,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_y,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_z,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + } + if (((CButton *)GetDlgItem(IDC_CHECK_REVERSE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=-m_pSO7_Proto->g_machine.x._pos_fixed._long_; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=-m_pSO7_Proto->g_machine.y._pos_fixed._long_; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=-m_pSO7_Proto->g_machine.z._pos_fixed._long_; + } + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ_JM); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonMoveToXyzv() +{ + UpdateData(TRUE); + USES_CONVERSION; + + const char* cMove_to_X=T2A(m_Move_to_X); + const char* cMove_to_Y=T2A(m_Move_to_Y); + const char* cMove_to_Z=T2A(m_Move_to_Z); + const char* cMove_to_ZM=T2A(m_Move_to_ZM); + + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X) - (m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos); + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit -(m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_ = atoi(cMove_to_X); + m_pSO7_Proto->g_machine.y._pos_fixed._long_ = atoi(cMove_to_Y); + m_pSO7_Proto->g_machine.z._pos_fixed._long_ = atoi(cMove_to_Z); + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + } + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X) - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y) - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z) - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit -(m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + + } + else if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4 - (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + m_move_to_y = atof(cMove_to_Y)*25.4 - (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + m_move_to_z = atof(cMove_to_Z)*25.4 - (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + m_move_to_zm = atof(cMove_to_ZM)*25.4+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit - (m_pSO7_Proto->g_machine.zm._scale_pos._long_-m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos); + } + else if (((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck() && ((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + m_move_to_x = atof(cMove_to_X)*25.4; + m_move_to_y = atof(cMove_to_Y)*25.4; + m_move_to_z = atof(cMove_to_Z)*25.4; + m_move_to_zm = atof(cMove_to_ZM)*25.4+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + } + else + { + m_move_to_x = atof(cMove_to_X); + m_move_to_y = atof(cMove_to_Y); + m_move_to_z = atof(cMove_to_Z); + m_move_to_zm = atof(cMove_to_ZM)+m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_working_limit; + } + + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_x,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_y,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_move_to_z,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + } + + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=static_cast(m_move_to_zm*1000); + if (((CButton *)GetDlgItem(IDC_CHECK_REVERSE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=-m_pSO7_Proto->g_machine.x._pos_fixed._long_; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=-m_pSO7_Proto->g_machine.y._pos_fixed._long_; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=-m_pSO7_Proto->g_machine.z._pos_fixed._long_; + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=-m_pSO7_Proto->g_machine.zm._pos_fixed._long_; + } + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV(); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonZeroSet() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_AXIS_XYZ(); + + m_pSO7_Proto->g_machine.x._lSet_Zero_Pos =m_pSO7_Proto->g_machine.x._scale_pos._long_; + m_pSO7_Proto->g_machine.y._lSet_Zero_Pos =m_pSO7_Proto->g_machine.y._scale_pos._long_; + m_pSO7_Proto->g_machine.z._lSet_Zero_Pos =m_pSO7_Proto->g_machine.z._scale_pos._long_; + + m_pSO7_Proto->g_machine.x._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.x._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.y._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.z._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_pSO7_Proto->g_machine.x._dSet_Zero_Pos = m_pSO7_Proto->g_machine.x._d_cur_pos_ ; + m_pSO7_Proto->g_machine.y._dSet_Zero_Pos = m_pSO7_Proto->g_machine.y._d_cur_pos_ ; + m_pSO7_Proto->g_machine.z._dSet_Zero_Pos = m_pSO7_Proto->g_machine.z._d_cur_pos_ ; + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_V_DATA(); + m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos=m_pSO7_Proto->g_machine.zm._scale_pos._long_; +} + + +//===================================================================================== +void CSO7_Move_Location::OnBnClickedRadioScale() +{ + SetDlgItemText(IDC_STATIC_DEADBAND_UNITS,_T("pulse")); +} + +//===================================================================================== +void CSO7_Move_Location::OnBnClickedRadioMm() +{ + SetDlgItemText(IDC_STATIC_DEADBAND_UNITS,_T("um")); +} + +//========================================================================================= +void CSO7_Move_Location::OnEnKillfocusEditRepetestDis() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cRepeTest_Dis=T2A(m_RepeTest_Dis); + + m_dRepeTest_Dis = atof(cRepeTest_Dis); + m_lRepeTest_Dis=static_cast(m_dRepeTest_Dis); +} +//========================================================================================= +void CSO7_Move_Location::OnEnKillfocusEditRepetestTimes() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cRepeTest_Times=T2A(m_RepeTest_Times); + + m_iRepeTest_Times = atoi(cRepeTest_Times); + +} +//========================================================================================= +void CSO7_Move_Location::OnEnKillfocusEditRepetestInterval() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cRepeTest_Interval=T2A(m_RepeTest_Interval); + + m_iRepeTest_Interval = atoi(cRepeTest_Interval); + +} +//========================================================== +void CSO7_Move_Location::OnEnKillfocusEditRepetestRrorrange() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cRepeTest_ErrRange=T2A(m_RepeTest_ErrRange); + + m_dRepeTest_ErrRange = atof(cRepeTest_ErrRange); + m_dRepeTest_ErrRange = m_dRepeTest_ErrRange/1000; + m_lRepeTest_ErrRange = static_cast(m_dRepeTest_ErrRange); +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonSaveRepetest() +{ + + USES_CONVERSION; + + CString FileName; + CString PathName; + FILE* m_pOutFile; + + FileName=_T("RepeTest.txt"); + CString szFilter=_T("TXT Files(*.txt)|*.txt|ALL Files(*.*)|*.*||"); + CFileDialog fdlg(FALSE,_T("INI"),FileName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + + if( fdlg.DoModal()==IDOK) + { + const char* outBuff=NULL; + PathName=fdlg.GetPathName(); + _wfopen_s(&m_pOutFile, PathName, _T("wt")); + if (!m_pOutFile) + { + MessageBox( _T("File name Error."), _T("Message"), MB_OK); + }; + outBuff=T2A(m_OutMessage); + fprintf(m_pOutFile,"%s", outBuff); + fclose(m_pOutFile); + } + delete fdlg; +} +//========================================================= +void CSO7_Move_Location::OnBnClickedCheckRepetestAbsolute() +{ + m_bRepeTestAbsolute=((CButton *)GetDlgItem(IDC_CHECK_REPETEST_ABSOLUTE))->GetCheck(); + if (m_bRepeTestAbsolute) + { + GetDlgItem(IDC_EDIT_REPETEST_ERRORRANGE)->EnableWindow(true); + } + else + GetDlgItem(IDC_EDIT_REPETEST_ERRORRANGE)->EnableWindow(false); + +} +//========================================================================================= +void CSO7_Move_Location::OnBnClickedButtonBeginRepeTest() +{ + + if (bFlag) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_MOVE_XYZ(); + bFlag=false; + bRepeTestDone=false; + } + else + { + bFlag=true; + OnBnClickedButtonZeroSet(); + iCnt=0; + m_OutMessage=_T(""); + GetDlgItem(IDC_EDIT_REPRETEST)->SetWindowText(m_OutMessage); + m_dRepeTest_Record_Dis[0]=0; + m_dRepeTest_Record_Dis[1]=0; + m_dRepeTest_Record_Dis[2]=0; + m_lRepeTest_Record_Dis[0]=0; + m_lRepeTest_Record_Dis[1]=0; + m_lRepeTest_Record_Dis[2]=0; + m_bRepeTestAxisX = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTX))->GetCheck(); + m_bRepeTestAxisY = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTY))->GetCheck(); + m_bRepeTestAxisZ = ((CButton *)GetDlgItem(IDC_CHECK_REPETESTZ))->GetCheck(); + m_bRepeTestAxisV= ((CButton *)GetDlgItem(IDC_CHECK_REPETESTV))->GetCheck(); + m_bRepeTestAbsolute=((CButton *)GetDlgItem(IDC_CHECK_REPETEST_ABSOLUTE))->GetCheck(); + m_pSO7_Proto->g_machine.InterruptFlag[0]=0; + if(((CButton *)GetDlgItem(IDC_CHECK_REPETEST_VOLCOMP))->GetCheck()) + { + bRepeTestDone=true; + RepeTestVolComp(); + } + else if (m_bRepeTestAxisV) + { + bRepeTestDone=true; + RepeTestZoom(); + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + bRepeTestDone=true; + if(((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + RepeTestmmAbs(); + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + RepeTestmmRel(); + } + + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + bRepeTestDone=true; + RepeTestpulse(); + } + + } + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Stop")); + } + +} + + +//========================================================================================= +//For repeatability test and the units is mm. +//˶ ÿξ벻 +//RecordDis ¼ʱ +//RecordToDis ¼ȥʱ +//m_dRepeTest_Dis Եľ +//m_iRepeTest_Times ԵĴ +//bRepeTestDone ˶ʱΪTrueһ +BOOL CSO7_Move_Location::RepeTestVolComp() +{ + UpdateData(TRUE); + CString csTemp; + double dFromX(0.0),dFromY(0.0),dFromZ(0.0); + double dToX(0.0),dToY(0.0),dToZ(0.0); + + if(iCntg_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + dFromX = m_pSO7_Proto->g_machine.x._d_cur_pos_; + dFromY = m_pSO7_Proto->g_machine.y._d_cur_pos_; + dFromZ = m_pSO7_Proto->g_machine.z._d_cur_pos_; + + g_pVolComp->CompensateFromSo7(dFromX,dFromY,dFromZ); + + csTemp.Format(_T("[%2d]\r\n"),iCnt/2+1); + m_OutMessageX+=csTemp; + csTemp.Format(_T("[%2d]\r\n"),iCnt/2+1); + m_OutMessageY+=csTemp; + csTemp.Format(_T("[%2d]\r\n"),iCnt/2+1); + m_OutMessageZ+=csTemp; + + csTemp.Format(_T(">X: From: %-3.4f VolComp : %-3.4f"),m_pSO7_Proto->g_machine.x._d_cur_pos_,dFromX); + m_OutMessageX+=csTemp; + csTemp.Format(_T(">Y: From: %-3.4f VolComp : %-3.4f"),m_pSO7_Proto->g_machine.y._d_cur_pos_,dFromY); + m_OutMessageY+=csTemp; + csTemp.Format(_T(">Z: From: %-3.4f VolComp : %-3.4f"),m_pSO7_Proto->g_machine.z._d_cur_pos_,dFromZ); + m_OutMessageZ+=csTemp; + + dToX=m_dRepeTest_Dis+m_pSO7_Proto->g_machine.x._d_cur_pos_; + dToY=m_dRepeTest_Dis+m_pSO7_Proto->g_machine.y._d_cur_pos_; + dToZ=m_dRepeTest_Dis+m_pSO7_Proto->g_machine.z._d_cur_pos_; + + g_pVolComp->CompensateToSo7(dToX,dToY,dToZ); + + csTemp.Format(_T(" To: %-3.4f VolComp : %-3.4f\r\n"),m_dRepeTest_Dis+m_pSO7_Proto->g_machine.x._d_cur_pos_,dToX); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" To: %-3.4f VolComp : %-3.4f\r\n"),m_dRepeTest_Dis+m_pSO7_Proto->g_machine.y._d_cur_pos_,dToY); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" To: %-3.4f VolComp : %-3.4f\r\n"),m_dRepeTest_Dis+m_pSO7_Proto->g_machine.z._d_cur_pos_,dToZ); + m_OutMessageZ+=csTemp; + + if (m_bRepeTestAxisX) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToX-m_pSO7_Proto->g_machine.x._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + else if(m_bRepeTestAxisY) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToY-m_pSO7_Proto->g_machine.y._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + else if(m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToZ-m_pSO7_Proto->g_machine.z._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + } + + else if(iCnt%2 == 1) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + dFromX=m_pSO7_Proto->g_machine.x._d_cur_pos_; + dFromY=m_pSO7_Proto->g_machine.y._d_cur_pos_; + dFromZ=m_pSO7_Proto->g_machine.z._d_cur_pos_; + g_pVolComp->CompensateFromSo7(dFromX,dFromY,dFromZ); + + csTemp.Format(_T("g_machine.x._d_cur_pos_,dFromX); + m_OutMessageX+=csTemp; + csTemp.Format(_T("g_machine.y._d_cur_pos_,dFromY); + m_OutMessageY+=csTemp; + csTemp.Format(_T("g_machine.z._d_cur_pos_,dFromZ); + m_OutMessageZ+=csTemp; + + dToX=m_pSO7_Proto->g_machine.x._d_cur_pos_-m_dRepeTest_Dis; + dToY=m_pSO7_Proto->g_machine.y._d_cur_pos_-m_dRepeTest_Dis; + dToZ=m_pSO7_Proto->g_machine.z._d_cur_pos_-m_dRepeTest_Dis; + + g_pVolComp->CompensateToSo7(dToX,dToY,dToZ); + + csTemp.Format(_T(" To : %-3.4f VolComp : %-3.4f\r\n"),-m_dRepeTest_Dis+m_pSO7_Proto->g_machine.x._d_cur_pos_,dToX); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" To : %-3.4f VolComp : %-3.4f\r\n"),-m_dRepeTest_Dis+m_pSO7_Proto->g_machine.y._d_cur_pos_,dToY); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" To : %-3.4f VolComp : %-3.4f\r\n"),-m_dRepeTest_Dis+m_pSO7_Proto->g_machine.z._d_cur_pos_,dToZ); + m_OutMessageZ+=csTemp; + + if (m_bRepeTestAxisX) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToX-m_pSO7_Proto->g_machine.x._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + else if(m_bRepeTestAxisY) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToY-m_pSO7_Proto->g_machine.y._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + else if(m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale((dToZ-m_pSO7_Proto->g_machine.z._d_cur_pos_),m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + } + + bRepeTestDone=false; + iCnt++; + } + + } + else + { + bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + return TRUE; +} + +//========================================================================================= +//For repeatability test and the units is mm. +//˶ ÿξ̶ +//RecordDis ¼ʱ +//RecordToDis ¼ȥʱ +//m_dRepeTest_Dis Եľ +//m_iRepeTest_Times ԵĴ +//bRepeTestDone ˶ʱΪTrueһ +BOOL CSO7_Move_Location::RepeTestmmRel() +{ + UpdateData(TRUE); + CString csTemp; + static double RecordDis[3]={0}; + static double RecordToDis[3]={0}; + + static int iRetryCnt(0); + if(iCntg_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + iRetryCnt++; + bRepeTestDone=false; + return false; + } + else if(iRetryCnt>=RETRYNUM) + { + iRetryCnt=0; + //bFlag=false; + //((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + //m_OutMessage+=_T("Sorry,The machine cann't reach the precision requirement. "); + //OutputWithScroll(m_OutMessage,m_edit_RepeTest); + //return false; + } + else + { + iRetryCnt=0; + } + } + //ľ + if(iCnt!=0) + { + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[0]-m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[1]-m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[2]-m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + } + + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(3,0,m_dRepeTest_Dis); + } + else + { + RepeTestMoveTo(2,2,m_dRepeTest_Dis); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(2,1,m_dRepeTest_Dis); + m_OutMessageY=_T(""); + } + else + { + RepeTestMoveTo(1,0,m_dRepeTest_Dis); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(2,0,m_dRepeTest_Dis); + m_OutMessageX=_T(""); + } + else + { + RepeTestMoveTo(1,1,m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(1,2,m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + RepeTestMoveTo(0,0,m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + csTemp.Format(_T("[%2d] X: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("[%2d] Y: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("[%2d] Z: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + + } + + else if(iCnt%2 == 1) + { + RecordToDis[0]=m_dRepeTest_Record_Dis[0]; + RecordToDis[1]=m_dRepeTest_Record_Dis[1]; + RecordToDis[2]=m_dRepeTest_Record_Dis[2]; + + if (m_bRepeTestAbsolute) + { + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + } + else + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + } + if (iRetryCnt_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + bRepeTestDone=false; + return false; + } + else if( iRetryCnt>=RETRYNUM ) + { + iRetryCnt=0; + /*bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + m_OutMessage+=_T("Sorry,The machine cann't reach the precision requirement. "); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + return false;*/ + } + else + { + iRetryCnt=0; + } + + } + + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[0]-RecordDis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[1]-RecordDis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[2]-RecordDis[2]); + m_OutMessageZ+=csTemp; + + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(3,0,-m_dRepeTest_Dis); + } + else + { + RepeTestMoveTo(2,2,-m_dRepeTest_Dis); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(2,1,-m_dRepeTest_Dis); + m_OutMessageY=_T(""); + } + else + { + RepeTestMoveTo(1,0,-m_dRepeTest_Dis); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(2,0,-m_dRepeTest_Dis); + m_OutMessageX=_T(""); + } + else + { + RepeTestMoveTo(1,1,-m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + RepeTestMoveTo(1,2,-m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + RepeTestMoveTo(0,0,-m_dRepeTest_Dis); + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + + } + + bRepeTestDone=false; + iCnt++; + } + + } + else + { + //һ + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[0]-m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[1]-m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[2]-m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + } + else + { + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_OutMessageY=_T(""); + } + else + { + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_OutMessageX=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + return TRUE; +} + +//========================================================================================= +//For repeatability test and the units is mm. +//˶ ÿξ벻 +//RecordDis ¼ʱ +//RecordToDis ¼ȥʱ +//m_dRepeTest_Dis Եľ +//m_iRepeTest_Times ԵĴ +//bRepeTestDone ˶ʱΪTrueһ +BOOL CSO7_Move_Location::RepeTestmmAbs() +{ + UpdateData(TRUE); + CString csTemp; + static double RecordDis[3]={0}; + static double RecordToDis[3]={0}; + + static int iRetryCnt(0); + if(iCntg_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + //ǿƲ + if (m_bRepeTestAbsolute) + { + if (iRetryCntg_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-RecordDis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + iRetryCnt++; + bRepeTestDone=false; + return false; + } + else if(iRetryCnt>=RETRYNUM) + { + iRetryCnt=0; + //bFlag=false; + //((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + //m_OutMessage+=_T("Sorry,The machine cann't reach the precision requirement. "); + //OutputWithScroll(m_OutMessage,m_edit_RepeTest); + //return false; + } + else + { + iRetryCnt=0; + } + } + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //ľ + if(iCnt!=0) + { + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[0]-m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[1]-m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[2]-m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + } + + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageY=_T(""); + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageX=_T(""); + } + else + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + csTemp.Format(_T("[%2d] X: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("[%2d] Y: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("[%2d] Z: From: % .4f "),iCnt/2+1,m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + + } + + else if(iCnt%2 == 1) + { + RecordToDis[0]=m_dRepeTest_Record_Dis[0]; + RecordToDis[1]=m_dRepeTest_Record_Dis[1]; + RecordToDis[2]=m_dRepeTest_Record_Dis[2]; + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + //ǿƲ + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + if (m_bRepeTestAbsolute) + { + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + } + else + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dRepeTest_Dis-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + } + else + { + m_dRepeTest_Record_Dis[0]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[1]=m_dRepeTest_Dis; + m_dRepeTest_Record_Dis[2]=m_dRepeTest_Dis; + } + } + } + if (iRetryCnt_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + bRepeTestDone=false; + return false; + } + else if( iRetryCnt>=RETRYNUM ) + { + iRetryCnt=0; + /*bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + m_OutMessage+=_T("Sorry,The machine cann't reach the precision requirement. "); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + return false;*/ + } + else + { + iRetryCnt=0; + } + + } + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("To: % 3.4f "),m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[0]-RecordDis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[1]-RecordDis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T("Dis: >% 3.4f"),m_dRepeTest_Record_Dis[2]-RecordDis[2]); + m_OutMessageZ+=csTemp; + //============================================================ + //ƻľ + + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageY=_T(""); + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[0],m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageX=_T(""); + } + else + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[1],m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0-m_dRepeTest_Record_Dis[2],m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + + } + + bRepeTestDone=false; + iCnt++; + } + + } + else + { + //һ + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[0]-m_dRepeTest_Record_Dis[0]); + m_OutMessageX+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[1]-m_dRepeTest_Record_Dis[1]); + m_OutMessageY+=csTemp; + csTemp.Format(_T(" <% 3.4f\r\n"),RecordToDis[2]-m_dRepeTest_Record_Dis[2]); + m_OutMessageZ+=csTemp; + if (m_bRepeTestAxisX) + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + } + else + { + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_OutMessageY=_T(""); + } + else + { + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + else + { + if (m_bRepeTestAxisY) + { + if (m_bRepeTestAxisZ) + { + m_OutMessageX=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageZ=_T(""); + } + } + else + { + if (m_bRepeTestAxisZ) + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + } + else + { + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + } + } + } + + m_OutMessage+=m_OutMessageX; + m_OutMessage+=m_OutMessageY; + m_OutMessage+=m_OutMessageZ; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + return TRUE; +} + +//========================================================================================= +//For repeatability test and the units is pulse. +BOOL CSO7_Move_Location::RepeTestpulse() +{ + UpdateData(TRUE); + CString csTemp; + static long lRecordDis[3]={0}; + static int iRetryCnt(0); + if(iCntSetWindowTextW(_T("Begin")); + } + return TRUE; +} +//========================================================================================= +//For auot zoom's repeatability test. +BOOL CSO7_Move_Location::RepeTestZoom() +{ + UpdateData(TRUE); + CString csTemp; + static long RecordFromDisV=0; + static long RecordToDisV=0; + + static int iRetryCnt(0); + if(iCnt>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + //ǿƲ + if (m_bRepeTestAbsolute) + { + if ((iRetryCntg_machine.zm._pos_fixed._long_=(0-RecordFromDisV); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + iRetryCnt++; + bRepeTestDone=false; + return false; + } + else if(iRetryCnt>=RETRYNUM) + { + iRetryCnt=0; + } + else + { + iRetryCnt=0; + } + } + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + //ľ + if(iCnt!=0) + { + csTemp.Format(_T(" <% 6ld\r\n"),RecordToDisV-m_lRepeTest_Record_Dis[3]); + m_OutMessageV+=csTemp; + } + + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=m_lRepeTest_Dis; + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + + m_OutMessage+=m_OutMessageV; + m_OutMessageV=_T(""); + + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + csTemp.Format(_T("[%2d] V: From:% 6ld "),iCnt/2+1,m_lRepeTest_Record_Dis[3]); + m_OutMessageV+=csTemp; + + + } + + else if(iCnt%2 == 1) + { + RecordToDisV=m_lRepeTest_Record_Dis[3]; + + //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + //ǿƲ + if (m_bRepeTestAbsolute) + { + if (iRetryCntg_machine.zm._pos_fixed._long_=m_lRepeTest_Dis-RecordToDisV; + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + bRepeTestDone=false; + return false; + } + else if( iRetryCnt>=RETRYNUM ) + { + iRetryCnt=0; + } + else + { + iRetryCnt=0; + } + + } + //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + csTemp.Format(_T("To:% 6ld "),m_lRepeTest_Record_Dis[3]); + m_OutMessageV+=csTemp; + + + csTemp.Format(_T("Dis: >% 6ld"),m_lRepeTest_Record_Dis[3]-RecordFromDisV); + m_OutMessageV+=csTemp; + + //============================================================ + //ƻľ + m_pSO7_Proto->g_machine.zm._pos_fixed._long_=0-m_lRepeTest_Dis; + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + + } + bRepeTestDone=false; + iCnt++; + } + } + else + { + //һ + csTemp.Format(_T(" <% 6ld\r\n"),RecordToDisV-m_lRepeTest_Record_Dis[3]); + m_OutMessageV+=csTemp; + + + m_OutMessage+=m_OutMessageV; + m_OutMessageV=_T(""); + OutputWithScroll(m_OutMessage,m_edit_RepeTest); + + bFlag=false; + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + return TRUE; +} + + +//========================================================================================= +//Send cmd to controller and control the stage to move. +void CSO7_Move_Location::RepeTestMoveTo(char type,char axis,double dis) +{ + + + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(dis,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(dis,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(dis,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=static_cast(dis); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=static_cast(dis); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=static_cast(dis); + } + + if (type == 1) + { + if (axis == 0) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + } + else if (axis == 1) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + } + else if (axis == 2) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + } + + } + else if(type == 2) + { + if (axis == 0) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + } + else if (axis == 1) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + } + else if (axis == 2) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + } + + } + else if(type == 3) + { + + } + else + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + } + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + +} + +//========================================================================================= +void CSO7_Move_Location::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + + switch(nIDEvent) + { + case 1: + { + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + if (((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + m_X_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Position); + m_Y_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Position); + m_Z_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Position); + + m_Zm_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_ - m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Position); + } + + else if(((CButton *)GetDlgItem(IDC_RADIO_INCH))->GetCheck()) + { + m_X_Position.Format(_T("%8.4lf"), (m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos)/25.4); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Position); + m_Y_Position.Format(_T("%8.4lf"), (m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos)/25.4); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Position); + m_Z_Position.Format(_T("%8.4lf"), (m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos)/25.4); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Position); + + m_Zm_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_ - m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Position); + } + else + { + m_pSO7_Proto->g_machine.x._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.x._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.y._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.z._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_X_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Position); + m_Y_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Position); + m_Z_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Position); + + m_Zm_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_ - m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Position); + } + + } + else + { + m_X_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Position); + m_Y_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Position); + m_Z_Position.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Position); + + m_Zm_Position.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_ - m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Position); + + } + } + break; + } + + case 2: + { + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_INTERRUPT_MESSAGE(); + if (m_pSO7_Proto->g_machine.InterruptFlag[0] == CT_STOPXYZ) + { + if (!bRepeTestDone) + { + if (bFlag) + { + SetTimer(3,m_iRepeTest_Interval,NULL); + } + else + { + bRepeTestDone=true; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + m_OutMessageV=_T(""); + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + } + m_pSO7_Proto->g_machine.InterruptFlag[0]=0; + } + } + } + break; + } + case 3: + { + if (bFlag) + { + if(((CButton *)GetDlgItem(IDC_CHECK_REPETEST_VOLCOMP))->GetCheck()) + { + bRepeTestDone=true; + RepeTestVolComp(); + } + else if(((CButton *)GetDlgItem(IDC_CHECK_REPETESTV))->GetCheck()) + { + bRepeTestDone=true; + m_lRepeTest_Record_Dis[3]=m_pSO7_Proto->g_machine.zm._scale_pos._long_ - m_pSO7_Proto->g_machine.zm._lSet_Zero_Pos; + RepeTestZoom(); + } + else + { + if (((CButton *)GetDlgItem(IDC_RADIO_MM))->GetCheck()) + { + bRepeTestDone=true; + m_dRepeTest_Record_Dis[0]=m_pSO7_Proto->g_machine.x._d_cur_pos_-m_pSO7_Proto->g_machine.x._dSet_Zero_Pos; + m_dRepeTest_Record_Dis[1]=m_pSO7_Proto->g_machine.y._d_cur_pos_-m_pSO7_Proto->g_machine.y._dSet_Zero_Pos; + m_dRepeTest_Record_Dis[2]=m_pSO7_Proto->g_machine.z._d_cur_pos_-m_pSO7_Proto->g_machine.z._dSet_Zero_Pos; + if(((CButton *)GetDlgItem(IDC_RADIO_MOVE_ABSOLUTE))->GetCheck()) + { + RepeTestmmAbs(); + } + else if(((CButton *)GetDlgItem(IDC_RADIO_MOVE_RELATIVE))->GetCheck()) + { + RepeTestmmRel(); + } + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SCALE))->GetCheck()) + { + bRepeTestDone=true; + m_lRepeTest_Record_Dis[0]=m_pSO7_Proto->g_machine.x._scale_pos._long_-m_pSO7_Proto->g_machine.x._lSet_Zero_Pos; + m_lRepeTest_Record_Dis[1]=m_pSO7_Proto->g_machine.y._scale_pos._long_-m_pSO7_Proto->g_machine.y._lSet_Zero_Pos; + m_lRepeTest_Record_Dis[2]=m_pSO7_Proto->g_machine.z._scale_pos._long_-m_pSO7_Proto->g_machine.z._lSet_Zero_Pos; + bRepeTestDone=true; + } + + } + } + else + { + bRepeTestDone=true; + m_OutMessageX=_T(""); + m_OutMessageY=_T(""); + m_OutMessageZ=_T(""); + m_OutMessageV=_T(""); + + ((CButton*)GetDlgItem(IDC_BUTTON_BEGIN_REPE_TEST))->SetWindowTextW(_T("Begin")); + } + KillTimer(3); + break; + } + case 4: + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_ZOOM_MOTION_STATUS(); + if (m_pSO7_Proto->g_machine.s_status._bIsZMMotionFinished) + { + if (m_pSO7_Proto->g_machine.s_status._bZMMoving) + { + CString csTmp; + csTmp.Format(_T("Move to V completed.[%d]\r\n"),m_pSO7_Proto->g_machine.s_status._bIsZMMotionFinished); + OutputWithScroll(csTmp,m_edit_RepeTest); + m_pSO7_Proto->g_machine.s_status._bZMMoving=false; + m_pSO7_Proto->g_machine.s_status._bIsZMMotionFinished=0; + } + } + else + { + if (m_pSO7_Proto->g_machine.s_status._bZMMoving) + { + OutputWithScroll(_T("Moving.\r\n"),m_edit_RepeTest); + } + } + } + break; + } + } + CDialog::OnTimer(nIDEvent); + +} +//===================================================================================== +//Print message on edit control +void CSO7_Move_Location::OutputWithScroll(const CString &strText,CEdit &edtOutput) +{ + + int iCount = strText.GetLength(); + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strText); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); +} + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.h new file mode 100644 index 0000000..1e18a25 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Move_Location.h @@ -0,0 +1,91 @@ +#pragma once + +// CSO7_Move_Location Ի + +class CSO7_Move_Location : public CDialog +{ + DECLARE_DYNAMIC(CSO7_Move_Location) + +public: + CSO7_Move_Location(CWnd* pParent = NULL); // ׼캯 + virtual ~CSO7_Move_Location(); + +// Ի + enum { IDD = IDD_SO7_UTIL_MOVE_LOCATION }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + double m_move_to_x; + double m_move_to_y; + double m_move_to_z; + double m_move_to_zm; + CString m_X_Position; + CString m_Y_Position; + CString m_Z_Position; + CString m_Zm_Position; + CString m_Move_to_X; + CString m_Move_to_Y; + CString m_Move_to_Z; + CString m_Move_to_ZM; + CString m_RepeTest_Dis; + CString m_RepeTest_Times; + CString m_RepeTest_Interval; + CString m_RepeTest_ErrRange; + + CString m_OutMessage; + CString m_OutMessageX; + CString m_OutMessageY; + CString m_OutMessageZ; + CString m_OutMessageV; + + CEdit m_edit_RepeTest; + double m_dRepeTest_Dis; + long m_lRepeTest_Dis; + double m_dRepeTest_Record_Dis[4]; + long m_lRepeTest_Record_Dis[4]; + int m_iRepeTest_Times; + int m_iRepeTest_Interval; + double m_dRepeTest_ErrRange; + long m_lRepeTest_ErrRange; + + bool bRepeTestDone; + BOOL m_bRepeTestAxisX; + BOOL m_bRepeTestAxisY; + BOOL m_bRepeTestAxisZ; + BOOL m_bRepeTestAxisV; + BOOL m_bRepeTestAbsolute; + + SO7AXISMOVE move_x; + SO7AXISMOVE move_y; + SO7AXISMOVE move_z; + SO7AXISMOVE move_zm; + + void RepeTestMoveTo(char type,char axis,double dis); + BOOL RepeTestmmRel(); + BOOL RepeTestmmAbs(); + BOOL RepeTestpulse(); + BOOL RepeTestVolComp(); + BOOL RepeTestZoom(); + + void OutputWithScroll(const CString &strNewText,CEdit &edtOutput); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedOkStart(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnBnClickedButtonMoveToZoom(); + afx_msg void OnBnClickedButtonMoveToXyzLaser(); + afx_msg void OnBnClickedButtonMoveToXyzJm(); + afx_msg void OnBnClickedButtonMoveToXyzv(); + afx_msg void OnBnClickedButtonZeroSet(); + afx_msg void OnEnKillfocusEditRepetestDis(); + afx_msg void OnEnKillfocusEditRepetestTimes(); + afx_msg void OnBnClickedButtonBeginRepeTest(); + afx_msg void OnBnClickedButtonSaveRepetest(); + afx_msg void OnEnKillfocusEditRepetestInterval(); + afx_msg void OnEnKillfocusEditRepetestRrorrange(); + afx_msg void OnBnClickedCheckRepetestAbsolute(); + afx_msg void OnBnClickedRadioScale(); + afx_msg void OnBnClickedRadioMm(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.cpp new file mode 100644 index 0000000..0d3f67d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.cpp @@ -0,0 +1,2206 @@ + + +#include "stdafx.h" +#include "SO7_Proto.h" +#include "..\logger.h" +#include "STATUS_MOTION.h" +#include "math.h" + + + +#define MY_CONFIG 1 +#define MAX_DEVPATH_LENGTH 256 +#define ENDPOINT_TIMEOUT 500 + +//***** Static Data ***** +struct_so7_ep_buff CSO7_Proto::ep_buff[lEPSIZE]; + +//================================================================ +int CSO7_Proto::g_hEP81_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP81_Thread_Id=NULL; + +//================================================================ +int CSO7_Proto::g_hEP82_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP82_Thread_Id=NULL; + +//================================================================ +int CSO7_Proto::g_hEP01_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP01_Thread_Id=NULL; +HANDLE CSO7_Proto::g_hEP01_Serial_Mutex; + +//================================================================ +int CSO7_Proto::g_hEP02_Thread_State=THREAD_PAUSED; +HANDLE CSO7_Proto::g_hEP02_Thread_Id=NULL; +HANDLE CSO7_Proto::g_hEP02_Serial_Mutex; + +//================================================================ +struct_so7_machine CSO7_Proto::g_machine; +usb_dev_handle *CSO7_Proto::g_dev=NULL; +CLogger *CSO7_Proto::g_pLogger; +HANDLE CSO7_Proto::g_hHomedEvent = NULL; + +//=========================================================================== +// Worker Thread to serialize EP_01 commands. +//=========================================================================== +unsigned __stdcall CSO7_Proto::g_EP01_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + TRACE0("g_hSerialUsbThread in loop set.\n"); + if (g_hEP01_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_01_CMD_IDX]._event,INFINITE); + TRACE0("g_hSerialUsbThread obtained event.\n"); + switch (g_hEP01_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hSerialUsbThread processing _send_usb_data();\n"); + _This->_send_usb_data(EP_01_CMD_IDX); + TRACE0("g_hSerialUsbThread return from _send_usb_data();\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP01_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//=========================================================================== +// Worker Thread to serialize EP_02 commands. +//=========================================================================== +unsigned __stdcall CSO7_Proto::g_EP02_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + TRACE0("g_hEP02_Thread in loop set.\n"); + if (g_hEP02_Thread_State == THREAD_EXIT) + ExitThread(0); + WaitForSingleObject(ep_buff[EP_02_CMD_IDX]._event,INFINITE); + TRACE0("g_hEP02_Thread obtained event.\n"); + switch (g_hEP02_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + TRACE0("g_hEP02_Thread calling _send_usb_data. EP_02; %x\n"); + _This->_send_usb_data(EP_02_CMD_IDX); + TRACE0("g_hEP02_Thread return _send_usb_data. EP_02; %x\n"); + break; + } + default: + ExitThread(0); + } + }; + g_hEP02_Thread_State = THREAD_EXIT; + ExitThread(0); +}; + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CSO7_Proto::g_EP81_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_81_DATA_IDX]._event, INFINITE); + switch (g_hEP81_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_81_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//****************************************************************************** +// This is the worker thread to process USBD_TRANSFER_DIRECTION_IN +//****************************************************************************** +unsigned __stdcall CSO7_Proto::g_EP82_Thread(LPVOID pThis) +{ + CSO7_Proto* _This = (CSO7_Proto*)pThis; + for (;;) + { + WaitForSingleObject(ep_buff[EP_82_DATA_IDX]._event, INFINITE); + switch (g_hEP82_Thread_State) + { + case THREAD_EXIT: + { + ExitThread(0); + } + case THREAD_PAUSED: + break; + case THREAD_RUNNING: + { + _This->_reap_async_8x(EP_82_DATA_IDX); + break; + } + default: + ExitThread(0); + } + } +} + +//=========================================================================== +double CSO7_Proto::ScaleToMM(long lCount, double dResolution) +{ + double dMM = 0.0; + dMM = lCount * dResolution; + return dMM; +} + +//=========================================================================== +long CSO7_Proto::MMtoScale(double lDistanceMM, double dResolution) +{ + long lCounts = 0; + if (dResolution) + lCounts = (long) (lDistanceMM / dResolution); + else + ASSERT(0); + return lCounts; +} + +//=========================================================================== +void CSO7_Proto::Trace_EP_Buff(long lIndex) +{ + UCHAR tmp[256]; + CString csTmp; + memcpy(tmp, ep_buff[lIndex]._buffer, ep_buff[lIndex]._size); + csTmp = _T("Trace_EP_Buff _59 "); + for (int ii= 0 ; ii < ep_buff[lIndex]._size ; ++ii) + { + CString csTmpHex; + csTmpHex.Format(_T("%2X"), tmp[ii] ); + csTmp += csTmpHex; + } + TRACE1("_process_SO7_CMD_GET_INDEX_4E() Trace_EP_Buff %s \n", csTmp); +} + +//===================================================================================== +long CSO7_Proto::_4char2long(unsigned char *cBuff) +{ + union + { + long l_value; + char c_array[5]; + }; + memset (c_array, 0, 5); + c_array[0] = cBuff[3]; + c_array[1] = cBuff[2]; + c_array[2] = cBuff[1]; + c_array[3] = cBuff[0]; + return(l_value); +} + +//======================================================================== +void CSO7_Proto::_reverse_dword(DWORD *dWord) +{ + BYTE cBuff[4]; + BYTE *dwBuff = (BYTE *)dWord; + for ( int ii = 0 ; ii < 4 ; ++ii ) + cBuff[ii]= dwBuff[ii]; + + dwBuff[0] = cBuff[3]; + dwBuff[1] = cBuff[2]; + dwBuff[2] = cBuff[1]; + dwBuff[3] = cBuff[0]; +} + +//======================================================================== +void CSO7_Proto::so7_set_full_ringlight_data(long lIntensity) +{ + if (g_machine.s_machine_config._vector_light_model == 3) + { + for (int ii=0 ; iig_machine.s_machine_config._vector_light_model == 2) + { + for (int ii=0 ; ii>8; + Val = MSB|LSB; +} + +//****************************************************************************** +double CSO7_Proto::TimeInSecs(void) +{ + double Secs; + + LARGE_INTEGER HPCounterTicksPerSecond; + BOOL HasHPCounter = QueryPerformanceFrequency(&HPCounterTicksPerSecond); + + if (HasHPCounter == TRUE) + { + // Use high resolution clock. + double HPCounterTicksPersec = (DWORD)((double) HPCounterTicksPerSecond.QuadPart); + LARGE_INTEGER HPTicks; + QueryPerformanceCounter(&HPTicks); + Secs = ((double)HPTicks.QuadPart / HPCounterTicksPersec); + } + else + { + // Use clock with less resolution. + Secs = GetTickCount(); + Secs /= 1000.0; + } + return Secs; +} + +//****************************************************************************** +CSO7_Proto::CSO7_Proto() +{ + ep_buff[EP_01_CMD_IDX]._ep = EP_01; + ep_buff[EP_81_DATA_IDX]._ep = EP_81; + ep_buff[EP_02_CMD_IDX]._ep = EP_02; + ep_buff[EP_82_DATA_IDX]._ep = EP_82; + + for (int i=0;i 2)) + { + token = strtok( szLine, seps ); // Get the command token + if (!_stricmp(token, "DEBUG")) // Hex Mask + { + token = strtok( NULL, seps); + if (token) + { + g_pLogger->m_lLogMask=atoi(token); // 0 or 1 to indicate ON/Off + } + } + else if (!_stricmp(token, "STR_2B01")) // STR_2B_01 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_2b, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_2b, g_machine.s_machine_config._str_bin_2b, (int) strlen(g_machine.s_machine_config._str_2b)); + } + } + else if (!_stricmp(token, "STR_7000")) // STR_7000 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_7000_signature, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_7000_signature, g_machine.s_machine_config._str_bin_7000, (int) strlen(g_machine.s_machine_config._str_7000_signature)); + } + } + else if (!_stricmp(token, "STR_6f00")) // STR_6f00 + { + token = strtok( NULL, seps); + if (token) + { + strcpy(g_machine.s_machine_config._str_6f00_signature, token); + _char2bin((unsigned char *)g_machine.s_machine_config._str_6f00_signature, g_machine.s_machine_config._str_bin_6f00, (int) strlen(g_machine.s_machine_config._str_6f00_signature)); + } + } + else if (!_stricmp(token, "USB_COMMAND_WAIT")) // Pause between Usb Receive Commands + { + token = strtok( NULL, seps); + if (token) + { + g_machine.s_machine_config._usb_command_wait=atoi(token); // 0 or 1 to indicate ON/Off + } + } + else if (!_stricmp(token, "USB_COMMAND_TIMEOUT")) // How long should we wait before we call it timeout + { + token = strtok( NULL, seps); + if (token) + { + g_machine.s_machine_config._usb_command_timeout=atoi(token); // 0 or 1 to indicate ON/Off + } + } + } + } + fclose(hConfigFile); + } + else + { + return SSI_STATUS_SO7_CONFIG_FILE_NOT_FOUND; + }; + + return SSI_STATUS_MOTION_NORMAL; +}; + +//****************************************************************************** +usb_dev_handle* CSO7_Proto::_open_usb_dev(void) +{ + struct usb_bus *bus = NULL; + struct usb_device *dev = NULL; + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == SEVENOCEAN_VID && dev->descriptor.idProduct == SEVENOCEAN_PID) + { + return usb_open(dev); + } + } + } + return NULL; +} + +//****************************************************************************** +// Send is direct and async. +// The receive thread will receive data and interpret it. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::Init_MvUsb() +{ + // Set initial state of the machine + g_machine.s_status._machine_running = false; + g_machine.s_status._poll_58_active = false; + g_machine.s_status._poll_59_active = false; + g_machine.s_status._poll_2b_active = false; + + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + UNREFERENCED_PARAMETER(Status); + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Enter Initialize Mv Usb\n")); + + int usb_status = NULL; + usb_init(); // initialize the library + usb_status = usb_find_busses(); // find all busses + usb_status = usb_find_devices(); // find all connected devices + g_dev = _open_usb_dev(); + if (!g_dev) + { + MessageBox(NULL, _T("Unable to open device"), _T("Message"), MB_OK); + g_pLogger->SendAndFlushPerMode(_T("Unable to open device %s"), usb_strerror()); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_set_configuration(g_dev, MY_CONFIG) < 0) + { + MessageBox(NULL, _T("Unable to SET CONFIGURATION"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + if (usb_claim_interface(g_dev, 0) < 0) + { + usb_close(g_dev); + MessageBox(NULL, _T("Unable to CLAIM DEVICE"), _T("Message"), MB_OK); + return SSI_STATUS_MOTION_DATALINK_ERROR; + } + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_01_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP01_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP01_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Thread_State = THREAD_RUNNING; + + + // ******************************************************************** + // This event is used to kick the Serial Usb Command process. This threading model + // is important because the underlying library is not thread-safe. + // + ep_buff[EP_02_CMD_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + + g_hEP02_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP02_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Thread_State = THREAD_RUNNING; + + // ******************************************************************** + // Prepare and start EP_81 Thread - Use async commit. + // + ep_buff[EP_81_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP81_Thread_State = THREAD_PAUSED; + g_hEP81_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP81_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP01_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + // ******************************************************************** + // Prepare and start EP_82 Thread - Use async commit. + // + ep_buff[EP_82_DATA_IDX]._event = CreateEvent(NULL, // default security attributes + FALSE, // manual reset event object + NULL, // signaled + NULL); // unamed object + g_hEP82_Thread_State = THREAD_PAUSED; + g_hEP82_Thread_Id = CreateThread( (LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) g_EP82_Thread, + (LPVOID) this, + 0, + NULL); + g_hEP02_Serial_Mutex = CreateMutex(NULL, // default security attributes + FALSE, // initial owner + NULL); // name + + + // ********************************************************************* + g_hHomedEvent = CreateEvent(NULL, // default security attributes + TRUE, // manual reset event object + FALSE, // initial state is signaled + NULL); // unamed object + + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Initialize Usb\n")); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::Exit_MvUsb() +{ + SSI_STATUS_MOTION Status=SSI_STATUS_MOTION_NORMAL; + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Enter Exit_MvUsb\n")); + + g_hEP81_Thread_State = THREAD_EXIT; + g_hEP82_Thread_State = THREAD_EXIT; + g_hEP01_Thread_State = THREAD_EXIT; + g_hEP02_Thread_State = THREAD_EXIT; + + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + if (g_hEP81_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP81_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + if (g_hEP82_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP82_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + if (g_hEP01_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP01_Thread_Id,&dwCode); + Sleep(1); + } + } + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + if (g_hEP02_Thread_Id) + { + DWORD dwCode = STILL_ACTIVE; + while (dwCode == STILL_ACTIVE) + { + GetExitCodeThread(g_hEP02_Thread_Id,&dwCode); + Sleep(1); + } + } + + if (g_dev) + { + usb_release_interface(g_dev,0); + usb_close(g_dev); + g_dev = NULL; + } + SetEvent(ep_buff[EP_81_DATA_IDX]._event); + CloseHandle(ep_buff[EP_81_DATA_IDX]._event); + SetEvent(ep_buff[EP_82_DATA_IDX]._event); + CloseHandle(ep_buff[EP_82_DATA_IDX]._event); + g_hEP01_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_01_CMD_IDX]._event); + CloseHandle(ep_buff[EP_01_CMD_IDX]._event); + g_hEP02_Thread_State = THREAD_EXIT; + SetEvent(ep_buff[EP_02_CMD_IDX]._event); + CloseHandle(ep_buff[EP_02_CMD_IDX]._event); + ReleaseMutex(g_hEP01_Serial_Mutex); + CloseHandle(g_hEP01_Serial_Mutex); + ReleaseMutex(g_hEP02_Serial_Mutex); + CloseHandle(g_hEP02_Serial_Mutex); + + if (g_pLogger->m_lLogMask & LOGACTIONS) + g_pLogger->SendAndFlushPerMode(_T("Exit Exit_MvUsb\n")); + return Status; +} + +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::ExtractAppPath(CString &Path) +{ + CString tmpPath = Path; + tmpPath.TrimRight(); + tmpPath.TrimLeft(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash > -1) + { // complete path + tmpPath = Path.Left(nLastSlash); + Path = tmpPath; + } + else + { // not a complete path + Path=""; + }; + return SSI_STATUS_MOTION_NORMAL; +}; + +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::GetAppPath(CString &Path) +{ + Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) + { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + return SSI_STATUS_MOTION_NORMAL; +}; + +//****************************************************************************** +// Replay the capture file. +// There are three special commands: +// 7000 +// 6f00 +// 4c02 +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_replay_capture(CString s_replay_file) +{ + char *_0x4e00_cmd = "4e00"; + FILE* pInFile; + + _wfopen_s(&pInFile, s_replay_file, _T("r")); + if (pInFile == NULL) + return SSI_STATUS_MOTION_REPLAY_FILE_ERROR; + + char *cData = (char *)malloc(MAX_BUFF_SIZE); + char *inBuff = (char *)malloc(MAX_BUFF_SIZE); + + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + while (!feof(pInFile)) + { + if (*inBuff == '>') + { + if (strstr(inBuff, "0x00000001")) + { + if (!(_strnicmp(inBuff+35, _0x4e00_cmd, 4))) break; + _process_replay_capture_commands(inBuff, pInFile); + } + }; + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + }; + fclose(pInFile); + free(cData); + free(inBuff); + return SSI_STATUS_MOTION_NORMAL; +} + +//****************************************************************************** +// Do not send out DCC Home. We can send everything else. +//****************************************************************************** +SSI_STATUS_MOTION CSO7_Proto::_process_replay_capture_commands(char *inBuff, FILE* pInFile) +{ + char x[3]; + char cSize[9]; + int iSendSize; + int iRcvSize; + + if ( ((*(inBuff+35) == '4')) && (*(inBuff+36) == 'f')) + { + fgets((char *)inBuff, MAX_BUFF_SIZE, pInFile ); // pick up the first line + return SSI_STATUS_MOTION_NORMAL; + }; + + memset(cSize, 0 , 9); + memcpy(cSize, inBuff+24, 8); + sscanf_s(cSize, "%8x", &iSendSize); // get the length of the transmission + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0, MAX_BUFF_SIZE); + for (int j=0;j 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_NORMAL; +} + +//=============================================================================== +// _send_usb_data(iEP) sends data to the corresponding iEP channel. +// iEP = EP_01 / EP_02 EP_01 = 0x01; EP_02 = 0x02; +//=============================================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_usb_data(int iEP_Base) +{ + int _ret; + ep_buff[iEP_Base]._save_send_cmd = ep_buff[iEP_Base]._buffer[0]; + ep_buff[iEP_Base]._save_send_cmd0 = ep_buff[iEP_Base]._buffer[1]; + ep_buff[iEP_Base]._save_send_cmd1 = ep_buff[iEP_Base]._buffer[2]; + + TRACE3("_send_usb_data() iEP : %X - ep_buff[iEP]._save_send_cmd : %X ._buffer[0] : %X\r\n", iEP_Base, ep_buff[EP_01_CMD_IDX]._save_send_cmd, ep_buff[EP_81_DATA_IDX]._buffer[0]); + _ret = usb_bulk_setup_async(g_dev, &(ep_buff[iEP_Base]._async_context), (unsigned char)ep_buff[iEP_Base]._ep); + if (_ret < 0) + { + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + _ret = usb_submit_async(ep_buff[iEP_Base]._async_context, ep_buff[iEP_Base]._buffer, ep_buff[iEP_Base]._size); + if (_ret < 0) + { + printf("error usb_submit_async_ep_xx:\n%s\n", usb_strerror()); + return SSI_STATUS_MOTION_SETUP_ASYNC_CONTEXT_ERROR; + } + TRACE1("_submit_async_8x(EP:%X)\r\n", iEP_Base); + // + ep_buff[iEP_Base+1]._save_send_cmd = ep_buff[iEP_Base+1]._buffer[0]; + ep_buff[iEP_Base+1]._save_send_cmd0 = ep_buff[iEP_Base+1]._buffer[1]; + ep_buff[iEP_Base+1]._save_send_cmd1 = ep_buff[iEP_Base+1]._buffer[2]; + // + _submit_async_8x(iEP_Base+1); // Send EP_81/EP_82 + // Get ready to receive on EP_81 or EP_82 + SetEvent(ep_buff[iEP_Base+1]._event); + // Get ready to receive on EP_01 or EP_02 + _ret = usb_reap_async(ep_buff[iEP_Base]._async_context, 10000); + if (_ret > 0) + { + _process_rcv_transfer_data(iEP_Base); + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ep_buff[iEP_Base]._hProtoPending = false; + } + else + { + usb_free_async(&(ep_buff[iEP_Base]._async_context)); + ASSERT(0); + return SSI_STATUS_MOTION_TIMEOUT; + } + return SSI_STATUS_MOTION_NORMAL; +} + +////======================================================================== +//// Poll Machine 58 +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::_poll_machine_58() +//{ +// WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); +// memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); +// *(ep_buff[EP_01_CMD_IDX]._buffer) = SO7_CMD_GET_SCALE_58; +// ep_buff[EP_01_CMD_IDX]._size = 0x01; // send 0x01 bytes over +// ep_buff[EP_81_DATA_IDX]._size = 0x11; // expects 45 bytes back +// _do_single_threaded_usb_comm(EP_01_CMD_IDX); +// ReleaseMutex(g_hEP01_Serial_Mutex); +// return SSI_STATUS_MOTION_NORMAL; +//}; +// +////======================================================================== +//// Poll Machine +//// submit poll command, update the position readout +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::_poll_machine_59() +//{ +// WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); +// memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); +// *(ep_buff[EP_01_CMD_IDX]._buffer) = SO7_CMD_GET_POLL_59; +// *(ep_buff[EP_01_CMD_IDX]._buffer+1) = 0x01; +// *(ep_buff[EP_01_CMD_IDX]._buffer+2) = 0x01; +// ep_buff[EP_01_CMD_IDX]._size = 0x10; // send 0x01 bytes over +// ep_buff[EP_81_DATA_IDX]._size = 0x3e; // expects 45 bytes back +// _do_single_threaded_usb_comm(EP_01_CMD_IDX); +// ReleaseMutex(g_hEP01_Serial_Mutex); +// return SSI_STATUS_MOTION_NORMAL; +//}; + +////======================================================================== +//// _poll_machine_2b +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::_poll_machine_2b() +//{ +// WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); +// memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); +// *ep_buff[EP_01_CMD_IDX]._buffer = SO7_CMD_SERVO_CMD_2B; +// ep_buff[EP_01_CMD_IDX]._size = 0x01; // send 0x01 bytes over +// ep_buff[EP_81_DATA_IDX]._size = 0x45; // expects 45 bytes back +// _do_single_threaded_usb_comm(EP_01_CMD_IDX); +// ReleaseMutex(g_hEP01_Serial_Mutex); +// return SSI_STATUS_MOTION_NORMAL; +//}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_is_supported() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +////======================================================================== +//// call from Hsi +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_motion_startup(double dScaleResolutionX, double dScaleResolutionY, double dScaleResolutionZ) +//{ +// g_machine.s_machine_config.x_axis._scale_resolution = dScaleResolutionX; +// g_machine.s_machine_config.y_axis._scale_resolution = dScaleResolutionY; +// g_machine.s_machine_config.z_axis._scale_resolution = dScaleResolutionZ; +// _start_machine(); +// // so7_motion_Dcc_Home(); +// _replay_capture(_T("Replay_Capture")); +// return SSI_STATUS_MOTION_NORMAL; +//}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_axis_count(int &iCount) +{ + iCount = 4; + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// This speed setting will be carried out in the next DCC move +// Full Speed -> dPercentSpeed = 100% +// Slow Speed -> dPercentSpeed = 20% +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_speed_xyz(double dPercentSpeed) +{ + g_machine.s_machine_config._dXYZSpeed = dPercentSpeed; + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_speed_xyz(double &dPercentSpeed) +{ + dPercentSpeed = g_machine.s_machine_config._dXYZSpeed; + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_speed_r(long z_speed) +{ + g_machine.z._speed = z_speed; + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_settle_time() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_deadband() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_refresh_deadband() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// Just get the values from g_machine. +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_position_xyz(double & dX, double & dY, double & dZ) +{ + long lX=0, lY=0, lZ=0, lZm=0; + +// _send_cmd_SO7_CMD_GET_POLL_59(lX, lY, lZ, lZm); + + lX -= g_machine.s_machine_config.x_axis._neg_working_limit; + lY -= g_machine.s_machine_config.y_axis._neg_working_limit; + lZ -= g_machine.s_machine_config.z_axis._neg_working_limit; + + dX = ScaleToMM(lX, g_machine.s_machine_config.x_axis._scale_resolution); + dY = ScaleToMM(lY, g_machine.s_machine_config.y_axis._scale_resolution); + dZ = ScaleToMM(lZ, g_machine.s_machine_config.z_axis._scale_resolution); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::_set_position_xyz(SO7AXISMOVE &X, SO7AXISMOVE &Y, SO7AXISMOVE &Z) +//{ +// WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); +// memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); +// +// //pSO7_CMD_01->uCmdByte = SO7_CMD_MOVE_TO_53; +// +// pSO7_CMD_01->S_SO7_CMD_0x53.uSubCmdByte = 0; +// +// pSO7_CMD_01->S_SO7_CMD_0x53.statusByte[0] = 1; +// pSO7_CMD_01->S_SO7_CMD_0x53.statusByte[1] = 1; +// pSO7_CMD_01->S_SO7_CMD_0x53.statusByte[2] = 1; +// pSO7_CMD_01->S_SO7_CMD_0x53.statusByte[3] = 0; +// +// pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.x = X.to; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.y = Y.to; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.z = Z.to; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.x = X.speed; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.y = Y.speed; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.z = Z.speed; +//#pragma message("set accel and decel") +// pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.x = X.acc; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.y = Y.acc; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.z = Z.acc; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.x = X.dec; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.y = Y.dec; +// pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.z = Z.dec; +// +// // swap the bytes for buffer sent to controller +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.x)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.y)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_POS.z)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.x)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.y)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_SPEED.z)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.x)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.y)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_ACC.z)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.x)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.y)); +// _reverse_dword((DWORD *)&(pSO7_CMD_01->S_SO7_CMD_0x53.S_DEC.z)); +// +// ep_buff[EP_01_CMD_IDX]._size = 0x60; // send 0x60 bytes over +// ep_buff[EP_82_DATA_IDX]._size = 0x2; // expects 2 bytes back +// +// // look at the start of the buffer +// if (0) +// { +// long lMax = 60; +// char * pch = ep_buff[EP_01_CMD_IDX]._buffer; +// CString tmp; +// for (long ii = 0 ; ii < lMax ; ++ii) +// { +// tmp.Format(_T("%X"), (unsigned char ) *(pch+ii)); +// TRACE1("Set Position %s", tmp); +// } +// TRACE0("\n"); +// } +// _do_single_threaded_usb_comm(EP_01_CMD_IDX); +// ReleaseMutex(g_hEP01_Serial_Mutex); +// +// return SSI_STATUS_MOTION_NORMAL; +//} + +//==================================================================================================================== +// MV uses a proportional max accel and decel for all moves sample 10, 10, 1 move +//> [endpoint 0x00000001] 00000060 : 530001010100ffff2be6fffeea72ffffcd8e000000000003d08f0003ce20000061a100000000000f423b000f387d0001868200000000003d08ee003ce1f500061a07000000000000000000000000000000000000000000000000000000000000 +// [6015605 ms] *Command : 53 Move To -- # X Y Z ZM Scale +// *Pos: -0054298 -0071054 -0012914 00000000 +// *Vel: 00249999 00249376 00024993 00000000 +// *Acc: 00999995 00997501 00099970 00000000 +// *Dec: 03999982 03990005 00399879 00000000 +//==================================================================================================================== +SSI_STATUS_MOTION CSO7_Proto::_calculate_straightline_motion(SO7AXISMOVE &X, SO7AXISMOVE &Y, SO7AXISMOVE &Z, double dSpeedMM) +{ + + double dTime=0.0; + double dXTime = 0.0, dYTime = 0.0, dZTime = 0.0; + + double lSpeedXMM = ScaleToMM(g_machine.s_machine_config.x_axis._max_speed, g_machine.s_machine_config.x_axis._scale_resolution); + double lSpeedYMM = ScaleToMM(g_machine.s_machine_config.y_axis._max_speed, g_machine.s_machine_config.y_axis._scale_resolution); + double lSpeedZMM = ScaleToMM(g_machine.s_machine_config.z_axis._max_speed, g_machine.s_machine_config.z_axis._scale_resolution); + +#pragma message("Add code to apply the speed") + + if (lSpeedXMM) + dXTime = fabs((double)(X.dToMM-X.dFromMM)/lSpeedXMM); + + if (lSpeedYMM) + dYTime = fabs((double)(Y.dToMM-Y.dFromMM)/lSpeedYMM); + + if (lSpeedZMM) + dZTime = fabs((double)(Z.dToMM-Z.dFromMM)/lSpeedZMM); + + dTime = (dXTime>dYTime)?dXTime:dYTime; + dTime = (dZTime>dTime)?dZTime:dTime; + + double dDistance = sqrt( pow(X.dToMM-X.dFromMM, 2) + pow(Y.dToMM-Y.dFromMM, 2) + pow(Z.dToMM-Z.dFromMM, 2) ); + double dMaxSpeed = dDistance/dTime; + double dSpeedFactor = dSpeedMM / dMaxSpeed; + dSpeedFactor = (dSpeedFactor > 1.0) ? 1.0 : dSpeedFactor; + + double dXFactor = dSpeedFactor * dXTime/dTime; + double dYFactor = dSpeedFactor * dYTime/dTime; + double dZFactor = dSpeedFactor * dZTime/dTime; + + // MV uses a proportional max accel and decel for all moves sample 10, 10, 1 move + //> [endpoint 0x00000001] 00000060 : 530001010100ffff2be6fffeea72ffffcd8e000000000003d08f0003ce20000061a100000000000f423b000f387d0001868200000000003d08ee003ce1f500061a07000000000000000000000000000000000000000000000000000000000000 + // [6015605 ms] *Command : 53 Move To -- # X Y Z ZM Scale + // *Pos: -0054298 -0071054 -0012914 00000000 + // *Vel: 00249999 00249376 00024993 00000000 + // *Acc: 00999995 00997501 00099970 00000000 + // *Dec: 03999982 03990005 00399879 00000000 + + X.speed = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_speed); + X.acc = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_accel); + X.dec = (long)(dXFactor * g_machine.s_machine_config.x_axis._max_decel); + + Y.speed = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_speed); + Y.acc = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_accel); + Y.dec = (long)(dYFactor * g_machine.s_machine_config.y_axis._max_decel); + + Z.speed = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_speed); + Z.acc = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_accel); + Z.dec = (long)(dZFactor * g_machine.s_machine_config.z_axis._max_decel); + + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// To do a move. +//======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait) +//{ +// _poll_machine_58(); +// _poll_machine_59(); +// +// // get the current position +// double dXStart, dYStart, dZStart; +// so7_motion_get_position_xyz(dXStart, dYStart, dZStart); +// +// SO7AXISMOVE X; +// SO7AXISMOVE Y; +// SO7AXISMOVE Z; +// +// X.dFromMM = dXStart; +// X.dToMM = dX; +// Y.dFromMM = dYStart; +// Y.dToMM = dY; +// Z.dFromMM = dZStart; +// Z.dToMM = dZ; +// +// X.from = MMtoScale(dXStart, g_machine.s_machine_config.x_axis._scale_resolution); +// X.to = MMtoScale(dX, g_machine.s_machine_config.x_axis._scale_resolution); +// Y.from = MMtoScale(dYStart, g_machine.s_machine_config.y_axis._scale_resolution); +// Y.to = MMtoScale(dY, g_machine.s_machine_config.y_axis._scale_resolution); +// Z.from = MMtoScale(dZStart, g_machine.s_machine_config.z_axis._scale_resolution); +// Z.to = MMtoScale(dZ, g_machine.s_machine_config.z_axis._scale_resolution); +// +// // move the position to make the -X, -Y, -Z position 0,0,0 +// X.to += g_machine.s_machine_config.x_axis._neg_working_limit; +// Y.to += g_machine.s_machine_config.y_axis._neg_working_limit; +// Z.to += g_machine.s_machine_config.z_axis._neg_working_limit; +// +// X.from += g_machine.s_machine_config.x_axis._neg_working_limit; +// Y.from += g_machine.s_machine_config.y_axis._neg_working_limit; +// Z.from += g_machine.s_machine_config.z_axis._neg_working_limit; +// +// _calculate_straightline_motion(X, Y, Z, g_machine.s_machine_config._dXYZSpeed); +// _set_position_xyz(X, Y, Z); +// +//#pragma message("Test settle wait comparing the status bit to the scale monitor") +// +// if (bWait) +// { +// const long lSleep = 20; +// const long lMaxLoopCnt = 20000/lSleep; // use max homing time of 20 seconds +// long lLoopCnt = 0; +// Sleep(lSleep); +// _poll_machine_58(); +// _poll_machine_59(); +// while (!g_machine.s_status._bXYZZMIdle && lLoopCnt < lMaxLoopCnt) +// { +// _poll_machine_58(); +// _poll_machine_59(); +// Sleep(lSleep); +// ++lLoopCnt; +// } +// TRACE1("Presettle Time: %lf\n", TimeInSecs()); +// WaitForSettleXYZZM(); +// TRACE1("Postsettle Time: %lf\n", TimeInSecs()); +// } +// return SSI_STATUS_MOTION_NORMAL; +//}; + +//======================================================================== +// 43 10 +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_position_r(double &dPositionR) +{ + dPositionR = g_machine.r1._deg; + return SSI_STATUS_MOTION_NORMAL; +}; + +////======================================================================== +//// +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_position_r(double dPositionR) +//{ +//// _send_cmd_SO7_CMD_GET_X_INDEX_41(0x10); // 41 10 +//// _send_cmd_SO7_CMD_GET_Y_INDEX_42(0x10); // 42 10 +//// _send_cmd_PRE_ROTARY(); +//// _send_cmd_SO7_CMD_GET_MAG_43(0x10); // 43 10 +// // Converts dPositionR to scale count. +// long lCount = (long) (g_machine.s_machine_config.r1_axis._scale_resolution*dPositionR); +//// _send_cmd_SO7_CMD_MOVE_AXIS_4C10(lCount); +// Sleep(200); +//// while ( g_machine.s_status._bRMoving) // wait for move to complete +//// { +//// Sleep(50); +//// }; +// // once complete, we can update the true position. +// g_machine.r1._deg = dPositionR; +// return SSI_STATUS_MOTION_NORMAL; +//}; + +//======================================================================== +// todo: +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_store_position_xyz() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// todo: +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_stored_positions_xyz() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// todo: Check 0x59 commands. +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_is_so7_axis_moving() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// home position is the position of the magnetic mark calculated +// from the power off position. +// When the machine is powered off, it has a position. +//======================================================================== +bool CSO7_Proto::so7_motion_is_homed() +{ + return(g_machine.s_machine_config.x_axis._pos_working_limit == 0 && g_machine.s_machine_config.x_axis._neg_working_limit == 0)?false:true; +} + +//======================================================================== +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_set_stage_limits() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// Stage Limit is .5" from the edge. so, it is +// Positive Limit = homing mark + (150 - (.5"25.4)) +// Negative Limit = homing mark - (150 - (.5"25.4)) +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_stage_limits() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// Do not implement. +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_dcc_scan_start() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// Do not implement. +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_dcc_scan_get_data_size() +{ + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_dcc_scan_get_data() +{ + return SSI_STATUS_MOTION_NORMAL; +} +// +////======================================================================== +//// Move the stage left/right until the index location is non-zero +////======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_motion_Dcc_Home() +//{ +// _get_config(); +// //======================================== +// // Get the current position +// _poll_machine_59(); +//// _send_cmd_SO7_CMD_GET_MAG_43(0x03); +// //======================================== +// // Read the index status from the controller +// // if the returned 5E working_limit == 0, we need to home the machine +//// _send_cmd_SO7_CMD_GET_WORKING_LIMITS_5E(); +// _get_xyz_index(); +//// _send_cmd_SO7_CMD_GET_CONFIG_69(0x01); +// +// if (!(g_machine.s_machine_config.x_axis._pos_working_limit == 0 && g_machine.s_machine_config.x_axis._neg_working_limit == 0 )) +// { +// SetEvent(g_hHomedEvent); +// return SSI_STATUS_MOTION_NORMAL; +// } +// +// m_bHomingActive = true; // Tell the world we need to home the stage +// +// // Seek Zm - Index Position +//// _send_cmd_SO7_CMD_SEEK_INDEX_4F(0x03, 0x00); +// // Don't know what this is +//// _send_cmd_SO7_CMD_GET_CONFIG_69(0x01); +// // Seek Z - Index Position +//// _send_cmd_SO7_CMD_SEEK_INDEX_4F(0x02, 0x00); +// Sleep(20); +// _poll_machine_59(); +// _poll_machine_58(); +// +// TRACE0(" - waiting for Z to stop moving\n"); +// //======================================== +// // Wait until Z stopped moving +// while (g_machine.s_status._bZMoving) +// { +// Sleep(50); +// _poll_machine_59(); +// } +// +// //===================================== +// // get stage working limits +// // move the Z to the top to clear the working area. +//// _send_cmd_SO7_CMD_GET_WORKING_LIMITS_5E(); +//// _send_cmd_SO7_CMD_MOVE_AXIS_4C(0x02, g_machine.s_machine_config.z_axis._pos_working_limit, 1); +// _poll_machine_59(); +// +// //===================================== +// // Seek X- Index Positions +//// _send_cmd_SO7_CMD_SEEK_INDEX_4F(0x00, 0x00); +// // Seek Y- Index Positions +//// _send_cmd_SO7_CMD_SEEK_INDEX_4F(0x01, 0x00); +// _poll_machine_59(); +// _poll_machine_58(); +// +// TRACE0(" - waiting for X,Y,Zm to stop moving\n"); +// //======================================== +// // Wait until X-Y-Zm stopped moving +// while (g_machine.s_status._bYMoving || g_machine.s_status._bXMoving || g_machine.s_status._bZMMoving) +// { +// Sleep(50); +// _poll_machine_59(); +// } +// +// //======================================== +// // 5e Get stage working limits after homing +//// _send_cmd_SO7_CMD_GET_WORKING_LIMITS_5E(); +// // 5e Get state working limits to update to the real limits data +//// _send_cmd_SO7_CMD_GET_WORKING_LIMITS_5E(); +// _get_xyz_index(); +// m_bHomingActive = false; +// SetEvent(g_hHomedEvent); +// return SSI_STATUS_MOTION_NORMAL; +//} + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_shut_down() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_fly_mode_cancel() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// From g_machine +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_axes_max_speed(double &dMaxSpeedX, double &dMaxSpeedY, double &dMaxSpeedZ) +{ + dMaxSpeedX = g_machine.s_machine_config.x_axis._max_speed; + dMaxSpeedY = g_machine.s_machine_config.y_axis._max_speed; + dMaxSpeedZ = g_machine.s_machine_config.z_axis._max_speed; + + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_3D_max_speed(double &dMaxSpeed) +{ + double dMaxSpeedX = g_machine.s_machine_config.x_axis._max_speed; + double dMaxSpeedY = g_machine.s_machine_config.y_axis._max_speed; + double dMaxSpeedZ = g_machine.s_machine_config.z_axis._max_speed; + + dMaxSpeed = sqrt(dMaxSpeedX*dMaxSpeedX + dMaxSpeedY*dMaxSpeedY + dMaxSpeedZ*dMaxSpeedZ); + + return SSI_STATUS_MOTION_NORMAL; +} + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_motion_get_position_meas_point() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_is_supported() +{ + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_start_up() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// 11 steps +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_magnification_steps(int &iSteps) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + iSteps = 11; + TRACE1("Optics Get Mag Steps: %X \r\n",iSteps); + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// Not implemented +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_numeric_aperture() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_magnification(int& iStep) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + iStep = g_machine.s_machine_config.zm_axis._mag_step; + TRACE1("Optics Get Mag : %X \r\n",g_machine.s_machine_config.zm_axis._mag_step); + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +/* + *Command : 4C 03 00 Set Mag 00002633 00009484 00024487 00097948 + *Command : 4C 03 01 Set Mag -0000287 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00000013 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00005253 00009484 00024487 00097948 + *Command : 4C 03 01 Set Mag -0000287 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00000013 00009484 00024487 00097948 + *Command : 4C 03 00 Set Mag 00007873 00009484 00024487 00097948 +*/ +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_set_magnification(int iStep) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + g_machine.s_machine_config.zm_axis._mag_step = iStep; + TRACE1("Optics Set Mag : %X \r\n",g_machine.s_machine_config.zm_axis._mag_step); + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_deadband() +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range) +{ + WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done + neg_scale_range = g_machine.s_machine_config.zm_axis._neg_working_limit; + pos_scale_range = g_machine.s_machine_config.zm_axis._pos_working_limit; + + neg_scale_range -= g_machine.s_machine_config.zm_axis._neg_working_limit; + pos_scale_range -= g_machine.s_machine_config.zm_axis._neg_working_limit; + + TRACE2("Get Scale Range : %X, %X \r\n",neg_scale_range, pos_scale_range); + TRACE2("Get Scale Range : %X, %X \r\n",neg_scale_range, pos_scale_range); + + return SSI_STATUS_MOTION_NORMAL; +}; + +//======================================================================== +// +//======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_optics_get_scale_position(long &lScale) +//{ +// WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done +// _poll_machine_59(); +// lScale = g_machine.zm._pos_59; +// lScale -= g_machine.s_machine_config.zm_axis._neg_working_limit; +// TRACE1("get scale position : g_machine.s_machine_config.zm_axis._neg_working_limit = %X \r\n",g_machine.s_machine_config.zm_axis._neg_working_limit); +// TRACE1(" scale position : %X \r\n",lScale); +// return SSI_STATUS_MOTION_NORMAL; +//}; + +//======================================================================== +// get scale first. +// if the target is backwards, +// set destination with 01 status +// set destination with 00 status +// +//======================================================================== +//SSI_STATUS_MOTION CSO7_Proto::so7_optics_set_scale_position(long lScale) +//{ +//// const long lSleep = 20; +//// const long lMaxLoopCnt = 20000/lSleep; // use max homing time of 20 seconds +//// long lLoopCnt = 0; +// +// WaitForSingleObject(g_hHomedEvent, INFINITE); // machine start and homing is done +// TRACE1("caller set scale position = %X \r\n", lScale); +// lScale += g_machine.s_machine_config.zm_axis._neg_working_limit; +// _poll_machine_59(); +// +// long lBacklashMove = g_machine.s_machine_config.zm_axis._slack; +// long lLast = g_machine.zm._pos_59; +// +// // if a negative move, overshoot and come back for backlash removal +// if (lScale < g_machine.zm._pos_59) +// { +// long lDestination = lScale - lBacklashMove; +// lDestination = (lDestinationg_machine.s_machine_config.zm_axis._pos_working_limit) ? g_machine.s_machine_config.zm_axis._pos_working_limit : lDestination; +// lDestination = (lDestinationg_machine.s_machine_config._vector_light_model == 2) + { + g_machine.s_lights_200._axial_light = (long)(dTopPercent/100.0 * (MAXLIGHTVALUE - 1)); + g_machine.s_lights_200._bottom_light = (long)(dBottomPercent/100.0 * (MAXLIGHTVALUE - 1)); + TRACE2("so7_light_set_lamp_state bottom: %ld top: %ld\n", + g_machine.s_lights_300._bottom_light, g_machine.s_lights_200._axial_light); + }; + return SSI_STATUS_MOTION_NORMAL; +} + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_X() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVEX; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = g_machine.x._pos_once; + + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_Y() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVEY; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = g_machine.y._pos_once; + + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_Z() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVEZ; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = g_machine.z._pos_once; + + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_ZM() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVEV; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = g_machine.zm._pos_once; + + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_RESET_XYZ() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_RESET; + *(ep_buff[EP_01_CMD_IDX]._buffer+2) = 0X00; + + ep_buff[EP_01_CMD_IDX]._size = 0x03; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_X() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVETOX; + *(ep_buff[EP_01_CMD_IDX]._buffer+2)=(((g_machine.x._pos_fixed._char_[2])<0x80)?(g_machine.x._pos_fixed._char_[2]):((g_machine.x._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_01_CMD_IDX]._buffer+3)=(g_machine.x._pos_fixed._char_[1]); + *(ep_buff[EP_01_CMD_IDX]._buffer+4)=(g_machine.x._pos_fixed._char_[0]); + + + ep_buff[EP_01_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Y() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVETOY; + *(ep_buff[EP_01_CMD_IDX]._buffer+2)=(((g_machine.y._pos_fixed._char_[2])<0x80)?(g_machine.y._pos_fixed._char_[2]):((g_machine.y._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_01_CMD_IDX]._buffer+3)=(g_machine.y._pos_fixed._char_[1]); + *(ep_buff[EP_01_CMD_IDX]._buffer+4)=(g_machine.y._pos_fixed._char_[0]); + + + ep_buff[EP_01_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Z() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVETOZ; + *(ep_buff[EP_01_CMD_IDX]._buffer+2)=(((g_machine.z._pos_fixed._char_[2])<0x80)?(g_machine.z._pos_fixed._char_[2]):((g_machine.z._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_01_CMD_IDX]._buffer+3)=(g_machine.z._pos_fixed._char_[1]); + *(ep_buff[EP_01_CMD_IDX]._buffer+4)=(g_machine.z._pos_fixed._char_[0]); + + + ep_buff[EP_01_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_ZM() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + *(ep_buff[EP_01_CMD_IDX]._buffer) = CT_MOTOR; + *(ep_buff[EP_01_CMD_IDX]._buffer+1) = CT_MOVETOV; + *(ep_buff[EP_01_CMD_IDX]._buffer+2)=(((g_machine.zm._pos_fixed._char_[2])<0x80)?(g_machine.zm._pos_fixed._char_[2]):((g_machine.zm._pos_fixed._char_[2])|0x80));//λ + *(ep_buff[EP_01_CMD_IDX]._buffer+3)=(g_machine.zm._pos_fixed._char_[1]); + *(ep_buff[EP_01_CMD_IDX]._buffer+4)=(g_machine.zm._pos_fixed._char_[0]); + + + ep_buff[EP_01_CMD_IDX]._size = 0x07; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ() +{ + WaitForSingleObject(g_hEP01_Serial_Mutex, INFINITE); + memset(ep_buff[EP_01_CMD_IDX]._buffer, 0x00, MAX_BUFF_SIZE); + + pSO7_CMD_01->uCmdByte = CT_MOTOR; + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.uSubCmdByte =CT_MOVETOXYZ; + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[0]=(((g_machine.x._pos_fixed._char_[2])<0x80)?(g_machine.x._pos_fixed._char_[2]):((g_machine.x._pos_fixed._char_[2])|0x80));//λ + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[1]=(g_machine.x._pos_fixed._char_[1]); + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[2]=(g_machine.x._pos_fixed._char_[0]); + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[3]=(((g_machine.y._pos_fixed._char_[2])<0x80)?(g_machine.y._pos_fixed._char_[2]):((g_machine.x._pos_fixed._char_[2])|0x80));//λ + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[4]=(g_machine.y._pos_fixed._char_[1]); + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[5]=(g_machine.y._pos_fixed._char_[0]); + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[6]=(((g_machine.z._pos_fixed._char_[2])<0x80)?(g_machine.z._pos_fixed._char_[2]):((g_machine.z._pos_fixed._char_[2])|0x80));//λ + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[7]=(g_machine.z._pos_fixed._char_[1]); + pSO7_CMD_01->S_SO7_CMD_MOVE_XYZ.data[8]=(g_machine.z._pos_fixed._char_[0]); + + + ep_buff[EP_01_CMD_IDX]._size = 0x12; + ep_buff[EP_81_DATA_IDX]._size = 0x45; + + _do_single_threaded_usb_comm(EP_01_CMD_IDX); + ReleaseMutex(g_hEP01_Serial_Mutex); + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_X() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_Y() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_Z() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_ZM() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_RESET_XYZ() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_X() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_Y() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_Z() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_ZM() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; + +//============================================================== +SSI_STATUS_MOTION CSO7_Proto::_process_SO7_CMD_MOVE_TO_POS_XYZ() +{ + + return SSI_STATUS_MOTION_NORMAL; +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.h new file mode 100644 index 0000000..6e29e46 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Proto.h @@ -0,0 +1,420 @@ +// protocol for control SevenOcean's Machine +// +////////////////////////////////////////////////////////////////////// +#ifndef AFX_SO7_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + #define AFX_SO7_Proto_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ + +#define SO7_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 "CMD_H.h" +#include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h" +#include "..\..\..\MicroVu\SsiStatus.h" + +#define MAX_BUFF_SIZE 0x200 + +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +#define USB_DEVICE_DESCRIPTOR_TYPE 1 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 2 + +#define THREAD_RUNNING 0 +#define THREAD_PAUSED 1 +#define THREAD_EXIT -1 + +// Device configuration and interface id. +#define SO7_USB_CONFIG 1 +#define SO7_USB_INTF 0 + +#define EP_01 0x01 +#define EP_02 0x02 +#define EP_03 0x03 +#define EP_81 0x81 +#define EP_82 0x82 +#define EP_84 0x84 + +#define EP_01_CMD_IDX 0 // index to usb buffers +#define EP_81_DATA_IDX 1 // +#define EP_02_CMD_IDX 2 // +#define EP_82_DATA_IDX 3 // +#define EP_03_CMD_IDX 4 // +#define EP_84_DATA_IDX 5 // + +#define lEPSIZE 6 +#define MAXRINGS 5 // for MicroVu Vertex 220 +#define MAXSEGS 8 + +#define TWO_RINGS 2 +#define EIGHT_SEGS 8 +#define FIVE_RINGS 5 + +const long MAX_INTENSITY = 0x3FF; +#define MAXLIGHTVALUE 1024 + +#define TWO_RINGS 2 +#define EIGHT_SEGS 8 +#define FIVE_RINGS 5 +#define MAXLIGHTVALUE 1024 + +#pragma pack(push) +#pragma pack(1) +//**************************************************************************************************** +// Set the _status to Idle after reply data has been received. +// How to recover? In order to send data, _status must be Idle. If the system is not available +// for 1 second, assume something wrong and treat it as "TimeOut". +// Another way to do this is to lock this structure is to use a mutex to ensure single-threaded +// access. +//**************************************************************************************************** +//==================================================================================================== + +typedef struct s_so7_axis // axis parameters +{ + int _pos_once; + union + { + long _long_; + char _char_[4]; + }_pos_fixed; + + long _scale_pos; + long _speed; + long _acceleration; + long _deceleration; + double _deg; +} SO7AXIS; +struct s_so7_axis_config // axis configuration +{ + double _scale_resolution; + long _scale_range; + long _neg_working_limit; + long _pos_working_limit; + long _scale_count; + long _max_speed; + long _max_accel; + long _max_decel; + long _index_10; + long _index_03; + bool _bhomed; +}; +struct s_so7_zm_axis_config // zm configuration +{ + int _mag_step; // number of steps + long _max_speed; + long _scale_count; // total scale count + long _neg_working_limit; // within the limits + long _pos_working_limit; + long _max_accel; + long _max_decel; + long _index_03; + long _index_10; + int _slack; +}; + +struct s_so7_r_axis_config +{ + double _scale_resolution; + long _scale_count; // total scale count +}; + +//-------------------------------------------------------------------- +// +//-------------------------------------------------------------------- +struct struct_so7_machine +{ // g_machine structure + struct s_machine_config + { + wchar_t _str_servo_Id[16]; + wchar_t _str_model[16]; + wchar_t _str_model_nbr[16]; + wchar_t _str_serial_no[16]; + int _vector_light_model; + char _str_2b[64]; + BYTE _str_bin_2b[64]; + char _str_4c02_signature[64]; + BYTE _str_bin_4c02[64]; + char _str_6f00_signature[64]; + BYTE _str_bin_6f00[64]; + char _str_7000_signature[64]; + BYTE _str_bin_7000[64]; + int _usb_command_wait; + int _usb_command_timeout; + struct s_so7_axis_config x_axis; + struct s_so7_axis_config y_axis; + struct s_so7_axis_config z_axis; + struct s_so7_zm_axis_config zm_axis; + struct s_so7_r_axis_config r1_axis; + struct s_so7_r_axis_config r2_axis; + int _nbr_lamps; + double _dXYZSpeed; // this is not part of the MV original config data + } s_machine_config; + struct s_status + { + bool _homed; + bool _machine_running; + bool _poll_58_active; + bool _poll_59_active; + bool _poll_2b_active; + bool _bXMoving; + bool _bYMoving; + bool _bZMoving; + bool _bZMMoving; + bool _bXYZZMIdle; + } s_status; + union { + struct s_lights_300 // special data structure for 5x8 ring configuration + { + int _segment[FIVE_RINGS][EIGHT_SEGS]; + int _bottom_light; + int _axial_light; + } s_lights_300; + struct s_lights_200 // special data structure for 2x8 ring configuration + { + int _segment[TWO_RINGS][EIGHT_SEGS]; + int _bottom_light; + int _axial_light; + } s_lights_200; + }; + long _hit_pos_x; // touch probe + long _hit_pos_y; // touch probe + struct s_so7_axis x; + struct s_so7_axis y; + struct s_so7_axis z; + struct s_so7_axis zm; + struct s_so7_axis r1; + struct s_so7_axis r2; +}; + +#define SEVENOCEAN_VID 0x0d26 +#define SEVENOCEAN_PID 0x1001 + +//**************************************************************************************************** +// Binary SevenOcean command structure, out going +// +//**************************************************************************************************** +#define pSO7_CMD_01 ((s_SO7_CMD_BUFF_01 *) ep_buff[EP_01_CMD_IDX]._buffer) + +struct s_SO7_CMD_BUFF_01 +{ + UCHAR uCmdByte; + //---------------------------------------------------------------------- + // [endpoint 0x00000001] 00000060 : 530001010100fffe1d89ffff4d37fffebeee000000000000c34e0000021a0000003200000000000f423b000029fb0000138800000000003d08ee00030d4000030d40000000000000000000000000000000000000000000000000000000000000 + // *Command : 53 Move To -- X Y Z ZM Scale-0123511 -0045769 -0082194 00000000 + // *Speed : 00049998 00000538 00000050 00000000 + // *Unk1 : 00999995 00010747 00005000 00000000 + // *Unk2 : 03999982 00200000 00200000 00000000 + union + { + struct + { + BYTE uSubCmdByte; + char data[9]; + }S_SO7_CMD_MOVE_XYZ; + + }; +}; + +//====================== +typedef struct s_so7_xyzzm +{ + bool bFast; + long from; + long to; + long speed; + long acc; + long dec; + double dFromMM; + double dToMM; +} SO7AXISMOVE; +#pragma pack(pop) + +//====================== +struct struct_so7_ep_buff +{ + int _ep; + BYTE _save_send_cmd; + BYTE _save_send_cmd0; + BYTE _save_send_cmd1; + char *_buffer; // MAX_BUFF_SIZE + int _size; + void *_async_context; + BOOL _hProtoPending; + HANDLE _event; +}; + +//====================================================================================== +class CSO7_Proto +{ +public: + // EP 01/81 channel threads. + static int g_hEP81_Thread_State; + static unsigned __stdcall g_EP81_Thread(LPVOID pThis); + static HANDLE g_hEP81_Thread_Id; + + // EP 02/82 channel threads. + static int g_hEP82_Thread_State; + static unsigned __stdcall g_EP82_Thread(LPVOID pThis); + static HANDLE g_hEP82_Thread_Id; + // + // g_hEP01_Thread_Event is used to kick a command + // + static int g_hEP01_Thread_State; + static unsigned __stdcall g_EP01_Thread(LPVOID pThis); + static HANDLE g_hEP01_Thread_Id; + static HANDLE g_hEP01_Serial_Mutex; // EP01 + // + static int g_hEP02_Thread_State; + static unsigned __stdcall g_EP02_Thread(LPVOID pThis); + static HANDLE g_hEP02_Thread_Id; + static HANDLE g_hEP02_Serial_Mutex; // EP02 + + static HANDLE g_hHomedEvent; + + // + CSO7_Proto(); + virtual ~CSO7_Proto(); + + // Global Structures + static struct_so7_ep_buff ep_buff[lEPSIZE]; + static struct_so7_machine g_machine; + + + SSI_STATUS_MOTION Init_MvUsb(); + SSI_STATUS_MOTION Exit_MvUsb(); + SSI_STATUS_MOTION Load_SevenOcean_Config(); + SSI_STATUS_MOTION GetAppPath(CString &Path); + SSI_STATUS_MOTION ExtractAppPath(CString &Path); + + double ScaleToMM(long lCount, double dResolution); + long MMtoScale(double lDistanceMM, double dResolution); + static void Trace_EP_Buff(long lIndex); + + static double TimeInSecs(void); + static CLogger* g_pLogger; + static usb_dev_handle *g_dev; + + + static void _swap_byte(unsigned short &Val); + static void _reverse_dword(DWORD *); + static void _scale2inch(unsigned long scale, double &inch); + static void _inch2scale(unsigned long &scale, double inch); + static long _4char2long(unsigned char *cBuff); + static void _char2bin(unsigned char *cBuff, BYTE *cBytes, int len); + + bool m_bHomingActive; + + usb_dev_handle* _open_usb_dev(void); + + void so7_set_full_ringlight_data(long lIntensity); + void so7_set_ringlight_data(long lMaxSize, double *pSegments); + bool so7_motion_is_homed(); + + SSI_STATUS_MOTION _start_machine(); + SSI_STATUS_MOTION _shutdown_machine(); + SSI_STATUS_MOTION _do_single_threaded_usb_comm(int iEP); + SSI_STATUS_MOTION _submit_async_8x(int iEP_Base); + SSI_STATUS_MOTION _reap_async_8x(int iEP_Base); + SSI_STATUS_MOTION _send_usb_data(int iEP_Base); + + SSI_STATUS_MOTION _poll_machine_2b(); + //SSI_STATUS_MOTION _poll_machine_58(); + //SSI_STATUS_MOTION _poll_machine_59(); + //SSI_STATUS_MOTION _get_config(); + //SSI_STATUS_MOTION _get_xyz_index(); + SSI_STATUS_MOTION _replay_capture(CString cFileName); + SSI_STATUS_MOTION _process_replay_capture_commands(char *inBuff, FILE* pInFile); + SSI_STATUS_MOTION _calculate_straightline_motion(SO7AXISMOVE &X, SO7AXISMOVE &Y, SO7AXISMOVE &Z, double dSpeedMM); + SSI_STATUS_MOTION WaitForSettleXYZZM(); + //SSI_STATUS_MOTION _set_position_xyz(SO7AXISMOVE &X, SO7AXISMOVE &Y, SO7AXISMOVE &Z); + + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_X(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_Y(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_Z(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_ZM(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_RESET_XYZ(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_X(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_Y(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_Z(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_ZM(); + SSI_STATUS_MOTION _send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(); + + + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_X(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_Y(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_Z(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_ZM(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_RESET_XYZ(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_X(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_Y(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_Z(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_ZM(); + static SSI_STATUS_MOTION _process_SO7_CMD_MOVE_TO_POS_XYZ(); + + //========================================================================= + // Motion Related + //========================================================================= + SSI_STATUS_MOTION so7_motion_is_supported(); + SSI_STATUS_MOTION so7_motion_startup(double x_scale_resolution, double y_scale_resolution, double z_scale_resolution); + SSI_STATUS_MOTION so7_motion_get_axis_count(int &iCount); + SSI_STATUS_MOTION so7_motion_set_speed_xyz(double dSpeed); + SSI_STATUS_MOTION so7_motion_get_speed_xyz(double &dSpeed); + SSI_STATUS_MOTION so7_motion_set_speed_r(long r_speed); + SSI_STATUS_MOTION so7_motion_get_settle_time(); + SSI_STATUS_MOTION so7_motion_get_deadband(); + SSI_STATUS_MOTION so7_motion_get_refresh_deadband(); + SSI_STATUS_MOTION so7_motion_get_position_xyz(double &_dX, double &_dY, double &_dZ); + SSI_STATUS_MOTION so7_motion_set_position_xyz(double dX, double dY, double dZ, bool bWait); + SSI_STATUS_MOTION so7_motion_get_position_r(double &dPositionR); + //SSI_STATUS_MOTION so7_motion_set_position_r(double dPositionR); + SSI_STATUS_MOTION so7_motion_store_position_xyz(); + SSI_STATUS_MOTION so7_motion_get_stored_positions_xyz(); + SSI_STATUS_MOTION so7_motion_is_so7_axis_moving(); + SSI_STATUS_MOTION so7_motion_set_stage_limits(); + SSI_STATUS_MOTION so7_motion_get_stage_limits(); + SSI_STATUS_MOTION so7_motion_dcc_scan_start(); + SSI_STATUS_MOTION so7_motion_dcc_scan_get_data_size(); + SSI_STATUS_MOTION so7_motion_dcc_scan_get_data(); + //SSI_STATUS_MOTION so7_motion_Dcc_Home(); + SSI_STATUS_MOTION so7_motion_shut_down(); + SSI_STATUS_MOTION so7_motion_fly_mode_cancel(); + SSI_STATUS_MOTION so7_motion_get_axes_max_speed(double &dMaxSpeedX, double &dMaxSpeedY, double &dMaxSpeedZ); + SSI_STATUS_MOTION so7_motion_get_3D_max_speed(double &dMaxSpeed); + SSI_STATUS_MOTION so7_motion_get_position_meas_point(); + // + SSI_STATUS_MOTION so7_optics_is_supported(); + SSI_STATUS_MOTION so7_optics_start_up(); + SSI_STATUS_MOTION so7_optics_get_magnification_steps(int& iSteps); + SSI_STATUS_MOTION so7_optics_get_numeric_aperture(); + SSI_STATUS_MOTION so7_optics_get_magnification(int& iStep); + SSI_STATUS_MOTION so7_optics_set_magnification(int iStep); + SSI_STATUS_MOTION so7_optics_get_deadband(); + SSI_STATUS_MOTION so7_optics_get_scale_range(long &neg_scale_range, long &pos_scale_range); + SSI_STATUS_MOTION so7_optics_get_scale_position(long &lScale); + SSI_STATUS_MOTION so7_optics_set_scale_position(const long lScale); + SSI_STATUS_MOTION so7_optics_refresh_lens(); + SSI_STATUS_MOTION so7_optics_enable_grid(); + SSI_STATUS_MOTION so7_optics_is_grid_enabled(); + SSI_STATUS_MOTION so7_optics_enable_laser(); + SSI_STATUS_MOTION so7_optics_is_laser_enabled(); + SSI_STATUS_MOTION so7_optics_shut_down(); + // + SSI_STATUS_MOTION so7_light_is_supported(BOOL &bTrue); + SSI_STATUS_MOTION so7_light_start_up(); + SSI_STATUS_MOTION so7_light_get_lamp_count(int& iCount); + SSI_STATUS_MOTION so7_light_get_lamp_info(); + SSI_STATUS_MOTION so7_light_set_lamp_state(double dBottomPercent, double dTopPercent); + SSI_STATUS_MOTION so7_light_shut_down(); + SSI_STATUS_MOTION so7_light_set_light(); + SSI_STATUS_MOTION so7_light_set_light_off(); + + SSI_STATUS_MOTION so7_pendant_enable(BOOL bTrue); + static void _process_rcv_transfer_data(int iEP); +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.cpp new file mode 100644 index 0000000..16c3e49 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.cpp @@ -0,0 +1,704 @@ +// SO7_Send_Parameter.cpp : implementation file +// +#include "stdafx.h" +#include +#include "afxdialogex.h" +#include "resource.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "DrawGraph.h" +#include "ProcessButton.h" +#include "SO7_UtilDlg.h" +#include "SO7_Send_Parameter.h" +extern CSO7_Proto* m_pSO7_Proto; + +//#include "INIFile.h" + +// CSO7_Send_Parameter dialog + +IMPLEMENT_DYNAMIC(CSO7_Send_Parameter, CDialog) + + CSO7_Send_Parameter::CSO7_Send_Parameter(CWnd* pParent /*=NULL*/) + : CDialog(CSO7_Send_Parameter::IDD, pParent) +{ + m_dbStartX=0.0; + m_dbEndX=10; + m_dbStartY=0.0; + m_dbEndY=10; + m_nDivisionX=10; + m_nDivisionY=10; + m_dPos=0.0; + m_StartPos=0.0; + m_dMoveDis=0.0; + m_SampleTime=0; + m_TimerInterval=10; + m_dbResolutionX=1.0; + m_dbResolutionY=1.0; + nCount=0; + m_StartTime=0; + m_FinishTime=0; + m_duration=0.0; +} +//================================================================ +CSO7_Send_Parameter::~CSO7_Send_Parameter() +{ + +} +//================================================================ +void CSO7_Send_Parameter::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + + DDX_Text(pDX, IDC_EDIT_BASESPEED_X1, m_csBaseSpeedX[0]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_X1, m_csMaxSpeedX[0]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_X1, m_csStartSpeedX[0]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_X1, m_csFreshSpeedX[0]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_X1, m_csSlowDisX[0]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_X2, m_csBaseSpeedX[1]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_X2, m_csMaxSpeedX[1]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_X2, m_csStartSpeedX[1]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_X2, m_csFreshSpeedX[1]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_X2, m_csSlowDisX[1]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_X3, m_csBaseSpeedX[2]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_X3, m_csMaxSpeedX[2]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_X3, m_csStartSpeedX[2]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_X3, m_csFreshSpeedX[2]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_X3, m_csSlowDisX[2]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_X4, m_csBaseSpeedX[3]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_X4, m_csMaxSpeedX[3]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_X4, m_csStartSpeedX[3]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_X4, m_csFreshSpeedX[3]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_X4, m_csSlowDisX[3]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_X5, m_csBaseSpeedX[4]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_X5, m_csMaxSpeedX[4]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_X5, m_csStartSpeedX[4]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_X5, m_csFreshSpeedX[4]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_X5, m_csSlowDisX[4]); + + DDX_Text(pDX, IDC_EDIT_BASESPEED_Y1, m_csBaseSpeedY[0]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Y1, m_csMaxSpeedY[0]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Y1, m_csStartSpeedY[0]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Y1, m_csFreshSpeedY[0]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Y1, m_csSlowDisY[0]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Y2, m_csBaseSpeedY[1]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Y2, m_csMaxSpeedY[1]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Y2, m_csStartSpeedY[1]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Y2, m_csFreshSpeedY[1]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Y2, m_csSlowDisY[1]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Y3, m_csBaseSpeedY[2]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Y3, m_csMaxSpeedY[2]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Y3, m_csStartSpeedY[2]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Y3, m_csFreshSpeedY[2]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Y3, m_csSlowDisY[2]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Y4, m_csBaseSpeedY[3]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Y4, m_csMaxSpeedY[3]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Y4, m_csStartSpeedY[3]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Y4, m_csFreshSpeedY[3]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Y4, m_csSlowDisY[3]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Y5, m_csBaseSpeedY[4]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Y5, m_csMaxSpeedY[4]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Y5, m_csStartSpeedY[4]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Y5, m_csFreshSpeedY[4]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Y5, m_csSlowDisY[4]); + + + DDX_Text(pDX, IDC_EDIT_BASESPEED_Z1, m_csBaseSpeedZ[0]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Z1, m_csMaxSpeedZ[0]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Z1, m_csStartSpeedZ[0]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Z1, m_csFreshSpeedZ[0]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Z1, m_csSlowDisZ[0]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Z2, m_csBaseSpeedZ[1]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Z2, m_csMaxSpeedZ[1]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Z2, m_csStartSpeedZ[1]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Z2, m_csFreshSpeedZ[1]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Z2, m_csSlowDisZ[1]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Z3, m_csBaseSpeedZ[2]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Z3, m_csMaxSpeedZ[2]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Z3, m_csStartSpeedZ[2]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Z3, m_csFreshSpeedZ[2]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Z3, m_csSlowDisZ[2]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Z4, m_csBaseSpeedZ[3]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Z4, m_csMaxSpeedZ[3]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Z4, m_csStartSpeedZ[3]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Z4, m_csFreshSpeedZ[3]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Z4, m_csSlowDisZ[3]); + DDX_Text(pDX, IDC_EDIT_BASESPEED_Z5, m_csBaseSpeedZ[4]); + DDX_Text(pDX, IDC_EDIT_MAXSPEED_Z5, m_csMaxSpeedZ[4]); + DDX_Text(pDX, IDC_EDIT_STARTSPEED_Z5, m_csStartSpeedZ[4]); + DDX_Text(pDX, IDC_EDIT_FRESHSPEED_Z5, m_csFreshSpeedZ[4]); + DDX_Text(pDX, IDC_EDIT_SLOWDIS_Z5, m_csSlowDisZ[4]); + + DDX_Text(pDX, IDC_EDIT_WHEELBASE_X, m_csWheelbaseX); + DDX_Text(pDX, IDC_EDIT_WHEELBASE_Y, m_csWheelbaseY); + DDX_Text(pDX, IDC_EDIT_WHEELBASE_Z, m_csWheelbaseZ); + DDX_Text(pDX, IDC_EDIT_WHEELBASE_PULSENUM,m_csPulseNum); + + DDX_Text(pDX, IDC_EDIT_PRECISION_X, m_csPercisionX); + DDX_Text(pDX, IDC_EDIT_PRECISION_Y, m_csPercisionY); + DDX_Text(pDX, IDC_EDIT_PRECISION_Z, m_csPercisionZ); + + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_X, m_csNegWorkLimitX); + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_Y, m_csNegWorkLimitY); + DDX_Text(pDX, IDC_EDIT_NEG_WORKLIMIT_Z, m_csNegWorkLimitZ); + + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_X, m_csPosWorkLimitX); + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_Y, m_csPosWorkLimitY); + DDX_Text(pDX, IDC_EDIT_POS_WORKLIMIT_Z, m_csPosWorkLimitZ); + + DDX_Control(pDX, IDC_CUSTOM_CANVAS, m_DrawGraph); + DDX_Control(pDX, IDC_EDIT_SET_PARAMETER_MSGOUTPUT, m_edMSG); +} + + +//================================================================ +BEGIN_MESSAGE_MAP(CSO7_Send_Parameter, CDialog) + ON_WM_TIMER() + ON_WM_PAINT() + ON_WM_ERASEBKGND() + ON_BN_CLICKED(IDOK, &CSO7_Send_Parameter::OnBnClickedOk) + ON_BN_CLICKED(IDC_BUTTON_BROWSE, &CSO7_Send_Parameter::OnBnClickedButtonBrowse) + ON_BN_CLICKED(IDC_BUTTON_SAVE_PARAMETER, &CSO7_Send_Parameter::OnBnClickedButtonSaveParameter) + ON_BN_CLICKED(IDC_BUTTON_SAVE, &CSO7_Send_Parameter::OnBnClickedButtonSave) + ON_BN_CLICKED(IDC_BUTTON_READ_PARAMETER_FROM_CONTROLLER, &CSO7_Send_Parameter::OnBnClickedButtonReadParameterFromController) + ON_EN_KILLFOCUS(IDC_EDIT_SAMPLE_SCURVE_DIS, &CSO7_Send_Parameter::OnEnKillfocusEditSampleScurveDis) + ON_EN_KILLFOCUS(IDC_EDIT_SAMPLE_TIME_SCURVE, &CSO7_Send_Parameter::OnEnKillfocusEditSampleTimeScurve) + ON_BN_CLICKED(IDC_BUTTON_START_SAMPLE_SCURVE, &CSO7_Send_Parameter::OnBnClickedButtonStartSampleScurve) + ON_BN_CLICKED(IDC_BUTTON_STOP_SAMPLE_SCURVE, &CSO7_Send_Parameter::OnBnClickedButtonStopSampleScurve) + ON_BN_CLICKED(IDC_RADIO_CANVAS_SPEED_TIME, &CSO7_Send_Parameter::OnBnClickedRadioCanvasSpeedTime) +END_MESSAGE_MAP() + + +// CSO7_Send_Parameter message handlers +BOOL CSO7_Send_Parameter::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + // ״̬ + m_StatusBar.Create(WS_CHILD|WS_VISIBLE|SBS_SIZEGRIP, CRect(0, 0, 0, 0), this, 101); + m_StatusBar.SetBkColor(RGB(0xff, 0xff, 0x00));//0xa6, 0xca, 0xf0 + int arWidth[] = {500, -1 }; + m_StatusBar.SetParts(1, arWidth); + m_StatusBar.SetText(_T("INIĵ ӿжȡȷPulseNo.ȷ"), 0, 0); + GetDlgItem(IDC_BUTTON_BROWSE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVE_PARAMETER)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_READ_PARAMETER_FROM_CONTROLLER)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SAVE)->EnableWindow(true); + ShowParameterOnEdit(); + m_DrawGraph.SetGraphyView(0, 100, -10, 10); + ((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_X))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Y))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Z))->SetCheck(false); + + ((CButton *)GetDlgItem(IDC_RADIO_CANVAS_POSTION_TIME))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_CANVAS_SPEED_TIME))->SetCheck(false); + return TRUE; // return TRUE unless you set the focus to a control +} + +//================================================================ +void CSO7_Send_Parameter::OnPaint() +{ + CPaintDC dc(this); // device context for painting + OnDraw(&dc); + CDialog::OnPaint(); +} +//================================================================ +void CSO7_Send_Parameter::OnBnClickedOk() +{ + KillTimer(1); + CDialog::OnOK(); +} +//================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonBrowse() +{ + // TODO: Add your control notification handler code here + m_csIniFile = "Utility_Config.ini"; + CFileDialog fileDialog(TRUE, _T("*.ini"),(LPCTSTR) m_csIniFile, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, _T("INI files (*.ini)|*.ini||"), this); + + if ( fileDialog.DoModal ()==IDOK ) + { + m_csIniFile = fileDialog.GetPathName(); + GetDlgItem(IDC_EDIT_INPUT_FILE)->SetWindowText(m_csIniFile); + m_pSO7_Proto->Load_SevenOcean_Inifile(m_csIniFile); + ShowParameterOnEdit(); + m_StatusBar.SetText(_T("ʾǰINIĵ"), 0, 0); + } + delete fileDialog; +} + +//================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonSaveParameter() +{ + ChangeParameterOnEdit(); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,0); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,1); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,2); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,3); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(0,4); + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,0); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,1); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,2); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,3); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(1,4); + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,0); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,1); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,2); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,3); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PARAMETER(2,4); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PRECISION(0); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PRECISION(1); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SPEED_PRECISION(2); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_MOTOR_SPEED_WHEELBASE_PARAMETER(); + m_StatusBar.SetText(_T("˶õС"), 0, 0); +} + +//================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonSave() +{ + // TODO: Add your control notification handler code here + CString CTmpString; + CString PathName; + CString path_and_fileName; + + PathName=_T("Utility_Config.ini"); + CString szFilter=_T("INI Files(*.ini)|*.ini|ALL Files(*.*)|*.*||"); + CFileDialog fdlg(FALSE,_T("INI"),PathName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + + if( fdlg.DoModal()==IDOK) + { + path_and_fileName=fdlg.GetPathName(); + ChangeParameterOnEdit(); + m_pSO7_Proto->Save_SevenOcean_Inifile(path_and_fileName); + CTmpString=_T("ѱ[")+path_and_fileName+_T("]."); + m_StatusBar.SetText(CTmpString, 0, 0); + } + delete fdlg; +} + +//================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonReadParameterFromController() +{ + // TODO: Add your control notification handler code here + ChangeParameterOnEdit(); + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 0, 0); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 0, 1); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 0, 2); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 0, 3); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 0, 4); + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 1, 0); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 1, 1); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 1, 2); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 1, 3); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 1, 4); + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 2, 0); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 2, 1); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 2, 2); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 2, 3); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PARAMETER( 2, 4); + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PRECISION(0); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PRECISION(1); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_SPEED_PRECISION(2); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_MOTOR_SPEED_WHEELBASE_PARAMETER(); + + ShowParameterOnEdit(); + m_StatusBar.SetText(_T("˶Ѵӿж"), 0, 0); +} + +//================================================================ +void CSO7_Send_Parameter::ChangeParameterOnEdit() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cSpeedX; + const char* cSpeedY; + const char* cSpeedZ; + const char* cTemp; + + for(INT i=0;i<5;i++) + { + cSpeedX=T2A(m_csBaseSpeedX[i]); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_base[i]=static_cast(atoi(cSpeedX)); + cSpeedX=T2A(m_csMaxSpeedX[i]); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_max[i]=static_cast(atoi(cSpeedX)); + cSpeedX=T2A(m_csStartSpeedX[i]); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_start[i]=static_cast(atoi(cSpeedX)); + cSpeedX=T2A(m_csFreshSpeedX[i]); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_fresh[i]=static_cast(atoi(cSpeedX)); + cSpeedX=T2A(m_csSlowDisX[i]); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_slow_dis[i]=(atof(cSpeedX)); + + cSpeedY=T2A(m_csBaseSpeedY[i]); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_base[i]=static_cast(atoi(cSpeedY)); + cSpeedY=T2A(m_csMaxSpeedY[i]); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_max[i]=static_cast(atoi(cSpeedY)); + cSpeedY=T2A(m_csStartSpeedY[i]); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_start[i]=static_cast(atoi(cSpeedY)); + cSpeedY=T2A(m_csFreshSpeedY[i]); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_fresh[i]=static_cast(atoi(cSpeedY)); + cSpeedY=T2A(m_csSlowDisY[i]); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_slow_dis[i]=(atof(cSpeedY)); + + cSpeedZ=T2A(m_csBaseSpeedZ[i]); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_base[i]=static_cast(atoi(cSpeedZ)); + cSpeedZ=T2A(m_csMaxSpeedZ[i]); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_max[i]=static_cast(atoi(cSpeedZ)); + cSpeedZ=T2A(m_csStartSpeedZ[i]); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_start[i]=static_cast(atoi(cSpeedZ)); + cSpeedZ=T2A(m_csFreshSpeedZ[i]); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_fresh[i]=static_cast(atoi(cSpeedZ)); + cSpeedZ=T2A(m_csSlowDisZ[i]); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_slow_dis[i]=(atof(cSpeedZ)); + } + cTemp=T2A(m_csWheelbaseX); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._motor_wheelbase=(atof(cTemp)); + cTemp=T2A(m_csWheelbaseY); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._motor_wheelbase=(atof(cTemp)); + cTemp=T2A(m_csWheelbaseZ); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._motor_wheelbase=(atof(cTemp)); + cTemp=T2A(m_csPulseNum); + m_pSO7_Proto->g_machine._motor_pulse_num=(atoi(cTemp)); + + cTemp=T2A(m_csPercisionX); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._motor_precision=(atof(cTemp)); + cTemp=T2A(m_csPercisionY); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._motor_precision=(atof(cTemp)); + cTemp=T2A(m_csPercisionZ); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._motor_precision=(atof(cTemp)); + + cTemp=T2A(m_csNegWorkLimitX); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._neg_working_limit=(atof(cTemp)); + cTemp=T2A(m_csNegWorkLimitY); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._neg_working_limit=(atof(cTemp)); + cTemp=T2A(m_csNegWorkLimitZ); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._neg_working_limit=(atof(cTemp)); + + cTemp=T2A(m_csPosWorkLimitX); + m_pSO7_Proto->g_machine.s_machine_config.x_axis._pos_working_limit=(atof(cTemp)); + cTemp=T2A(m_csPosWorkLimitY); + m_pSO7_Proto->g_machine.s_machine_config.y_axis._pos_working_limit=(atof(cTemp)); + cTemp=T2A(m_csPosWorkLimitZ); + m_pSO7_Proto->g_machine.s_machine_config.z_axis._pos_working_limit=(atof(cTemp)); + +} + +//================================================================ +void CSO7_Send_Parameter::ShowParameterOnEdit() +{ + for(INT i=0;i<5;i++) + { + m_csBaseSpeedX[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_base[i])); + m_csMaxSpeedX[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_max[i])); + m_csStartSpeedX[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_start[i])); + m_csFreshSpeedX[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_fresh[i])); + m_csSlowDisX[i].Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._speed_slow_dis[i])); + + m_csBaseSpeedY[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_base[i])); + m_csMaxSpeedY[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_max[i])); + m_csStartSpeedY[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_start[i])); + m_csFreshSpeedY[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_fresh[i])); + m_csSlowDisY[i].Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._speed_slow_dis[i])); + + m_csBaseSpeedZ[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_base[i])); + m_csMaxSpeedZ[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_max[i])); + m_csStartSpeedZ[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_start[i])); + m_csFreshSpeedZ[i].Format(_T("%d"),static_cast(m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_fresh[i])); + m_csSlowDisZ[i].Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._speed_slow_dis[i])); + } + m_csWheelbaseX.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._motor_wheelbase)); + m_csWheelbaseY.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._motor_wheelbase)); + m_csWheelbaseZ.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._motor_wheelbase)); + m_csPulseNum.Format(_T("%d"),(m_pSO7_Proto->g_machine._motor_pulse_num)); + + m_csPercisionX.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._motor_precision)); + m_csPercisionY.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._motor_precision)); + m_csPercisionZ.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._motor_precision)); + + m_csNegWorkLimitX.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._neg_working_limit)); + m_csNegWorkLimitY.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._neg_working_limit)); + m_csNegWorkLimitZ.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._neg_working_limit)); + + m_csPosWorkLimitX.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._pos_working_limit)); + m_csPosWorkLimitY.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._pos_working_limit)); + m_csPosWorkLimitZ.Format(_T("%.3f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._pos_working_limit)); + + UpdateData(FALSE); +} + +//================================================================ +void CSO7_Send_Parameter::OnDraw(CDC* pDC) +{ + UNREFERENCED_PARAMETER(pDC); + //CWnd* m_p=(CWnd*)GetDlgItem(IDC_STATIC_CANVAS); + //m_p->GetWindowRect(&CanvasRect); + //CanvasRect.SetRect(550,50,1100,600);//L T R B + +}; + + +//================================================================================================ +void CSO7_Send_Parameter::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + switch(nIDEvent) + { + case 1: + { + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_AXIS_XYZ(); + + if(((CButton *)GetDlgItem(IDC_RADIO_CANVAS_POSTION_TIME))->GetCheck()) + { + if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_X))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.x._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(m_pSO7_Proto->g_machine.x._d_cur_pos_); + if((abs(m_pSO7_Proto->g_machine.x._d_cur_pos_)-abs(m_dPos))<0.0) + { + m_csMSG.Format(_T("X Reverse;%f->%f!!!"),m_dPos,m_pSO7_Proto->g_machine.x._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + else + { + m_csMSG.Format(_T("X Normal;%f->%f"),m_dPos,m_pSO7_Proto->g_machine.x._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + m_dPos=m_pSO7_Proto->g_machine.x._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Y))->GetCheck()) + { + m_pSO7_Proto->g_machine.y._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.y._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(m_pSO7_Proto->g_machine.y._d_cur_pos_); + if((abs(m_pSO7_Proto->g_machine.y._d_cur_pos_)-abs(m_dPos))<0.0) + { + m_csMSG.Format(_T("Y Reverse;%f->%f!!!"),m_dPos,m_pSO7_Proto->g_machine.y._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + else + { + m_csMSG.Format(_T("Y Normal;%f->%f"),m_dPos,m_pSO7_Proto->g_machine.y._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + m_dPos=m_pSO7_Proto->g_machine.y._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Z))->GetCheck()) + { + m_pSO7_Proto->g_machine.z._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.z._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(m_pSO7_Proto->g_machine.z._d_cur_pos_); + if((abs(m_pSO7_Proto->g_machine.z._d_cur_pos_)-abs(m_dPos))<0.0) + { + m_csMSG.Format(_T("Z Reverse;%f->%f!!!"),m_dPos,m_pSO7_Proto->g_machine.z._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + else + { + m_csMSG.Format(_T("Z Normal;%f->%f"),m_dPos,m_pSO7_Proto->g_machine.z._d_cur_pos_); + OutputWithScroll(m_csMSG,m_edMSG); + } + m_dPos=m_pSO7_Proto->g_machine.z._d_cur_pos_; + } + + if(nCount!=0) + {if (abs(m_dataGraph.ElementAt(nCount)-m_dataGraph.ElementAt(nCount-1))<0.000001) + { + m_DrawGraph.LoadGraphyData(m_dataGraph); + KillTimer(1); + }} + } + else + { + if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_X))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.x._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(static_cast(((1000.0*(fabs(m_pSO7_Proto->g_machine.x._d_cur_pos_-m_dPos)))/m_duration))); + m_dPos=m_pSO7_Proto->g_machine.x._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Y))->GetCheck()) + { + m_pSO7_Proto->g_machine.y._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.y._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(static_cast(1000.0*(fabs(m_pSO7_Proto->g_machine.y._d_cur_pos_-m_dPos)/m_duration))); + m_dPos=m_pSO7_Proto->g_machine.y._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Z))->GetCheck()) + { + m_pSO7_Proto->g_machine.z._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.z._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_FinishTime=clock(); + m_duration=m_FinishTime-m_StartTime; + m_dataGraph.Add(static_cast(1000.0*(fabs(m_pSO7_Proto->g_machine.z._d_cur_pos_-m_dPos)/m_duration))); + m_dPos=m_pSO7_Proto->g_machine.z._d_cur_pos_; + } + + if (m_dataGraph.ElementAt(nCount)>=-0.005 && m_dataGraph.ElementAt(nCount)<=0.005) + { + m_DrawGraph.LoadGraphyData(m_dataGraph); + KillTimer(1); + } + + } + + nCount++; + m_StartTime=clock(); + } + } + break; + } + } + + CDialog::OnTimer(nIDEvent); +} + +//================================================================================================ +void CSO7_Send_Parameter::OnEnKillfocusEditSampleScurveDis() +{ + CString str; + UpdateData(TRUE); + USES_CONVERSION; + + GetDlgItem(IDC_EDIT_SAMPLE_SCURVE_DIS)->GetWindowText(str); + const char* cTempValue=T2A(str); + + m_dMoveDis = atof(cTempValue); + +} + +//================================================================================================ +void CSO7_Send_Parameter::OnEnKillfocusEditSampleTimeScurve() +{ + CString str; + UpdateData(TRUE); + USES_CONVERSION; + + GetDlgItem(IDC_EDIT_SAMPLE_TIME_SCURVE)->GetWindowText(str); + const char* cTempValue=T2A(str); + + m_SampleTime = atof(cTempValue); +} + +//================================================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonStartSampleScurve() +{ + m_pSO7_Proto->g_machine.x._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.y._pos_fixed._long_=0; + m_pSO7_Proto->g_machine.z._pos_fixed._long_=0; + if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_X))->GetCheck()) + { + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dMoveDis,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_dPos=m_pSO7_Proto->g_machine.x._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Y))->GetCheck()) + { + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dMoveDis,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_dPos=m_pSO7_Proto->g_machine.y._d_cur_pos_; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_SAMPLE_Z))->GetCheck()) + { + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(m_dMoveDis,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_dPos=m_pSO7_Proto->g_machine.z._d_cur_pos_; + } + + m_dbStartX=0; + m_dbEndX=m_SampleTime; + if(((CButton *)GetDlgItem(IDC_RADIO_CANVAS_POSTION_TIME))->GetCheck()) + { + m_dbStartY=0; + m_dbEndY=50; + m_dbResolutionX=static_cast(m_TimerInterval/(m_dbEndX*1000.0));//ÿһβʱӦXij + m_dbResolutionY=static_cast(1/m_dbEndY); + m_nDivisionX=10; + m_nDivisionY=10; + } + else + { + m_dbStartY=0; + m_dbEndY=50; + m_dbResolutionX=static_cast(m_TimerInterval/(m_dbEndX*1000.0));//ÿһβʱӦXij + m_dbResolutionY=static_cast(1/m_dbEndY); + m_nDivisionX=10; + m_nDivisionY=10; + } + + + nCount=0; + m_dataGraph.RemoveAll(); + m_DrawGraph.SetGraphyView(m_dbStartX,m_dbEndX,m_dbStartY,m_dbEndY,m_nDivisionX,m_nDivisionY); + m_DrawGraph.SetResolution(m_dbResolutionX,m_dbResolutionY); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + SetTimer(1,m_TimerInterval,NULL); + m_StartTime=clock(); +} + +//================================================================================================ +void CSO7_Send_Parameter::OnBnClickedButtonStopSampleScurve() +{ + KillTimer(1); +} + +//================================================================================================ +BOOL CSO7_Send_Parameter::OnEraseBkgnd(CDC* pDC) +{ + //UNREFERENCED_PARAMETER(pDC); + //return TRUE; + return CDialog::OnEraseBkgnd(pDC); +} + +void CSO7_Send_Parameter::OnBnClickedRadioCanvasSpeedTime() +{ + // TODO: Add your control notification handler code here +} + +//===================================================================================== +//Print message on edit control +void CSO7_Send_Parameter::OutputWithScroll(const CString &strNewText,CEdit &edtOutput) +{ + CString strOutput; + edtOutput.GetWindowText(strOutput); + strOutput += strNewText; + if ("\r\n" != strOutput.Right(2)) + { + strOutput += "\r\n"; + } + + int iCount = strOutput.GetLength(); + + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strOutput); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); +} \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.h new file mode 100644 index 0000000..746a51c --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_Send_Parameter.h @@ -0,0 +1,98 @@ + + +#pragma once + + +// CSO7_Send_Parameter dialog + +class CSO7_Send_Parameter : public CDialog +{ + DECLARE_DYNAMIC(CSO7_Send_Parameter) + +public: + CSO7_Send_Parameter(CWnd* pParent = NULL); // standard constructor + virtual ~CSO7_Send_Parameter(); + +// Dialog Data + enum { IDD = IDD_S07_UTIL_SEND_PARAMETER }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnPaint(); + void OnDraw(CDC* pDC); + afx_msg BOOL OnEraseBkgnd(CDC* pDC); + DECLARE_MESSAGE_MAP() + +public: + clock_t m_StartTime, m_FinishTime; + double m_duration; + CString m_csMSG; + CEdit m_edMSG; + DataBuff m_dataGraph; + CDrawGraph m_DrawGraph; + double m_dbStartX,m_dbEndX,m_dbStartY,m_dbEndY; + int m_nDivisionX,m_nDivisionY; + int nCount; + double m_StartPos,m_dPos,m_dMoveDis; + double m_SampleTime; + int m_TimerInterval; + double m_dbResolutionX,m_dbResolutionY; + CRect CanvasRect; +public: + CString m_csBaseSpeedX[5]; + CString m_csMaxSpeedX[5]; + CString m_csStartSpeedX[5]; + CString m_csFreshSpeedX[5]; + CString m_csSlowDisX[5]; + + CString m_csBaseSpeedY[5]; + CString m_csMaxSpeedY[5]; + CString m_csStartSpeedY[5]; + CString m_csFreshSpeedY[5]; + CString m_csSlowDisY[5]; + + CString m_csBaseSpeedZ[5]; + CString m_csMaxSpeedZ[5]; + CString m_csStartSpeedZ[5]; + CString m_csFreshSpeedZ[5]; + CString m_csSlowDisZ[5]; + + CString m_csWheelbaseX; + CString m_csWheelbaseY; + CString m_csWheelbaseZ; + CString m_csPulseNum; + + CString m_csPercisionX; + CString m_csPercisionY; + CString m_csPercisionZ; + + CString m_csNegWorkLimitX; + CString m_csNegWorkLimitY; + CString m_csNegWorkLimitZ; + + CString m_csPosWorkLimitX; + CString m_csPosWorkLimitY; + CString m_csPosWorkLimitZ; + + + CStatusBarCtrl m_StatusBar; + + void ShowParameterOnEdit(); + void ChangeParameterOnEdit(); + + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedButtonBrowse(); + CString m_csIniFile; + CString m_IniFile; + afx_msg void OnBnClickedButtonSaveParameter(); + afx_msg void OnBnClickedButtonSave(); + afx_msg void OnBnClickedButtonReadParameterFromController(); + afx_msg void OnEnKillfocusEditSampleScurveDis(); + afx_msg void OnEnKillfocusEditSampleTimeScurve(); + afx_msg void OnBnClickedButtonStartSampleScurve(); + afx_msg void OnBnClickedButtonStopSampleScurve(); + afx_msg void OnBnClickedRadioCanvasSpeedTime(); + void OutputWithScroll(const CString &strNewText,CEdit &edtOutput); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.cpp new file mode 100644 index 0000000..a57dd27 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.cpp @@ -0,0 +1,1055 @@ +#include "stdafx.h" +#include "afxwin.h" +#include "resource.h" +#include "afxdialogex.h" +#include "..\..\..\SevenOcean\CMMIO_SERIAL.H" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "ProcessButton.h" +#include "DrawGraph.h" +#include "SO7_Send_Parameter.h" +#include "SO7_Automatic_Zoom.h" +#include "SO7_Move_Location.h" +#include "Setup_so7config.h" +#include "SO7_VolComp.h" +#include "SO7_UtilDlg.h" +// CSO7_UtilDlg Ի +extern CSO7_Proto* m_pSO7_Proto; +CSerial* m_pSO7_Serial=NULL; +CLogger* g_pLoggerDebug=NULL; +CSO7_VolComp* g_pVolComp=NULL; + +IMPLEMENT_DYNAMIC(CSO7_UtilDlg, CDialog) + + CSO7_UtilDlg::CSO7_UtilDlg(CWnd* pParent /*=NULL*/) + : CDialog(CSO7_UtilDlg::IDD, pParent) +{ + +} + +CSO7_UtilDlg::~CSO7_UtilDlg() +{ +} + +void CSO7_UtilDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT_X_AXIS, m_X_Pos); + DDX_Text(pDX, IDC_EDIT_Y_AXIS, m_Y_Pos); + DDX_Text(pDX, IDC_EDIT_Z_AXIS, m_Z_Pos); + DDX_Text(pDX, IDC_EDIT_ZM_AXIS, m_Zm_Pos); + + DDX_Text(pDX, IDC_EDIT_AXIAL_LIGHT, m_csTop_Light_Value); + DDX_Text(pDX, IDC_EDIT_BOTTOM_LIGHT, m_csBom_Light_Value); + DDX_Text(pDX, IDC_EDIT_RING_LIGHT, m_csFan_Light_Value); + DDX_Text(pDX, IDC_EDIT_COAXIAL_LIGHT, m_csBom1_Light_Value); + DDX_Text(pDX, IDC_EDIT_COAXIAL_LIGHT2, m_csBom2_Light_Value); + DDX_Text(pDX, IDC_EDIT_COAXIAL_LIGHT3, m_csFan1_Light_Switch); + DDX_Text(pDX, IDC_EDIT_COAXIAL_LIGHT4, m_csFan2_Light_Switch); + + DDX_Text(pDX, IDC_EDIT_LIGHT_SIZE_VALUE,m_cs_Light_Size_Value); + DDX_Text(pDX, IDC_EDIT_LIGHT_SWITCH, m_cs_Light_Switch); + DDX_Text(pDX, IDC_EDIT_SET_VER_NO, m_cs_Version_Number); + + DDX_Text(pDX, IDC_EDIT_X_SCALE_COEFFICIENT, m_cs_XScaleCoeff); + DDX_Text(pDX, IDC_EDIT_Y_SCALE_COEFFICIENT, m_cs_YScaleCoeff); + DDX_Text(pDX, IDC_EDIT_Z_SCALE_COEFFICIENT, m_cs_ZScaleCoeff); + + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_X_LEFT, m_Button_MoveX_Left); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_X_RIGHT, m_Button_MoveX_Right); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_Y_FRONT, m_Button_MoveY_Front); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_Y_BACK, m_Button_MoveY_Back); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_Z_UP, m_Button_MoveZ_Up); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_Z_DOWN, m_Button_MoveZ_Down); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_ZOOM_IN, m_Button_MoveV_Zoom_In); + DDX_Control(pDX, IDC_BUTTON_SO7_MOVE_ZOOM_OUT, m_Button_MoveV_Zoom_Out); + +} + + +BEGIN_MESSAGE_MAP(CSO7_UtilDlg, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BUTTON_START_SO7MACHINE, &CSO7_UtilDlg::OnBnClickedButtonStartSo7machine) + ON_BN_CLICKED(IDCANCEL, &CSO7_UtilDlg::OnBnClickedCancel) + ON_BN_CLICKED(IDC_BUTTON_STOP_SO7MACHINE, &CSO7_UtilDlg::OnBnClickedButtonStopSo7machine) + ON_BN_CLICKED(IDC_BUTTON_SO7_RESET_XYZ, &CSO7_UtilDlg::OnBnClickedButtonSo7ResetXyz) + ON_BN_CLICKED(IDC_BUTTON_MOVE_TO, &CSO7_UtilDlg::OnBnClickedButtonMoveTo) + ON_BN_CLICKED(IDC_BUTTON_SO7_READ_AXIS_XYZ, &CSO7_UtilDlg::OnBnClickedButtonSo7ReadAxisXyz) + ON_BN_CLICKED(IDC_RADIO_SPEED_GEAR1, &CSO7_UtilDlg::OnBnClickedRadioSpeedGear1) + ON_BN_CLICKED(IDC_RADIO_SPEED_GEAR2, &CSO7_UtilDlg::OnBnClickedRadioSpeedGear2) + ON_BN_CLICKED(IDC_RADIO_SPEED_GEAR3, &CSO7_UtilDlg::OnBnClickedRadioSpeedGear3) + ON_BN_CLICKED(IDC_RADIO_SPEED_GEAR4, &CSO7_UtilDlg::OnBnClickedRadioSpeedGear4) + ON_BN_CLICKED(IDC_BUTTON_READ_PROBE, &CSO7_UtilDlg::OnBnClickedButtonReadProbe) + ON_BN_CLICKED(IDC_BUTTON_SO7_READ_AXIS_V, &CSO7_UtilDlg::OnBnClickedButtonSo7ReadAxisV) + ON_BN_CLICKED(IDC_BUTTON_SO7_GET_RESET_FLAG, &CSO7_UtilDlg::OnBnClickedButtonSo7GetResetFlag) + ON_EN_KILLFOCUS(IDC_EDIT_AXIAL_LIGHT, &CSO7_UtilDlg::OnEnKillfocusEditAxialLight) + ON_EN_KILLFOCUS(IDC_EDIT_BOTTOM_LIGHT, &CSO7_UtilDlg::OnEnKillfocusEditBottomLight) + ON_EN_KILLFOCUS(IDC_EDIT_RING_LIGHT, &CSO7_UtilDlg::OnEnKillfocusEditRingLight) + ON_EN_KILLFOCUS(IDC_EDIT_COAXIAL_LIGHT, &CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight) + ON_EN_KILLFOCUS(IDC_EDIT_LIGHT_SIZE_VALUE, &CSO7_UtilDlg::OnEnKillfocusEditLightSizeValue) + ON_EN_KILLFOCUS(IDC_EDIT_LIGHT_SWITCH, &CSO7_UtilDlg::OnEnKillfocusEditLightSwitch) + ON_EN_KILLFOCUS(IDC_EDIT_COAXIAL_LIGHT2, &CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight2) + ON_EN_KILLFOCUS(IDC_EDIT_COAXIAL_LIGHT3, &CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight3) + ON_EN_KILLFOCUS(IDC_EDIT_COAXIAL_LIGHT4, &CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight4) + ON_BN_CLICKED(IDC_BUTTON_RESET_WORKTABLE, &CSO7_UtilDlg::OnBnClickedButtonResetWorktable) + ON_BN_CLICKED(IDC_BUTTON_RESET_V, &CSO7_UtilDlg::OnBnClickedButtonResetV) + ON_BN_CLICKED(IDC_BUTTON_GET_FIXTURE_FLAG, &CSO7_UtilDlg::OnBnClickedButtonGetFixtureFlag) + ON_BN_CLICKED(IDC_BUTTON_SET_RESET_FLAG, &CSO7_UtilDlg::OnBnClickedButtonSetResetFlag) + ON_BN_CLICKED(IDC_BUTTON_PROBE_ONOFF, &CSO7_UtilDlg::OnBnClickedButtonProbeOnoff) + ON_EN_KILLFOCUS(IDC_EDIT_SET_VER_NO, &CSO7_UtilDlg::OnEnKillfocusEditSetVerNo) + ON_BN_CLICKED(IDC_BUTTON_FIXTURE_ONOFF, &CSO7_UtilDlg::OnBnClickedButtonFixtureOnoff) + ON_BN_CLICKED(IDC_BUTTON_FIXTURE_UPDOWN, &CSO7_UtilDlg::OnBnClickedButtonFixtureUpdown) + ON_BN_CLICKED(IDC_BUTTON_RESET_WORKTABLE_RIGHT, &CSO7_UtilDlg::OnBnClickedButtonResetWorktableRight) + ON_BN_CLICKED(IDC_BUTTON_GET_LASER, &CSO7_UtilDlg::OnBnClickedButtonGetLaser) + ON_BN_CLICKED(IDC_BUTTON_SET_SECTION, &CSO7_UtilDlg::OnBnClickedButtonSetSection) + ON_BN_CLICKED(IDC_BUTTON_CORRECTION_SCALE, &CSO7_UtilDlg::OnBnClickedButtonCorrectionScale) + ON_EN_KILLFOCUS(IDC_EDIT_X_SCALE_COEFFICIENT, &CSO7_UtilDlg::OnEnKillfocusEditXScaleCoefficient) + ON_EN_KILLFOCUS(IDC_EDIT_Y_SCALE_COEFFICIENT, &CSO7_UtilDlg::OnEnKillfocusEditYScaleCoefficient) + ON_EN_KILLFOCUS(IDC_EDIT_Z_SCALE_COEFFICIENT, &CSO7_UtilDlg::OnEnKillfocusEditZScaleCoefficient) + ON_BN_CLICKED(IDC_BUTTON_LOAD_SO7CONFIG, &CSO7_UtilDlg::OnBnClickedButtonLoadSo7config) + ON_BN_CLICKED(IDC_BUTTON_AUTO_ZOOM, &CSO7_UtilDlg::OnBnClickedButtonAutoZoom) + ON_BN_CLICKED(IDC_BUTTON_MANUAL_HOME, &CSO7_UtilDlg::OnBnClickedButtonManualHome) + ON_BN_CLICKED(IDC_BUTTON_SETUP_SO7CONFIG, &CSO7_UtilDlg::OnBnClickedButtonSetupSo7config) +END_MESSAGE_MAP() + + +// CSO7_UtilDlg Ϣ + +BOOL CSO7_UtilDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + m_OutMessage = _T("System Ready.\r\nPress 'Init_SO7USB' to start."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + GetDlgItem(IDC_BUTTON_START_SO7MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_STOP_SO7MACHINE)->EnableWindow(false); + + + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_READ_PROBE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_V)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_FIXTURE_FLAG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_GET_RESET_FLAG)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_RING_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT2)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT3)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT4)->EnableWindow(false); + GetDlgItem(IDC_EDIT_LIGHT_SIZE_VALUE)->EnableWindow(false); + GetDlgItem(IDC_EDIT_LIGHT_SWITCH)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_SETUP_SO7CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_LOAD_SO7CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_IN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_OUT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_UP)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_DOWN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_LEFT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_BACK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_FRONT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_RESET_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_V)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MANUAL_HOME)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_AUTO_ZOOM)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_SET_RESET_FLAG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_LASER)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_PROBE_ONOFF)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN)->EnableWindow(false); + + GetDlgItem(IDC_EDIT_SET_VER_NO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_SECTION)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CORRECTION_SCALE)->EnableWindow(false); + + + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_GEAR1))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_GEAR2))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_GEAR3))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_SPEED_GEAR4))->SetCheck(false); + + ((CButton *)GetDlgItem(IDC_RADIO_SELECT_X))->SetCheck(true); + ((CButton *)GetDlgItem(IDC_RADIO_SELECT_Y))->SetCheck(false); + ((CButton *)GetDlgItem(IDC_RADIO_SELECT_Z))->SetCheck(false); + + CString csPath; + m_pSO7_Proto->GetAppPath(csPath); + m_pSO7_Proto->Load_SevenOcean_Inifile(csPath+_T("\\Utility_Config.ini")); + + m_csTop_Light_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value._top_light)); + m_csBom_Light_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value._bottom_light)); + m_csFan_Light_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value._ring_light)); + m_csBom1_Light_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value._coaxial_light)); + m_csBom2_Light_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value._spare_light1)); + m_csFan1_Light_Switch.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value.segment[0])); + m_csFan2_Light_Switch.Format(_T("%d"),(m_pSO7_Proto->g_machine.s_lights_value.segment[1])); + + m_cs_Light_Size_Value.Format(_T("%d"),(m_pSO7_Proto->g_machine.Light_Size)); + m_cs_Light_Switch.Format(_T("%d"),(m_pSO7_Proto->g_machine.Light_Switch)); + + m_cs_XScaleCoeff.Format(_T("%.2f"),(m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution)); + m_cs_YScaleCoeff.Format(_T("%.2f"),(m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution)); + m_cs_ZScaleCoeff.Format(_T("%.2f"),(m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution)); + + m_cs_Version_Number=_T("3"); + if (!g_pLoggerDebug) + g_pLoggerDebug = new CLogger(_T("\\UtilityDebug.Log")); + UpdateData(FALSE); + + return TRUE; // return TRUE unless you set the focus to a control +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonInitSo7usb() +{ + + if (0) + { + SO7AXISMOVE X; + SO7AXISMOVE Y; + SO7AXISMOVE Z; + X.dFromMM = 0.0; + X.dToMM = 100.0; + Y.dFromMM = 0.0; + Y.dToMM = 100.0; + Z.dFromMM = 0.0; + Z.dToMM = 10.0; + + ASSERT(0); + } + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->Init_SO7Usb()) + { + ((CButton *)GetDlgItem(IDC_RADIO_FORMAT_SNOOPY))->SetCheck(1); + m_OutMessage = _T("Usb Port Error"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + return; + }; + g_pLoggerDebug->SendAndFlushPerMode(_T("Usb Port Initialized.\r\n")); + }; + + m_OutMessage = _T("Usb Port Initialized.\r\n"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + GetDlgItem(IDCANCEL)->EnableWindow(false); + +} + + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonTermSo7usb() +{ + + + m_pSO7_Proto->Exit_SO7Usb(); + m_OutMessage = _T("Ready - Usb Port Released"); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + GetDlgItem(IDCANCEL)->EnableWindow(true); +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonStartSo7machine() +{ + + OnBnClickedButtonInitSo7usb(); + //m_pSO7_Proto->so7_motion_startup(0.5, 0.5, 0.5); + m_pSO7_Proto->_start_machine(); + + + m_OutMessage = _T("Machine Started."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + ((CButton*)GetDlgItem(IDC_BUTTON_PROBE_ONOFF))->SetWindowTextW(_T("ǰ̽ͷ")); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF))->SetWindowTextW(_T("ǰ״̬о߿")); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN))->SetWindowTextW(_T("ǰ״̬о")); + + + GetDlgItem(IDC_BUTTON_START_SO7MACHINE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_STOP_SO7MACHINE)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_XYZ)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_READ_PROBE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_V)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_GET_FIXTURE_FLAG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_GET_RESET_FLAG)->EnableWindow(true); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(true); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(true); + GetDlgItem(IDC_EDIT_RING_LIGHT)->EnableWindow(true); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT)->EnableWindow(true); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT2)->EnableWindow(true); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT3)->EnableWindow(true); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT4)->EnableWindow(true); + GetDlgItem(IDC_EDIT_LIGHT_SIZE_VALUE)->EnableWindow(true); + GetDlgItem(IDC_EDIT_LIGHT_SWITCH)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_SETUP_SO7CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_LOAD_SO7CONFIG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_IN)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_OUT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_UP)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_DOWN)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_LEFT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_RIGHT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_BACK)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_FRONT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7_RESET_XYZ)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_RESET_V)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE_RIGHT)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_MANUAL_HOME)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_AUTO_ZOOM)->EnableWindow(true); + + GetDlgItem(IDC_BUTTON_SET_RESET_FLAG)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_GET_LASER)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_PROBE_ONOFF)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN)->EnableWindow(true); + + GetDlgItem(IDC_EDIT_SET_VER_NO)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SET_SECTION)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_CORRECTION_SCALE)->EnableWindow(true); + SetTimer(1, 150, 0); + GetDlgItem(IDC_EDIT_UPDATE_FREQ)->SetWindowText(_T("150")); + + + +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonStopSo7machine() +{ + + CString csPath; + m_pSO7_Proto->GetAppPath(csPath); + m_pSO7_Proto->Save_SevenOcean_Inifile(csPath+_T("\\Utility_Config.ini")); + + m_OutMessage = _T("Machine Stoped."); + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + + + GetDlgItem(IDC_BUTTON_START_SO7MACHINE)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_STOP_SO7MACHINE)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_READ_PROBE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_READ_AXIS_V)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_FIXTURE_FLAG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_GET_RESET_FLAG)->EnableWindow(false); + GetDlgItem(IDC_EDIT_AXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_BOTTOM_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_RING_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT2)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT3)->EnableWindow(false); + GetDlgItem(IDC_EDIT_COAXIAL_LIGHT4)->EnableWindow(false); + GetDlgItem(IDC_EDIT_LIGHT_SIZE_VALUE)->EnableWindow(false); + GetDlgItem(IDC_EDIT_LIGHT_SWITCH)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_SETUP_SO7CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_LOAD_SO7CONFIG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_IN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_ZOOM_OUT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_UP)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Z_DOWN)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_LEFT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_X_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_BACK)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_MOVE_Y_FRONT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7_RESET_XYZ)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_V)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_RESET_WORKTABLE_RIGHT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_MANUAL_HOME)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_MOVE_TO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_AUTO_ZOOM)->EnableWindow(false); + + GetDlgItem(IDC_BUTTON_SET_RESET_FLAG)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_GET_LASER)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_PROBE_ONOFF)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN)->EnableWindow(false); + + GetDlgItem(IDC_EDIT_SET_VER_NO)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SET_SECTION)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_CORRECTION_SCALE)->EnableWindow(false); + + KillTimer(1); + m_pSO7_Proto->_shutdown_machine(); + OnBnClickedButtonTermSo7usb(); + +} +//==================================================== +void CSO7_UtilDlg::OnBnClickedButtonManualHome() +{ + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_RESET_FLAG(); + m_pSO7_Proto->g_machine.cVerNumber = 3; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_VER_NUMBER(); +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedCancel() +{ + + delete m_pSO7_Proto; + m_pSO7_Proto=NULL; + delete g_pLoggerDebug; + g_pLoggerDebug=NULL; + CDialog::OnCancel(); +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonSo7ResetXyz() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_RESET_XYZ(); +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonMoveTo() +{ + if (!m_pSO7_Serial) + m_pSO7_Serial = new CSerial(); + + if(!g_pVolComp) + g_pVolComp=new CSO7_VolComp(); + + CSO7_Move_Location* pSO7_Move_Location=new CSO7_Move_Location; + pSO7_Move_Location->DoModal(); + delete pSO7_Move_Location; + pSO7_Move_Location=NULL; + + if (m_pSO7_Serial) + { + delete m_pSO7_Serial; + m_pSO7_Serial=NULL; + } + if (g_pVolComp) + { + delete g_pVolComp; + g_pVolComp=nullptr; + } + return; +} + +//============================================ +void CSO7_UtilDlg::OnBnClickedButtonAutoZoom() +{ + + if (!m_pSO7_Serial) + m_pSO7_Serial = new CSerial(); + + delete g_pLoggerDebug; + g_pLoggerDebug=NULL; + + CSO7_Automatic_Zoom* pSO7_Auto_Zoom=new CSO7_Automatic_Zoom; + pSO7_Auto_Zoom->DoModal(); + delete pSO7_Auto_Zoom; + pSO7_Auto_Zoom=NULL; + + if (!g_pLoggerDebug) + { + g_pLoggerDebug = new CLogger(_T("\\UtilityDebug.Log")); + } + return; +} + +void CSO7_UtilDlg::OnBnClickedRadioSpeedGear1() +{ + m_pSO7_Proto->g_machine.x._Move_Speed_Gear=1; + m_pSO7_Proto->g_machine.y._Move_Speed_Gear=1; + m_pSO7_Proto->g_machine.z._Move_Speed_Gear=1; + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=5;//m_motor.c ==> movev + + +} + + +void CSO7_UtilDlg::OnBnClickedRadioSpeedGear2() +{ + m_pSO7_Proto->g_machine.x._Move_Speed_Gear=2; + m_pSO7_Proto->g_machine.y._Move_Speed_Gear=2; + m_pSO7_Proto->g_machine.z._Move_Speed_Gear=2; + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=5;//m_motor.c ==> movev +} + + +void CSO7_UtilDlg::OnBnClickedRadioSpeedGear3() +{ + m_pSO7_Proto->g_machine.x._Move_Speed_Gear=3; + m_pSO7_Proto->g_machine.y._Move_Speed_Gear=3; + m_pSO7_Proto->g_machine.z._Move_Speed_Gear=3; + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=1;//m_motor.c ==> movev + +} + + +void CSO7_UtilDlg::OnBnClickedRadioSpeedGear4() +{ + m_pSO7_Proto->g_machine.x._Move_Speed_Gear=4; + m_pSO7_Proto->g_machine.y._Move_Speed_Gear=4; + m_pSO7_Proto->g_machine.z._Move_Speed_Gear=4; + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=2;//m_motor.c ==> movev + + +} + + + + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonSo7ReadAxisXyz() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_AXIS_XYZ(); + m_X_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.x._scale_pos._long_)); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.y._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.z._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Pos); +} + +//===================================================================== +void CSO7_UtilDlg::OnBnClickedButtonReadProbe() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_PROBE_XYZ(); + m_X_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.x._scale_probe)); + GetDlgItem(IDC_EDIT_X_POSITION_59)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.y._scale_probe)); + GetDlgItem(IDC_EDIT_Y_POSITION_59)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.z._scale_probe)); + GetDlgItem(IDC_EDIT_Z_POSITION_59)->SetWindowText(m_Z_Pos); +} + +void CSO7_UtilDlg::OnBnClickedButtonSo7ReadAxisV() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_V_DATA(); + m_Zm_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Pos); +} + + + +void CSO7_UtilDlg::OnBnClickedButtonSo7GetResetFlag() +{ + // TODO: ڴӿؼ֪ͨ + m_pSO7_Proto->_send_cmd_SO7_CMD_GET_RESET_FLAG(); + CString csOutMessage; + csOutMessage.Format(_T("%d"),m_pSO7_Proto->g_machine.Sys_Reset_Flag); + m_OutMessage = _T("Sys_Reset_Flag : ")+csOutMessage; + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditAxialLight() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csTop_Light_Value); + + m_pSO7_Proto->g_machine.s_lights_value._top_light = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditBottomLight() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csBom_Light_Value); + + m_pSO7_Proto->g_machine.s_lights_value._bottom_light = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditRingLight() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csFan_Light_Value); + + m_pSO7_Proto->g_machine.s_lights_value._ring_light = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight() +{ + + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csBom1_Light_Value); + + m_pSO7_Proto->g_machine.s_lights_value._coaxial_light = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + +void CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight2() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csBom2_Light_Value); + + m_pSO7_Proto->g_machine.s_lights_value._spare_light1 = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight3() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csFan1_Light_Switch); + + m_pSO7_Proto->g_machine.s_lights_value.segment[0] = static_cast(atoi(cLightValue)); + + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditCoaxialLight4() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightValue=T2A(m_csFan2_Light_Switch); + m_pSO7_Proto->g_machine.s_lights_value.segment[1] = static_cast(atoi(cLightValue)); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ALL_LIGHT_VALUE(); +} + +void CSO7_UtilDlg::OnEnKillfocusEditLightSizeValue() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightSizeValue=T2A(m_cs_Light_Size_Value); + + m_pSO7_Proto->g_machine.Light_Size = static_cast(atoi(cLightSizeValue)); + + if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT1_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT1_SIZE,m_pSO7_Proto->g_machine.Light_Size); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT2_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT2_SIZE,m_pSO7_Proto->g_machine.Light_Size); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT3_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT3_SIZE,m_pSO7_Proto->g_machine.Light_Size); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT4_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT4_SIZE,m_pSO7_Proto->g_machine.Light_Size); + } + +} + + +void CSO7_UtilDlg::OnEnKillfocusEditLightSwitch() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cLightSwitchValue=T2A(m_cs_Light_Switch); + + m_pSO7_Proto->g_machine.Light_Switch = static_cast(atoi(cLightSwitchValue)); + + if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT1_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT1_SWITCH,m_pSO7_Proto->g_machine.Light_Switch); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT2_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT2_SWITCH,m_pSO7_Proto->g_machine.Light_Switch); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT3_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT3_SWITCH,m_pSO7_Proto->g_machine.Light_Switch); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_LIGHT4_SIZE))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_LIGHT_SIZE(CT_LIGHT4_SWITCH,m_pSO7_Proto->g_machine.Light_Switch); + } + +} + +void CSO7_UtilDlg::OnBnClickedButtonResetWorktable() +{ + + m_pSO7_Proto->so7_motion_reset_worktable_lower_left(); + +} + + +void CSO7_UtilDlg::OnBnClickedButtonResetWorktableRight() +{ + + m_pSO7_Proto->so7_motion_reset_worktable_top_right(); +} + +void CSO7_UtilDlg::OnBnClickedButtonResetV() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_RESET_V(); +} + + +void CSO7_UtilDlg::OnBnClickedButtonGetFixtureFlag() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_GET_FIXTURE_VALUE(); + CString csOutMessage; + csOutMessage.Format(_T("%d"),m_pSO7_Proto->g_machine.cFixtureFlag); + m_OutMessage = _T("Fixture_Flag : ")+csOutMessage; + GetDlgItem(IDC_EDIT_STATUS)->SetWindowText(m_OutMessage); + +} + + +void CSO7_UtilDlg::OnBnClickedButtonSetResetFlag() +{ + + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_RESET_FLAG(); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditSetVerNo() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cTempSendCmd; + cTempSendCmd=T2A(m_cs_Version_Number); + m_pSO7_Proto->g_machine.cVerNumber = static_cast(atoi(cTempSendCmd)); + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_VER_NUMBER(); +} + + +void CSO7_UtilDlg::OnBnClickedButtonProbeOnoff() +{ + + static bool bFlag(false); + + if (bFlag) + { + m_pSO7_Proto->so7_motion_probe_on_off_(false); + ((CButton*)GetDlgItem(IDC_BUTTON_PROBE_ONOFF))->SetWindowTextW(_T("ǰ̽ͷ")); + bFlag=false; + } + else + { + m_pSO7_Proto->so7_motion_probe_on_off_(true); + ((CButton*)GetDlgItem(IDC_BUTTON_PROBE_ONOFF))->SetWindowTextW(_T("ǰ̽ͷӴʽ")); + bFlag=true; + } +} + + +void CSO7_UtilDlg::OnBnClickedButtonFixtureOnoff() +{ + + static bool bFlag(false); + + if (bFlag) + { + m_pSO7_Proto->so7_motion_fixture_on_off(true); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF))->SetWindowTextW(_T("ǰ״̬о߿")); + bFlag=false; + } + else + { + m_pSO7_Proto->so7_motion_fixture_on_off(false); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_ONOFF))->SetWindowTextW(_T("ǰ״̬о߹")); + bFlag=true; + } +} + + +void CSO7_UtilDlg::OnBnClickedButtonFixtureUpdown() +{ + + static bool bFlag(false); + + if (bFlag) + { + m_pSO7_Proto->so7_motion_fixture_up_down(true); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN))->SetWindowTextW(_T("ǰ״̬о")); + bFlag=false; + } + else + { + m_pSO7_Proto->so7_motion_fixture_up_down(false); + ((CButton*)GetDlgItem(IDC_BUTTON_FIXTURE_UPDOWN))->SetWindowTextW(_T("ǰ״̬о")); + bFlag=true; + } +} + + + +void CSO7_UtilDlg::OnBnClickedButtonGetLaser() +{ + + m_pSO7_Proto->so7_motion_stop_motor_to_get_laser_data(); +} + + +void CSO7_UtilDlg::OnBnClickedButtonSetSection() +{ + + if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_X))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SECTION(0); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_Y))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SECTION(1); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_Z))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_SECTION(2); + } + + +} + + +void CSO7_UtilDlg::OnBnClickedButtonCorrectionScale() +{ + /***************************************************************** + m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(100,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(-100,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_X(m_pSO7_Proto->g_machine.x._Move_Speed_Gear); + Sleep(600); + m_pSO7_Proto->_send_cmd_SO7_CMD_STOP_MOVE_XYZ(); + Sleep(50); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_Y(-m_pSO7_Proto->g_machine.y._Move_Speed_Gear); + m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + + //m_pSO7_Proto->g_machine.x._pos_fixed._long_=m_pSO7_Proto->MMtoScale(100,m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + //m_pSO7_Proto->g_machine.y._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0,m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + //m_pSO7_Proto->g_machine.z._pos_fixed._long_=m_pSO7_Proto->MMtoScale(0,m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + //m_pSO7_Proto->_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(CT_MOVETOXYZ); + /************************************************************/ + if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_X))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_CORRECTION_SCALE(0); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_Y))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_CORRECTION_SCALE(1); + } + + else if (((CButton *)GetDlgItem(IDC_RADIO_SELECT_Z))->GetCheck()) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_CORRECTION_SCALE(2); + } + +} + + +void CSO7_UtilDlg::OnEnKillfocusEditXScaleCoefficient() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cTempValue=T2A(m_cs_XScaleCoeff); + + m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution = atof(cTempValue); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditYScaleCoefficient() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cTempValue=T2A(m_cs_YScaleCoeff); + + m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution = atof(cTempValue); +} + + +void CSO7_UtilDlg::OnEnKillfocusEditZScaleCoefficient() +{ + + UpdateData(TRUE); + USES_CONVERSION; + const char* cTempValue=T2A(m_cs_ZScaleCoeff); + + m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution = atof(cTempValue); +} + + +void CSO7_UtilDlg::OnBnClickedButtonLoadSo7config() +{ + KillTimer(1); + CSO7_Send_Parameter* pSO7_Send_Parameter=new CSO7_Send_Parameter; + pSO7_Send_Parameter->DoModal(); + delete pSO7_Send_Parameter; + SetTimer(1,150,NULL); + return; + +} + +//=================================================== +void CSO7_UtilDlg::OnBnClickedButtonSetupSo7config() +{ + KillTimer(1); + if (!m_pSO7_Serial) + m_pSO7_Serial = new CSerial(); + + CSetup_so7config* pSetup_so7config=new CSetup_so7config; + pSetup_so7config->DoModal(); + delete pSetup_so7config; + + if (m_pSO7_Serial) + { + delete m_pSO7_Serial; + m_pSO7_Serial=NULL; + } + SetTimer(1,150,NULL); +} + +//================================================================================================ +void CSO7_UtilDlg::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + switch(nIDEvent) + { + case 1: + { + if (m_pSO7_Proto) + { + if (m_pSO7_Proto->g_machine.s_status._machine_running) + { + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_AXIS_XYZ(); + m_pSO7_Proto->_send_cmd_SO7_CMD_READ_V_DATA(); + + m_pSO7_Proto->g_machine.x._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.x._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.x_axis._scale_resolution); + m_pSO7_Proto->g_machine.y._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.y._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.y_axis._scale_resolution); + m_pSO7_Proto->g_machine.z._d_cur_pos_ = m_pSO7_Proto->ScaleToMM(m_pSO7_Proto->g_machine.z._scale_pos._long_, m_pSO7_Proto->g_machine.s_machine_config.z_axis._scale_resolution); + + m_X_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.x._scale_pos._long_)); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.y._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.z._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Pos); + + m_X_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.x._d_cur_pos_); + GetDlgItem(IDC_EDIT_X_POSITION_58)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.y._d_cur_pos_); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.z._d_cur_pos_); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->SetWindowText(m_Z_Pos); + + + m_Zm_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Pos); + + } + else + { + m_X_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.x._scale_pos._long_)); + GetDlgItem(IDC_EDIT_X_AXIS)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.y._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Y_AXIS)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.z._scale_pos._long_)); + GetDlgItem(IDC_EDIT_Z_AXIS)->SetWindowText(m_Z_Pos); + + m_X_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.x._d_cur_pos_); + GetDlgItem(IDC_EDIT_X_POSITION_58)->SetWindowText(m_X_Pos); + m_Y_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.y._d_cur_pos_); + GetDlgItem(IDC_EDIT_Y_POSITION_58)->SetWindowText(m_Y_Pos); + m_Z_Pos.Format(_T("%8.4lf"), m_pSO7_Proto->g_machine.z._d_cur_pos_); + GetDlgItem(IDC_EDIT_Z_POSITION_58)->SetWindowText(m_Z_Pos); + + + m_Zm_Pos.Format(_T("%8ld"),(m_pSO7_Proto->g_machine.zm._scale_pos._long_)); + GetDlgItem(IDC_EDIT_ZM_AXIS)->SetWindowText(m_Zm_Pos); + } + } + break; + } + } + + CDialog::OnTimer(nIDEvent); +} + +BOOL CSO7_UtilDlg::PreTranslateMessage(MSG* pMsg) +{ + + if(pMsg->message==WM_KEYDOWN) + { + if(pMsg->wParam==VK_RETURN || pMsg->wParam==VK_ESCAPE) + { + return TRUE; + } + } + return CDialog::PreTranslateMessage(pMsg); +} + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.h new file mode 100644 index 0000000..49a3408 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_UtilDlg.h @@ -0,0 +1,104 @@ +#pragma once + + +// CSO7_UtilDlg Ի + +class CSO7_UtilDlg : public CDialog +{ + DECLARE_DYNAMIC(CSO7_UtilDlg) + +public: + CSO7_UtilDlg(CWnd* pParent = NULL); // ׼캯 + virtual ~CSO7_UtilDlg(); + +// Ի + enum { IDD = IDD_SO7_UTIL_DIALOG }; + +protected: + CButton ccc; + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧ + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + CString m_OutMessage; + CString m_X_Pos; + CString m_Y_Pos; + CString m_Z_Pos; + CString m_Zm_Pos; + + CString m_csTop_Light_Value; + CString m_csBom_Light_Value; + CString m_csFan_Light_Value; + CString m_csBom1_Light_Value; + CString m_csBom2_Light_Value; + CString m_csFan1_Light_Switch; + CString m_csFan2_Light_Switch; + + CString m_cs_Light_Switch; + CString m_cs_Light_Size_Value; + + CString m_cs_Version_Number; + + CString m_cs_XScaleCoeff; + CString m_cs_YScaleCoeff; + CString m_cs_ZScaleCoeff; + + + CProcessButton m_Button_MoveX_Left; + CProcessButton m_Button_MoveX_Right; + CProcessButton m_Button_MoveY_Front; + CProcessButton m_Button_MoveY_Back; + CProcessButton m_Button_MoveZ_Up; + CProcessButton m_Button_MoveZ_Down; + CProcessButton m_Button_MoveV_Zoom_In; + CProcessButton m_Button_MoveV_Zoom_Out; + + + afx_msg void OnBnClickedButtonInitSo7usb(); + afx_msg void OnBnClickedButtonTermSo7usb(); + afx_msg void OnBnClickedButtonStartSo7machine(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedButtonStopSo7machine(); + afx_msg void OnBnClickedButtonSo7ResetXyz(); + afx_msg void OnBnClickedButtonMoveTo(); + afx_msg void OnBnClickedButtonSo7ReadAxisXyz(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg BOOL PreTranslateMessage(MSG* pMsg); + + afx_msg void OnBnClickedButtonSo7MoveXLeft(); + afx_msg void OnBnClickedRadioSpeedGear1(); + afx_msg void OnBnClickedRadioSpeedGear2(); + afx_msg void OnBnClickedRadioSpeedGear3(); + afx_msg void OnBnClickedRadioSpeedGear4(); + afx_msg void OnBnClickedButtonReadProbe(); + afx_msg void OnBnClickedButtonSo7ReadAxisV(); + afx_msg void OnBnClickedButtonSo7GetResetFlag(); + afx_msg void OnEnKillfocusEditAxialLight(); + afx_msg void OnEnKillfocusEditBottomLight(); + afx_msg void OnEnKillfocusEditRingLight(); + afx_msg void OnEnKillfocusEditCoaxialLight(); + afx_msg void OnEnKillfocusEditLightSizeValue(); + afx_msg void OnEnKillfocusEditLightSwitch(); + afx_msg void OnEnKillfocusEditCoaxialLight2(); + afx_msg void OnEnKillfocusEditCoaxialLight3(); + afx_msg void OnEnKillfocusEditCoaxialLight4(); + afx_msg void OnBnClickedButtonResetWorktable(); + afx_msg void OnBnClickedButtonResetV(); + afx_msg void OnBnClickedButtonGetFixtureFlag(); + afx_msg void OnBnClickedButtonSetResetFlag(); + afx_msg void OnBnClickedButtonProbeOnoff(); + afx_msg void OnEnKillfocusEditSetVerNo(); + afx_msg void OnBnClickedButtonFixtureOnoff(); + afx_msg void OnBnClickedButtonFixtureUpdown(); + afx_msg void OnBnClickedButtonResetWorktableRight(); + afx_msg void OnBnClickedButtonGetLaser(); + afx_msg void OnBnClickedButtonSetSection(); + afx_msg void OnBnClickedButtonCorrectionScale(); + afx_msg void OnEnKillfocusEditXScaleCoefficient(); + afx_msg void OnEnKillfocusEditYScaleCoefficient(); + afx_msg void OnEnKillfocusEditZScaleCoefficient(); + afx_msg void OnBnClickedButtonLoadSo7config(); + afx_msg void OnBnClickedButtonAutoZoom(); + afx_msg void OnBnClickedButtonManualHome(); + afx_msg void OnBnClickedButtonSetupSo7config(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.cpp new file mode 100644 index 0000000..d6da7ba --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.cpp @@ -0,0 +1,45 @@ +#include "StdAfx.h" +#include "SO7_VolComp.h" + + +CSO7_VolComp::CSO7_VolComp(void) +{ + m_bEnVolComp=FALSE; + m_hVolComp=(HMODULE)LoadLibrary(GetAppPath()+_T("\\VolCompensation.dll")); + if(m_hVolComp) + { + m_InitVolComp=(pfVOLCOMP)GetProcAddress(m_hVolComp,"InitVolComp"); + m_CloseVolComp=(pfVOLCOMP)GetProcAddress(m_hVolComp,"CloseVolComp"); + m_CompensateToCMM=(pfCOMPENSATE)GetProcAddress(m_hVolComp,"CompensateToCMM"); + m_CompensateFromCMM=(pfCOMPENSATE)GetProcAddress(m_hVolComp,"CompensateFromCMM"); + m_bEnVolComp=m_InitVolComp(); + } + }; +CSO7_VolComp::~CSO7_VolComp(void) +{ + if(m_hVolComp) + { + m_CloseVolComp(); + m_bEnVolComp=FALSE; + } + FreeLibrary(m_hVolComp); + +}; + +void CSO7_VolComp::CompensateFromSo7(double &x,double &y,double &z) +{ + if(m_bEnVolComp) + { + m_CompensateFromCMM(x,y,z); + } + +}; + +void CSO7_VolComp::CompensateToSo7(double &x,double &y,double &z) +{ + if(m_bEnVolComp) + { + m_CompensateToCMM(x,y,z); + } + +}; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.h new file mode 100644 index 0000000..42d94c9 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/SO7_VolComp.h @@ -0,0 +1,22 @@ +#ifndef _SO7_VOLCOMP_H +#define _SO7_VOLCOMP_H + +typedef BOOL (*pfVOLCOMP)(); +typedef BOOL (*pfCOMPENSATE)(double &x,double &y,double &z); + +class CSO7_VolComp +{ +public: + HMODULE m_hVolComp; + BOOL m_bEnVolComp; + pfVOLCOMP m_InitVolComp; + pfVOLCOMP m_CloseVolComp; + pfCOMPENSATE m_CompensateToCMM; + pfCOMPENSATE m_CompensateFromCMM; + void CompensateToSo7(double &x,double &y,double &z); + void CompensateFromSo7(double &x,double &y,double &z); + CSO7_VolComp(void); + ~CSO7_VolComp(void); +}; + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/STATUS_MOTION.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/STATUS_MOTION.h new file mode 100644 index 0000000..bd6c41a --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/STATUS_MOTION.h @@ -0,0 +1,7 @@ +#if !defined(AFX_STATUS_MOTION_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_) +#define AFX_STATUS_MOTION_H__B422904C_2CEB_495B_B7BD_B45AB30286DD__INCLUDED_ +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.cpp new file mode 100644 index 0000000..cb6be3e --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.cpp @@ -0,0 +1,660 @@ +// Setup_so7config.cpp : implementation file +// + +#include "stdafx.h" +#include "resource.h" +#include "afxdialogex.h" +#include +#include "ProcessButton.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "..\..\..\SevenOcean\CMMIO_SERIAL.H" + + +#include "Setup_so7config.h" +extern CSerial* m_pSO7_Serial; +extern CSO7_Proto* m_pSO7_Proto; +#define PI 3.1415926535897932384626433 +// CSetup_so7config dialog + +IMPLEMENT_DYNAMIC(CSetup_so7config, CDialog) + + CSetup_so7config::CSetup_so7config(CWnd* pParent /*=NULL*/) + : CDialog(CSetup_so7config::IDD, pParent) +{ + +} + +CSetup_so7config::~CSetup_so7config() +{ +} + +void CSetup_so7config::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + + DDX_Text(pDX, IDC_EDIT_SO7CONFIG_ZOOMID, m_csZoomID); + DDX_Text(pDX, IDC_EDIT_SO7CONFIG_MOTOR_SUBDIVISION, m_csMotorSubdivision); + DDX_Text(pDX, IDC_EDIT_SO7CONFIG_ZOOM_FASTSPEED, m_csZoomFastSpeed); + DDX_Text(pDX, IDC_EDIT_SO7CONFIG_ZOOM_SLOWSPEED, m_csZoomSlowSpeed); + DDX_Text(pDX, IDC_EDIT_SO7CONFIG_ZOOM_PRECISION, m_csZoomPrecision); + + + DDX_Control(pDX, IDC_BTN_CONFIGURE_MOVEVIN, m_BTNZoomIn); + DDX_Control(pDX, IDC_BTN_CONFIGURE_MOVEVOUT, m_BTNZoomOut); + DDX_Control(pDX, IDC_EDIT_CONFIGURE_MSGOUT, m_edit_MsgOut); +} + + +BEGIN_MESSAGE_MAP(CSetup_so7config, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_BTN_CONFIGURE_CALIBRATEV, &CSetup_so7config::OnBnClickedBtnConfigureCalibratev) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_STEP1, &CSetup_so7config::OnBnClickedButtonSo7configStep1) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_STEP2, &CSetup_so7config::OnBnClickedButtonSo7configStep2) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_SET_SPEED, &CSetup_so7config::OnBnClickedButtonSo7configSetSpeed) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_ZOOM_NEGLIMIT, &CSetup_so7config::OnBnClickedButtonSo7configZoomNeglimit) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_ZOOM_POSLIMIT, &CSetup_so7config::OnBnClickedButtonSo7configZoomPoslimit) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_ZOOM_PRECISION, &CSetup_so7config::OnBnClickedButtonSo7configZoomPrecision) + ON_BN_CLICKED(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST, &CSetup_so7config::OnBnClickedRadioSo7configZoomMoveFast) + ON_BN_CLICKED(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_SLOW, &CSetup_so7config::OnBnClickedRadioSo7configZoomMoveSlow) + ON_EN_KILLFOCUS(IDC_EDIT_SO7CONFIG_ZOOM_FASTSPEED, &CSetup_so7config::OnEnKillfocusEditSo7configZoomFastspeed) + ON_EN_KILLFOCUS(IDC_EDIT_SO7CONFIG_ZOOM_SLOWSPEED, &CSetup_so7config::OnEnKillfocusEditSo7configZoomSlowspeed) + ON_BN_CLICKED(IDCANCEL, &CSetup_so7config::OnBnClickedCancel) + ON_BN_CLICKED(IDC_BUTTON_SO7CONFIG_SET_SUBDIVISION, &CSetup_so7config::OnBnClickedButtonSo7configSetSubdivision) +END_MESSAGE_MAP() + + +// CSetup_so7config message handlers +//=================================================== +BOOL CSetup_so7config::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + //=============================================================================== + m_cnt=0; + _bReading=false; + m_nStep=0; + m_pSO7_Proto->g_machine.zm._Move_Speed_Gear=2; + + ((CButton *)GetDlgItem(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST))->SetCheck(true); + if (m_pSO7_Serial) + { + if(m_pSO7_Serial->Open()) + { + ChangGUIWithStep(m_nStep); + m_csMsg.Format(_T("ڴ")); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + ChangGUIWithStep(-1); + AfxMessageBox(_T("ڱռã")); + } + } + SetTimer(1,200,NULL); + m_csZoomID=_T("So7123456"); + m_csMotorSubdivision=_T("3200"); + m_csZoomFastSpeed=_T("2000"); + m_csZoomSlowSpeed=_T("800"); + m_csZoomPrecision=_T("0.05"); + UpdateData(FALSE); + return TRUE; // return TRUE unless you set the focus to a control +} +//=============================================== +void CSetup_so7config::OnBnClickedBtnConfigureCalibratev() +{ + GetDlgItem(IDC_BTN_CONFIGURE_CALIBRATEV)->EnableWindow(false); + KillTimer(1); + BOOL status=CalibrateEncoder(); + m_cnt++; + if (status) + { + m_csMsg.Format(_T("%dУɹ;"),m_cnt); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + m_csMsg.Format(_T("%dУʧ;"),m_cnt); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + Sleep(100); + SetTimer(1,200,NULL); + GetDlgItem(IDC_BTN_CONFIGURE_CALIBRATEV)->EnableWindow(true); +} + +//=================================================== +void CSetup_so7config::OnBnClickedButtonSo7configStep1() +{ + UpdateData(TRUE); + USES_CONVERSION; + if (m_csZoomID==_T("")) + { + m_csMsg=_T("IDΪ;"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._ProductID=m_csZoomID; + m_csMsg=_T("ZOOM_PRODUCT_ID=")+m_csZoomID; + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_nStep=1; + ChangGUIWithStep(m_nStep); + } + + +} + +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configStep2() +{ + m_nStep=2; + ChangGUIWithStep(m_nStep); +} +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configSetSubdivision() +{ + UpdateData(TRUE); + USES_CONVERSION; + if (m_csMotorSubdivision==_T("")) + { + m_csMsg=_T("ϸΪ;"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + const char* cTmp=T2A(m_csMotorSubdivision); + int iMotorSubdivision= atoi(cTmp); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale = (static_cast(iMotorSubdivision)/360.0)*2.8276578073089675; + m_csMsg.Format(_T("ZOOM_PULSE_PER_DEG=%.9f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._PulseScale); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_nStep=3; + ChangGUIWithStep(m_nStep); + } +} +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configSetSpeed() +{ + UpdateData(TRUE); + USES_CONVERSION; + if (m_csZoomFastSpeed==_T("") || m_csZoomSlowSpeed==_T("")) + { + m_csMsg=_T("ٶֵΪ;"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + const char* cTmp=T2A(m_csZoomFastSpeed); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast = static_cast(atoi(cTmp)); + cTmp=T2A(m_csZoomSlowSpeed); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow = static_cast(atoi(cTmp)); + + m_csMsg.Format(_T("ZOOM_MOTOR_SPEED_FAST=%d"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_csMsg.Format(_T("ZOOM_MOTOR_SPEED_SLOW=%d"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + if (((CButton *)GetDlgItem(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST))->GetCheck()) + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + } + else + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + } + m_nStep=4; + ChangGUIWithStep(m_nStep); + } + +} + +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configZoomNeglimit() +{ + KillTimer(1); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit=GetZoomCurPos(); + SetTimer(1,200,NULL); + m_csMsg.Format(_T("From:%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_nStep=5; + ChangGUIWithStep(m_nStep); +} + +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configZoomPoslimit() +{ + KillTimer(1); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit=GetZoomCurPos(); + SetTimer(1,200,NULL); + m_csMsg.Format(_T("To:%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + + if ((m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit)!=0 && + ( (m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit)>240 + || (m_pSO7_Proto->g_machine.s_machine_config.zm_axis._pos_deg_working_limit-m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit)>-120)) + { + if ((m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit+230)>=360) + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree=floor(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree=(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree+10-360); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._EndDegree=(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree+220); + } + else + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree=360; + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree=(floor(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._neg_deg_working_limit)+10); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._EndDegree=(m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree+220); + } + m_csMsg.Format(_T("ZOOM_START_DEG=%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._StartDegree); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_csMsg.Format(_T("ZOOM_END_DEG=%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._EndDegree); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_csMsg.Format(_T("ZOOM_ORG_DEG=%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._RelativeZeroDegree); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + + m_nStep=6; + ChangGUIWithStep(m_nStep); + } + else + { + m_csMsg=_T("ΧСֵȷתͶһ£תСֵֵ;"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_nStep=4; + ChangGUIWithStep(m_nStep); + } +} + +//=============================================== +void CSetup_so7config::OnBnClickedButtonSo7configZoomPrecision() +{ + UpdateData(TRUE); + USES_CONVERSION; + if (m_csZoomPrecision==_T("")) + { + m_csMsg=_T("ֵΪ;"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + } + else + { + const char* cTmp=T2A(m_csZoomPrecision); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband = atof(cTmp); + m_csMsg.Format(_T("ZOOM_DEADBAND_DEG=%f"),m_pSO7_Proto->g_machine.s_machine_config.zm_axis._Deadband); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_csMsg=_T(""); + m_pSO7_Proto->GetAppPath(m_csMsg); + m_csMsg=_T("ļ:")+m_csMsg+_T("\\so7_config.ini"); + OutputWithScroll(m_csMsg,m_edit_MsgOut); + m_pSO7_Proto->Save_So7_Config(); + + m_nStep=0; + ChangGUIWithStep(m_nStep); + } +} +//=============================================== +void CSetup_so7config::OnBnClickedRadioSo7configZoomMoveFast() +{ + + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + +} + +//=============================================== +void CSetup_so7config::OnBnClickedRadioSo7configZoomMoveSlow() +{ + + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + +} +//=============================================== +void CSetup_so7config::OnEnKillfocusEditSo7configZoomFastspeed() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTmp=T2A(m_csZoomFastSpeed); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast = static_cast(atoi(cTmp)); + + if (((CButton *)GetDlgItem(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST))->GetCheck()) + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedFast; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + } +} + +//=============================================== +void CSetup_so7config::OnEnKillfocusEditSo7configZoomSlowspeed() +{ + UpdateData(TRUE); + USES_CONVERSION; + const char* cTmp=T2A(m_csZoomSlowSpeed); + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow = static_cast(atoi(cTmp)); + + if (((CButton *)GetDlgItem(IDC_RADIO_SO7CONFIG_ZOOM_MOVE_SLOW))->GetCheck()) + { + m_pSO7_Proto->g_machine.s_machine_config.zm_axis._speed._short_=m_pSO7_Proto->g_machine.s_machine_config.zm_axis._SpeedSlow; + m_pSO7_Proto->_send_cmd_SO7_CMD_SET_ZOOM_SPEED(2); + } +} +//=============================================== +void CSetup_so7config::OnTimer(UINT_PTR nIDEvent) +{ + USES_CONVERSION; + + switch(nIDEvent) + { + case 1: + { + CString csTmpData; + m_pSO7_Proto->g_machine.zm._d_cur_pos_=ReadZoomAngle(); + csTmpData.Format(_T("%.4f"),m_pSO7_Proto->g_machine.zm._d_cur_pos_); + GetDlgItem(IDC_EDIT_SO7CONFIG_READZOOM)->SetWindowTextW(csTmpData); + } + break; + } + + CDialog::OnTimer(nIDEvent); + +} + + +//=============================================== +double CSetup_so7config::ReadZoomAngle() +{ + if (_bReading) + { + return -2; + } + else + { + _bReading=true; + double dZoomAngle(-1); + char sendData[6]={'A','D',':','0',13,10}; + DWORD iWriteByte=m_pSO7_Serial->Send(sendData,6); + + INT iRetrys(0); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(10); + } + if (m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(40);//200 + + char *cRecvData= NULL; + char *token = NULL; + char cTemp[20]={0}; + USES_CONVERSION; + cRecvData=T2A(m_pSO7_Serial->m_csRecv); + + char seps[] = "$AD:"; + + token = strtok(cRecvData,seps); + if (token) + { + memcpy(cTemp,token,8); + dZoomAngle=atof(cTemp); + dZoomAngle=dZoomAngle*180/PI; + }; + token=NULL; + cRecvData=NULL; + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + _bReading=false; + return dZoomAngle; + } + else + { + _bReading=false; + return -2; + } + } +} + +//=============================================== +double CSetup_so7config::GetZoomCurPos() +{ + double dZoomPos(0),dZoomAng(0),dZoomPreAng(0); + INT iCnt2(0); + INT iRetryCount(0); + dZoomAng=ReadZoomAngle(); + + while(iCnt2<3 && iRetryCount<20) + { + Sleep(60); + dZoomPreAng=dZoomAng; + dZoomAng=ReadZoomAngle(); + INT iRetrys(0); + while ((dZoomAng==-1 || dZoomAng==-2 || dZoomAng==0 )&&iRetrys<2) + { + iRetrys++; + Sleep(60); + dZoomAng=ReadZoomAngle(); + } + if(dZoomAng!=-1 && dZoomAng!=-2 && dZoomAng!=0) + { + if ((dZoomAng-dZoomPreAng)<1 && (dZoomPreAng-dZoomAng)<1) + { + dZoomPos+=dZoomAng; + iCnt2++; + } + } + iRetryCount++; + + } + if (iCnt2==0) + { + dZoomPos=-2; + } + else + { + dZoomPos=dZoomPos/(iCnt2); + } + return dZoomPos; +} + +//=============================================== +BOOL CSetup_so7config::CalibrateEncoder() +{ + char sendDataI[12]={'U','P',':','1','1','1','1','1','1','1',13,10}; + char sendDataII[6]={'S','C',':','1',13,10}; + char sendDataIII[6]={'R','F',':','1',13,10}; + CString csRightRecv; + csRightRecv.Format(_T("@OK\r\n")); + INT iRetrys(0); + DWORD iWriteByte(0); + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + + //Phase I + iWriteByte=m_pSO7_Serial->Send(sendDataI,12); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==12) + { + iRetrys++; + Sleep(50); + } + + if (m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + //Phase II + + iWriteByte=m_pSO7_Serial->Send(sendDataII,6); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(50); + } + if(m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + //Phase III + + iWriteByte=m_pSO7_Serial->Send(sendDataIII,6); + while(!m_pSO7_Serial->m_iRecvState && iRetrys<20 && iWriteByte==6) + { + iRetrys++; + Sleep(50); + } + if(m_pSO7_Serial->m_iRecvState) + { + if(m_pSO7_Serial->m_csRecv==_T("")) + Sleep(100); + + if(m_pSO7_Serial->m_csRecv==csRightRecv) + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + iRetrys=0; + iWriteByte=0; + return TRUE; + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + } + else + { + return FALSE; + } + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + } + else + { + return FALSE; + } + + } + else + { + m_pSO7_Serial->m_csRecv=_T(""); + m_pSO7_Serial->m_iRecvState=FALSE; + return FALSE; + } + + } + else + { + return FALSE; + } + +} +//=============================================== +void CSetup_so7config::ChangGUIWithStep(int _step) +{ + GetDlgItem(IDC_BUTTON_SO7CONFIG_STEP1)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_STEP2)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_SET_SUBDIVISION)->EnableWindow(false); + GetDlgItem(IDC_BTN_CONFIGURE_CALIBRATEV)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_SET_SPEED)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_NEGLIMIT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_POSLIMIT)->EnableWindow(false); + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_PRECISION)->EnableWindow(false); + + switch(_step) + { + case 0: + GetDlgItem(IDC_BUTTON_SO7CONFIG_STEP1)->EnableWindow(true); + break; + case 1: + GetDlgItem(IDC_BTN_CONFIGURE_CALIBRATEV)->EnableWindow(true); + GetDlgItem(IDC_BUTTON_SO7CONFIG_STEP2)->EnableWindow(true); + break; + case 2: + GetDlgItem(IDC_BUTTON_SO7CONFIG_SET_SUBDIVISION)->EnableWindow(true); + break; + case 3: + GetDlgItem(IDC_BUTTON_SO7CONFIG_SET_SPEED)->EnableWindow(true); + break; + case 4: + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_NEGLIMIT)->EnableWindow(true); + break; + case 5: + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_POSLIMIT)->EnableWindow(true); + break; + case 6: + GetDlgItem(IDC_BUTTON_SO7CONFIG_ZOOM_PRECISION)->EnableWindow(true); + break; + default: + break; + } +}; + +//===================================================================================== +//Print message on edit control +void CSetup_so7config::OutputWithScroll(const CString &strNewText,CEdit &edtOutput) +{ + CString strOutput; + edtOutput.GetWindowText(strOutput); + strOutput += strNewText; + if ("\r\n" != strOutput.Right(2)) + { + strOutput += "\r\n"; + } + + int iCount = strOutput.GetLength(); + + edtOutput.SetRedraw(FALSE); + edtOutput.SetWindowText(strOutput); + int iLine = edtOutput.GetLineCount(); + edtOutput.LineScroll(iLine, 0); + edtOutput.SetSel(iCount, iCount); + edtOutput.SetRedraw(TRUE); +} + + +//======================================= +void CSetup_so7config::OnBnClickedCancel() +{ + KillTimer(1); + CDialog::OnCancel(); +} + + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.h new file mode 100644 index 0000000..d6a549f --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Setup_so7config.h @@ -0,0 +1,50 @@ +#pragma once + + +// CSetup_so7config dialog + +class CSetup_so7config : public CDialog +{ + DECLARE_DYNAMIC(CSetup_so7config) + +public: + CSetup_so7config(CWnd* pParent = NULL); // standard constructor + virtual ~CSetup_so7config(); + +// Dialog Data + enum { IDD = IDD_SO7_UTIL_SETUP_CONFIGURE }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +protected: + CProcessButton m_BTNZoomIn,m_BTNZoomOut; + CEdit m_edit_MsgOut; + CString m_csMsg; + CString m_csZoomID,m_csZoomFastSpeed,m_csZoomSlowSpeed,m_csZoomPrecision,m_csMotorSubdivision; + int m_cnt; + int m_nStep; + void ChangGUIWithStep(int _step); + bool _bReading; +public: + afx_msg void OnTimer(UINT_PTR nIDEvent); + afx_msg void OnBnClickedBtnConfigureCalibratev(); + afx_msg void OnBnClickedButtonSo7configStep1(); + afx_msg void OnBnClickedButtonSo7configStep2(); + afx_msg void OnBnClickedButtonSo7configSetSpeed(); + afx_msg void OnBnClickedButtonSo7configZoomNeglimit(); + afx_msg void OnBnClickedButtonSo7configZoomPoslimit(); + afx_msg void OnBnClickedButtonSo7configZoomPrecision(); + double GetZoomCurPos(); + double ReadZoomAngle(); + BOOL CalibrateEncoder(); + + void OutputWithScroll(const CString &strNewText,CEdit &edtOutput); + afx_msg void OnBnClickedRadioSo7configZoomMoveFast(); + afx_msg void OnBnClickedRadioSo7configZoomMoveSlow(); + afx_msg void OnEnKillfocusEditSo7configZoomFastspeed(); + afx_msg void OnEnKillfocusEditSo7configZoomSlowspeed(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedButtonSo7configSetSubdivision(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.cpp new file mode 100644 index 0000000..b0c311d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.cpp @@ -0,0 +1,134 @@ +// So7_Option.cpp : implementation file +// + +#include "stdafx.h" +#include "resource.h" +#include "..\..\..\SevenOcean\SO7_Proto.h" +#include "ProcessButton.h" +#include "VideoCardDefine.h" +#include "..\..\..\Videocard\SDK3000\sdk3000_7130.h" +#include "Videocard_SDK3000.h" +#include "..\..\..\Videocard\SV2000E\datastru.h" +#include "..\..\..\Videocard\SV2000E\DXMediaCap.h" +#include "..\..\..\Videocard\SV2000E\dataAcq.h" +#include "Videocard_SV2000E.h" +#include "SO7_UtilDlg.h" +#include "..\..\..\Keyence\Keyence_Laser.h" +#include "..\..\..\Keyence\\Keyence_Proto.h" +#include "Keyence_UtilDlg.h" +#include "afxdialogex.h" +#include "So7_Option.h" + +CSO7_Proto* m_pSO7_Proto=NULL; +CKeyence_Laser* m_pKeyence_Laser=NULL; +CKeyence_Proto* m_pKeyence_Proto=NULL; +// CSo7_Option dialog + +IMPLEMENT_DYNAMIC(CSo7_Option, CDialog) + +CSo7_Option::CSo7_Option(CWnd* pParent /*=NULL*/) + : CDialog(CSo7_Option::IDD, pParent) +{ + +} + +CSo7_Option::~CSo7_Option() +{ +} + +void CSo7_Option::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CSo7_Option, CDialog) + ON_BN_CLICKED(IDOK, &CSo7_Option::OnBnClickedOk) + ON_BN_CLICKED(IDCANCEL, &CSo7_Option::OnBnClickedCancel) +END_MESSAGE_MAP() + + +// CSo7_Option message handlers +//================================== +BOOL CSo7_Option::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + + ((CButton *)GetDlgItem(IDC_RADIO_CONTROLLER))->SetCheck(TRUE); + ((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_SDK3000))->SetCheck(FALSE); + ((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_SV2000E))->SetCheck(FALSE); + ((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_TC4000))->SetCheck(FALSE); + + return TRUE; // return TRUE unless you set the focus to a control +} + +//=================================== +void CSo7_Option::OnBnClickedOk() +{ + if (((CButton *)GetDlgItem(IDC_RADIO_CONTROLLER))->GetCheck()) + { + if (!m_pSO7_Proto) + m_pSO7_Proto = new CSO7_Proto(); + CSO7_UtilDlg* pSO7_UtilDlg=new CSO7_UtilDlg(); + pSO7_UtilDlg->DoModal(); + delete pSO7_UtilDlg; + } + else if(((CButton *)GetDlgItem(IDC_RADIO_KEYENCE_LASER_LK_G))->GetCheck()) + { + if (!m_pSO7_Proto) + m_pSO7_Proto = new CSO7_Proto(); + if (!m_pKeyence_Proto) + m_pKeyence_Proto=new CKeyence_Proto(); + if (!m_pKeyence_Laser) + m_pKeyence_Laser = new CKeyence_Laser(); + + CKeyence_UtilDlg* pKeyence_UtilDlg=new CKeyence_UtilDlg(); + pKeyence_UtilDlg->DoModal(); + delete pKeyence_UtilDlg; + + delete m_pKeyence_Laser; + delete m_pKeyence_Proto; + delete m_pSO7_Proto; + m_pKeyence_Laser=NULL; + m_pKeyence_Proto=NULL; + m_pSO7_Proto=NULL; + } + else if (((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_SDK3000))->GetCheck()) + { + CVideocard_SDK3000* pVideocard_SDK3000=new CVideocard_SDK3000(); + pVideocard_SDK3000->DoModal(); + delete pVideocard_SDK3000; + } + else if (((CButton *)GetDlgItem(IDC_RADIO_VIDEOCARD_SV2000E))->GetCheck()) + { + CVideocard_SV2000E* pVideocard_SV2000E=new CVideocard_SV2000E(); + pVideocard_SV2000E->DoModal(); + delete pVideocard_SV2000E; + } +} + +//=================================== +void CSo7_Option::OnBnClickedCancel() +{ + CDialog::OnCancel(); +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.h new file mode 100644 index 0000000..c6e51a1 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/So7_Option.h @@ -0,0 +1,24 @@ +#pragma once + + +// CSo7_Option dialog + +class CSo7_Option : public CDialog +{ + DECLARE_DYNAMIC(CSo7_Option) + +public: + CSo7_Option(CWnd* pParent = NULL); // standard constructor + virtual ~CSo7_Option(); + +// Dialog Data + enum { IDD = IDD_S07_OPTION_DIALOG }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedCancel(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Thumbs.db b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Thumbs.db new file mode 100644 index 0000000..b47b3c9 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Thumbs.db differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj new file mode 100644 index 0000000..bfbfca7 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj @@ -0,0 +1,317 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Template + Win32 + + + Template + x64 + + + + {50B21A79-C887-4F7E-8911-7E3A685BFA25} + Mv_Util + MFCProj + Usb_Util + + + + Application + Dynamic + Unicode + true + + + Application + Dynamic + Unicode + true + + + Application + Dynamic + Unicode + + + Application + Dynamic + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + true + true + $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + $(Configuration)\ + false + false + + + + _DEBUG;%(PreprocessorDefinitions) + false + true + + + Disabled + WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + Level4 + EditAndContinue + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + ..\..\..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Lib\Msvc\libusb.lib;..\..\..\Videocard\SDK3000\sdk3000_7130.lib;..\..\..\Videocard\SV2000E\dataAcq.lib;..\..\..\Videocard\SV2000E\DXMediaCap.lib;%(AdditionalDependencies) + true + Windows + MachineX86 + + + + + _DEBUG;%(PreprocessorDefinitions) + false + + + Disabled + WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + Level4 + ProgramDatabase + true + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + ..\..\LibUsb_Win\Lib\Msvc\libusb.lib;%(AdditionalDependencies) + true + Windows + + + + + NDEBUG;%(PreprocessorDefinitions) + false + true + + + MaxSpeed + true + WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Use + Level4 + ProgramDatabase + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + true + Windows + true + true + MachineX86 + ..\..\..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Lib\Msvc\libusb.lib;..\..\..\Videocard\SDK3000\sdk3000_7130.lib;..\..\..\Videocard\SV2000E\dataAcq.lib;..\..\..\Videocard\SV2000E\DXMediaCap.lib;%(AdditionalDependencies) + + + + + NDEBUG;%(PreprocessorDefinitions) + false + + + MaxSpeed + true + WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + false + MultiThreadedDLL + true + Use + Level4 + ProgramDatabase + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + $(IntDir);%(AdditionalIncludeDirectories) + + + true + Windows + true + true + ..\..\LibUsb_Win\Lib\Msvc\libusb.lib;%(AdditionalDependencies) + + + + + + + + ..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.filters b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.filters new file mode 100644 index 0000000..8e766f8 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.filters @@ -0,0 +1,282 @@ + + + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + Sources Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + + Resource Files + + + Resource Files + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + {c3bc2e1f-c4d9-4f5e-ba7f-3e0b50a7bad3} + + + {92f99d2f-53fc-415f-b4c4-8e27f6c59303} + + + {7ce29a12-8b0d-4df6-966f-c952d8c6a5da} + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.user b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.user new file mode 100644 index 0000000..f5e1823 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Usb_Util.vcxproj.user @@ -0,0 +1,6 @@ + + + + false + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/VideoCardDefine.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/VideoCardDefine.h new file mode 100644 index 0000000..c89e152 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/VideoCardDefine.h @@ -0,0 +1,24 @@ +#pragma once + +//ת +typedef enum{ + RGB24TORGB = 0, + YUY2TORGB, + RGB24TOGRAY, + YUY2TOGRAY +}ConvertColorType; + +typedef struct Image_Buffer +{ + unsigned char ScanLine[480][640*3]; + Image_Buffer() + { + for (int i=0;i<480;i++) + { + for (int j=0;j<640*3;j++) + { + ScanLine[i][j]=0; + } + } + }; +}Image_Buffer; \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.cpp new file mode 100644 index 0000000..a525df6 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.cpp @@ -0,0 +1,505 @@ +// Videocard_SDK3000.cpp : implementation file +// + +#include "stdafx.h" +#include "resource.h" +#include "VideoCardDefine.h" +#include "..\..\..\Videocard\SDK3000\sdk3000_7130.h" +#include "Videocard_SDK3000.h" +#include "afxdialogex.h" + +static BYTE g_DataBuffer[640*480*2]; +int g_nPic(0); + +HANDLE g_hEventCap = NULL; +HANDLE g_hEventExt = NULL; +// CVideocard_SDK3000 dialog + +IMPLEMENT_DYNAMIC(CVideocard_SDK3000, CDialog) + + CVideocard_SDK3000::CVideocard_SDK3000(CWnd* pParent /*=NULL*/) + : CDialog(CVideocard_SDK3000::IDD, pParent) +{ + m_dwCard=0; + m_nDevNum=0; + m_pDev=nullptr; + m_hCapThread = NULL; + m_bMirror=FALSE; + m_ConvertColorType=YUY2TORGB; + m_bSaveFile=FALSE; +} + +CVideocard_SDK3000::~CVideocard_SDK3000() +{ +} + +void CVideocard_SDK3000::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CVideocard_SDK3000, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDOK, &CVideocard_SDK3000::OnBnClickedOk) + ON_BN_CLICKED(IDCANCEL, &CVideocard_SDK3000::OnBnClickedCancel) + ON_BN_CLICKED(IDC_RADIO_RGB, &CVideocard_SDK3000::OnBnClickedRadioRgb) + ON_BN_CLICKED(IDC_RADIO_GRAY, &CVideocard_SDK3000::OnBnClickedRadioGray) + ON_BN_CLICKED(IDC_CHECK_MIRROR_VERTICALLY, &CVideocard_SDK3000::OnBnClickedCheckMirrorVertically) + ON_BN_CLICKED(IDC_BUTTON_SAVE_PICTURE, &CVideocard_SDK3000::OnBnClickedButtonSavePicture) +END_MESSAGE_MAP() + + +// CVideocard_SDK3000 message handlers +//==================================== +BOOL CVideocard_SDK3000::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + ((CButton *)GetDlgItem(IDC_RADIO_RGB))->SetCheck(TRUE); + ((CButton *)GetDlgItem(IDC_RADIO_GRAY))->SetCheck(FALSE); + + return TRUE; // return TRUE unless you set the focus to a control +} +//====================================== +void CVideocard_SDK3000::OnBnClickedOk() +{ + LoadVideocard(); + g_hEventExt = CreateEvent(NULL , FALSE , FALSE , NULL); + m_hCapThread = CreateThread(NULL , 0 , ThreadCircleCapture , NULL , 0 , NULL); + VCAEnableCapSourceStream(m_dwCard , TRUE, Interlaced_Field, SDK3000PrcCapSourceStream); + SetTimer(1,50,NULL); + GetDlgItem(IDOK)->EnableWindow(false); +} +//========================================== +void CVideocard_SDK3000::OnBnClickedCancel() +{ + KillTimer(1); + if(m_hCapThread) + { + SetEvent(g_hEventExt); + WaitForSingleObject(m_hCapThread , INFINITE); + CloseHandle(m_hCapThread); + m_hCapThread = NULL; + CloseHandle(g_hEventExt); + g_hEventExt = NULL; + } + UnloadVideocard(); + CDialog::OnCancel(); +} +//============================================ +void CVideocard_SDK3000::OnBnClickedRadioRgb() +{ + m_ConvertColorType=YUY2TORGB; +} + +//============================================ +void CVideocard_SDK3000::OnBnClickedRadioGray() +{ + m_ConvertColorType=YUY2TOGRAY; +} + +//============================================ +void CVideocard_SDK3000::OnBnClickedCheckMirrorVertically() +{ + if (((CButton *)GetDlgItem(IDC_CHECK_MIRROR_VERTICALLY))->GetCheck()) + { + m_bMirror=TRUE; + } + else + { + m_bMirror=FALSE; + } +} + +//============================================ +void CVideocard_SDK3000::OnBnClickedButtonSavePicture() +{ + CString CTmpString; + CString PathName; + CString path_and_fileName; + + PathName=_T("SDK3000.bmp"); + CString szFilter=_T("BMP Files(*.bmp)|*.bmp|ALL Files(*.*)|*.*||"); + CFileDialog fdlg(FALSE,_T("BMP"),PathName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + + if( fdlg.DoModal()==IDOK) + { + m_SaveFile=fdlg.GetPathName(); + } + delete fdlg; + m_bSaveFile=TRUE; + +} +//======================================= +BOOL CVideocard_SDK3000::LoadVideocard() +{ + if ( VCAInitSdk() != S_OK ) + { + ::AfxMessageBox(_T("SDK3000ʼʧܣ")); + return FALSE; + } + VCAGetDevNum(&m_nDevNum); + if ( !m_nDevNum ) + { + ::AfxMessageBox(_T("ȷSDK3000Ƿװɹ")); + return FALSE; + + } + m_pDev = new DEVICE_INFO[m_nDevNum]; + + m_pDev[m_dwCard].m_cnVidSwitch = VIDEO_IN_1; + m_pDev[m_dwCard].dwCapWeight=640; + m_pDev[m_dwCard].dwCapHeight=480; + m_pDev[m_dwCard].bOpen=FALSE; + CSize szVidSize; + szVidSize.cx = m_pDev[m_dwCard].dwCapWeight; + szVidSize.cy = m_pDev[m_dwCard].dwCapHeight; + + + m_pDev[m_dwCard].bOpen = ( VCAConnectDevice( m_dwCard, + FALSE, + GetDlgItem(IDC_STATIC_SDK3000_PICTURE)->GetSafeHwnd(), + szVidSize, + m_pDev[m_dwCard].m_cnVidSwitch, + 25, VideoSubType_YUY2 ) == S_OK ); + + CString strTemp; + if(!m_pDev[m_dwCard].bOpen) + { + strTemp.Format( _T("豸%dϢ"), m_dwCard ); + ::AfxMessageBox( strTemp ); + return FALSE; + } + + VCAGetVideoPropertyValue( m_dwCard, VideoProperty_Sharpness, + &m_pDev[m_dwCard].stuSharpness ); + + VCAGetVideoPropertyValue( m_dwCard, VideoProperty_Saturation, + &m_pDev[m_dwCard].stuSaturation ); + + VCAGetVideoPropertyValue( m_dwCard, VideoProperty_Hue, + &m_pDev[m_dwCard].stuHue ); + + VCAGetVideoPropertyValue( m_dwCard, VideoProperty_Contrast, + &m_pDev[m_dwCard].stuContrast ); + + VCAGetVideoPropertyValue( m_dwCard, VideoProperty_Brightness, + &m_pDev[m_dwCard].stuBrightness ); + + VCASetVideoPropertyValue( m_dwCard, VideoProperty_Brightness, + BrightnessDefault); + + VCASetVideoPropertyValue( m_dwCard, VideoProperty_Saturation, + SaturationDefault); + + VCASetVideoPropertyValue( m_dwCard, VideoProperty_Contrast, + ContrastDefault); + + VCASetVideoPropertyValue( m_dwCard, VideoProperty_Hue, + HueDefault ); + + VCASetVideoPropertyValue( m_dwCard, VideoProperty_Sharpness, + SharpnessDefault - 5); + + return TRUE; +} + +//======================================= +BOOL CVideocard_SDK3000::UnloadVideocard() +{ + VCAEnableCapSourceStream(m_dwCard , FALSE, Interlaced_Field, SDK3000PrcCapSourceStream); + VCADisConnectDevice(m_dwCard); + VCAUnInitSdk(); + + if ( m_pDev ) + { + delete[] m_pDev; + m_pDev = NULL; + } + return TRUE; +} +//================================================================ +void CVideocard_SDK3000::ConvertVideoSubType(const Image_Buffer& _ImageBuffer, BYTE *_pSrcData,ConvertColorType _type,BOOL _bMirror) +{ + int x=0; + int y=0; + long lCnt1=0; + long lCnt2=0; + long lCnt3=0; + int Color_R=0,Color_G=0,Color_B=0; + BYTE *pDstData=NULL; + for(y=0;y<480;y++) + { + lCnt1=0; + if(_bMirror) + pDstData=(BYTE*)_ImageBuffer.ScanLine[479-y]; + else + pDstData=(BYTE*)_ImageBuffer.ScanLine[y]; + for(x=0;x<640*3;x+=3) + { + switch(_type) + { + case RGB24TORGB: + { + pDstData[x+2]=_pSrcData[y*640*3+x+2]; + pDstData[x+1]=_pSrcData[y*640*3+x+1]; + pDstData[x]=_pSrcData[y*640*3+x]; + break; + } + case YUY2TORGB: + { + Color_R=(1164*(_pSrcData[lCnt2*2]-16)+1596*(_pSrcData[lCnt3+3]-128))/1000; + if(Color_R>255)Color_R=255; + if(Color_R<0)Color_R=0; + pDstData[x+2]=static_cast(Color_R); + + + Color_G=(1164*(_pSrcData[lCnt2*2]-16)-813*(_pSrcData[lCnt3+1]-128)-392*(_pSrcData[lCnt3+3]-128))/1000; + if(Color_G>255)Color_G=255; + if(Color_G<0)Color_G=0; + pDstData[x+1]=static_cast(Color_G); + + + Color_B=(1164*(_pSrcData[lCnt2*2]-16)+2017*(_pSrcData[lCnt3+1]-128))/1000; + if(Color_B>255)Color_B=255; + if(Color_B<0)Color_B=0; + pDstData[x]=static_cast(Color_B); + + break; + } + case RGB24TOGRAY: + { + pDstData[x+2]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + pDstData[x+1]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + pDstData[x]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + break; + } + case YUY2TOGRAY: + { + pDstData[x+2]=_pSrcData[2*lCnt2]; + pDstData[x+1]=_pSrcData[2*lCnt2]; + pDstData[x]=_pSrcData[2*lCnt2]; + break; + } + } + if((lCnt1%2)==1) + lCnt3=lCnt3+4; + lCnt2++; + lCnt1++; + } + } +} +//================================================================ +BOOL CVideocard_SDK3000::SaveBitmapToFile(const CBitmap& _bitmap, CString _lpFileName) +{ + HBITMAP hBitmap; // ΪղŵĻλͼ + HDC hDC; //豸 + int iBits; //ǰʾֱÿռֽ + WORD wBitCount(24); //λͼÿռֽ + DWORD dwPaletteSize = 0, //ɫС + dwBmBitsSize, //λͼֽڴС + dwDIBSize, //λͼļС + dwWritten; //дļֽ + BITMAP Bitmap; //λͼԽṹ + BITMAPFILEHEADER bmhFiledr; //λͼļͷṹ + BITMAPINFOHEADER bi; //λͼϢͷṹ + LPBITMAPINFOHEADER lpbi; //ָλͼϢͷṹ + HANDLE hFile, //ļ + hDib, //ڴ + hPal, //ɫ + hOldPal = NULL; + + //λͼļÿռֽ + hBitmap = (HBITMAP)_bitmap; + hDC = CreateDC(_T("DISPLAY"),NULL,NULL,NULL); + iBits = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES); + DeleteDC(hDC); + + if (iBits <= 1) + wBitCount = 1; + else if (iBits <= 4) + wBitCount = 4; + else if (iBits <= 8) + wBitCount = 8; + else if (iBits <= 24) + wBitCount = 24; + else if (iBits <= 32) + wBitCount = 32; + + //ɫС + if (wBitCount <= 8) + dwPaletteSize = (1 << wBitCount) * sizeof (RGBQUAD); + + //λͼϢͷṹ + GetObject(hBitmap, sizeof (BITMAP), (LPSTR)&Bitmap); + bi.biSize = sizeof (BITMAPINFOHEADER); + bi.biWidth = Bitmap.bmWidth; + bi.biHeight = Bitmap.bmHeight; + bi.biPlanes = 1; + bi.biBitCount = wBitCount; + bi.biCompression = BI_RGB; + bi.biSizeImage = 0; + bi.biXPelsPerMeter = 0; + bi.biYPelsPerMeter = 0; + bi.biClrUsed = 0; + bi.biClrImportant = 0; + + dwBmBitsSize = ((Bitmap.bmWidth * wBitCount+31) / 32) * 4 * Bitmap.bmHeight; + + //Ϊλͼݷڴ + hDib = GlobalAlloc(GHND, dwBmBitsSize + dwPaletteSize + sizeof (BITMAPINFOHEADER)); + lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDib); + *lpbi = bi; + + // ɫ + hPal = GetStockObject(DEFAULT_PALETTE); + if (hPal) + { + hDC = ::GetDC(NULL); + hOldPal = ::SelectPalette(hDC, (HPALETTE)hPal, FALSE); + RealizePalette(hDC); + } + + // ȡõɫµֵ + GetDIBits(hDC, hBitmap, 0, (UINT) Bitmap.bmHeight, (LPSTR)lpbi + sizeof (BITMAPINFOHEADER) + dwPaletteSize, (LPBITMAPINFO)lpbi, DIB_RGB_COLORS); + + //ָɫ + if (hOldPal) + { + SelectPalette(hDC, (HPALETTE)hOldPal, TRUE); + RealizePalette(hDC); + ::ReleaseDC(NULL, hDC); + } + + //λͼļ + hFile = CreateFile(_lpFileName, GENERIC_WRITE, + 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return FALSE; + + // λͼļͷ + bmhFiledr.bfType = 0x4D42; // "BM" + dwDIBSize = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER) + dwPaletteSize + dwBmBitsSize; + bmhFiledr.bfSize = dwDIBSize; + bmhFiledr.bfReserved1 = 0; + bmhFiledr.bfReserved2 = 0; + bmhFiledr.bfOffBits = (DWORD)sizeof (BITMAPFILEHEADER) + (DWORD)sizeof (BITMAPINFOHEADER) + dwPaletteSize; + + // дλͼļͷ + WriteFile(hFile, (LPSTR)&bmhFiledr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL); + + // дλͼļ + WriteFile(hFile, (LPSTR)lpbi, dwDIBSize,&dwWritten, NULL); + + // + GlobalUnlock(hDib); + GlobalFree(hDib); + CloseHandle(hFile); + + return TRUE; +}; +//================================================================ +void CVideocard_SDK3000::OnPaint() +{ + CDC* dc= this->GetDC(); + int nMode; + CDC* pMemDC = new CDC; + CBitmap pBitBmp; + ConvertVideoSubType(m_ImageBuffer,g_DataBuffer,m_ConvertColorType,m_bMirror); + BYTE *pData = (BYTE *)m_ImageBuffer.ScanLine; + BITMAPINFO bmpInfo; + bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmpInfo.bmiHeader.biWidth = 640; + bmpInfo.bmiHeader.biHeight = 480; + bmpInfo.bmiHeader.biPlanes = 1; + bmpInfo.bmiHeader.biBitCount = 24;//Xλɫ + bmpInfo.bmiHeader.biCompression = BI_RGB; + bmpInfo.bmiHeader.biSizeImage = 0; + bmpInfo.bmiHeader.biXPelsPerMeter = 30000; + bmpInfo.bmiHeader.biYPelsPerMeter = 30000; + bmpInfo.bmiHeader.biClrUsed = 0; + bmpInfo.bmiHeader.biClrImportant = 0; + + pBitBmp.CreateCompatibleBitmap(dc,640,480); + SetDIBits(dc->m_hDC,pBitBmp,0,480,pData,&bmpInfo,DIB_RGB_COLORS); + if (m_bSaveFile) + { + SaveBitmapToFile(pBitBmp,m_SaveFile); + //CImage imgTemp; + //imgTemp.Attach(pBitBmp.operator HBITMAP()); + //imgTemp.Save(m_SaveFile); + m_bSaveFile=FALSE; + } + + if (!pMemDC->m_hDC) + { + pMemDC->CreateCompatibleDC(dc); + } + CBitmap* pOldBitmap = pMemDC->SelectObject(&pBitBmp); + nMode = pMemDC->SetBkMode(TRANSPARENT); + + dc->BitBlt(0, 0, 640, 480, pMemDC,0,0, SRCCOPY); + + pMemDC->SetBkMode(nMode); + pMemDC->SelectObject(pOldBitmap); + ReleaseDC(pMemDC); + delete pMemDC; + ReleaseDC(dc); +} +//================================================================================================ +void CVideocard_SDK3000::OnTimer(UINT_PTR nIDEvent) +{ + switch(nIDEvent) + { + case 1: + { + OnPaint(); + break; + } + } + + CDialog::OnTimer(nIDEvent); +} +//========================================== +void CALLBACK SDK3000PrcCapSourceStream( long lnCardID, long pBuf, long lnWidth, long lnHeight, long lnBiCount ) +{ + UNREFERENCED_PARAMETER(lnCardID); + memcpy(g_DataBuffer,(BYTE*)pBuf,lnWidth*lnHeight*lnBiCount); +}; +//========================================= +DWORD WINAPI ThreadCircleCapture(LPVOID lpParam) +{ + UNREFERENCED_PARAMETER(lpParam); + while(true) + { + DWORD dwRet = WaitForSingleObject(g_hEventExt , 0); + if(WAIT_OBJECT_0 == dwRet) + break; + int nFType ; + nFType= true ? 1 : 2; + //while(g_pPicBuf->SaveCapPicToFile(nFType)); + } + return 0; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.h new file mode 100644 index 0000000..1932624 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SDK3000.h @@ -0,0 +1,71 @@ +#pragma once + +typedef struct DEVICE_INFO +{ + HWND hWnd; + BOOL bOpen; + DWORD dwCard; + DWORD dwRealFrameRate; + DWORD dwFileNum; + DWORD dwFrameRate; + DWORD dwCapHeight; + DWORD dwCapWeight; + VIDEOPROPERTYRANGE stuSharpness; + VIDEOPROPERTYRANGE stuSaturation; + VIDEOPROPERTYRANGE stuHue; + VIDEOPROPERTYRANGE stuContrast; + VIDEOPROPERTYRANGE stuBrightness; + BOOL bNetTrans; + BOOL bFrameRateReduction; + BOOL bMotionDetect; + VIDEOSOURCE m_cnVidSwitch; + +}Device_Info; +//========================================= +DWORD WINAPI ThreadCircleCapture(LPVOID lpParam); +//========================================== +void CALLBACK SDK3000PrcCapSourceStream( long lnCardID, long pBuf, long lnWidth, long lnHeight, long lnBiCount ); +// CVideocard_SDK3000 dialog + +class CVideocard_SDK3000 : public CDialog +{ + DECLARE_DYNAMIC(CVideocard_SDK3000) + +public: + CVideocard_SDK3000(CWnd* pParent = NULL); // standard constructor + virtual ~CVideocard_SDK3000(); + +// Dialog Data + enum { IDD = IDD_SO7_VIDEOCARD_SDK3000 }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + DECLARE_MESSAGE_MAP() +public: + BOOL LoadVideocard(); + BOOL UnloadVideocard(); + void ConvertVideoSubType(const Image_Buffer& _ImageBuffer, BYTE *pSrcData,ConvertColorType _type,BOOL _bMirror); + BOOL SaveBitmapToFile(const CBitmap& bitmap, CString lpFileName); + +protected: + int m_nDevNum; + Device_Info* m_pDev; + DWORD m_dwCard; + RECT m_rcShowWin; + Image_Buffer m_ImageBuffer; + ConvertColorType m_ConvertColorType; + BOOL m_bMirror; + BOOL m_bSaveFile; + CString m_SaveFile; +public: + HANDLE m_hCapThread; + afx_msg void OnBnClickedOk(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedRadioRgb(); + afx_msg void OnBnClickedRadioGray(); + afx_msg void OnBnClickedCheckMirrorVertically(); + afx_msg void OnBnClickedButtonSavePicture(); +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.cpp new file mode 100644 index 0000000..c420b0d --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.cpp @@ -0,0 +1,480 @@ +// Videocard_SV2000E.cpp : implementation file +// + +#include "stdafx.h" +#include "resource.h" +#include "VideoCardDefine.h" +#include "..\..\..\Videocard\SV2000E\datastru.h" +#include "..\..\..\Videocard\SV2000E\DXMediaCap.h" +#include "..\..\..\Videocard\SV2000E\dataAcq.h" +#include "Videocard_SV2000E.h" +#include "afxdialogex.h" + +static const long BrightnessDefault = 5000; +static const long ContrastDefault = 5000; +static const long SaturationDefault = 5000; +static const long HueDefault = 5000; +static const long SharpnessDefault = 4; + +//Ƶʽ +typedef enum +{ + VideoStandard_None = 0x00000000, + VideoStandard_NTSC_M = 0x00000001, + VideoStandard_NTSC_M_J = 0x00000002, + VideoStandard_NTSC_433 = 0x00000004, + VideoStandard_PAL_B = 0x00000010, + VideoStandard_PAL_D = 0x00000020, + VideoStandard_PAL_H = 0x00000080, + VideoStandard_PAL_I = 0x00000100, + VideoStandard_PAL_M = 0x00000200, + VideoStandard_PAL_N = 0x00000400, + VideoStandard_PAL_60 = 0x00000800, + VideoStandard_SECAM_B = 0x00001000, + VideoStandard_SECAM_D = 0x00002000, + VideoStandard_SECAM_G = 0x00004000, + VideoStandard_SECAM_H = 0x00008000, + VideoStandard_SECAM_K = 0x00010000, + VideoStandard_SECAM_K1 = 0x00020000, + VideoStandard_SECAM_L = 0x00040000, + VideoStandard_SECAM_L1 = 0x00080000, +} VideoStandard; +static BYTE g_DataBuffer[640*480*2]; +// CVideocard_SV2000E dialog + +IMPLEMENT_DYNAMIC(CVideocard_SV2000E, CDialog) + +CVideocard_SV2000E::CVideocard_SV2000E(CWnd* pParent /*=NULL*/) + : CDialog(CVideocard_SV2000E::IDD, pParent) +{ + m_device=NULL; + m_dwCard=0; + m_nDevNum=0; + m_bMirror=FALSE; + m_ConvertColorType=YUY2TORGB; + m_bSaveFile=FALSE; +} + +CVideocard_SV2000E::~CVideocard_SV2000E() +{ +} + +void CVideocard_SV2000E::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); +} + + +BEGIN_MESSAGE_MAP(CVideocard_SV2000E, CDialog) + ON_WM_TIMER() + ON_BN_CLICKED(IDC_RADIO_SV2000E_RGB, &CVideocard_SV2000E::OnBnClickedRadioSv2000eRgb) + ON_BN_CLICKED(IDC_RADIO_SV2000E_GRAY, &CVideocard_SV2000E::OnBnClickedRadioSv2000eGray) + ON_BN_CLICKED(IDC_CHECK_SV2000E_MIRROR_VERTICALLY, &CVideocard_SV2000E::OnBnClickedCheckSv2000eMirrorVertically) + ON_BN_CLICKED(IDC_BUTTON_SV2000E_SAVEFILE, &CVideocard_SV2000E::OnBnClickedButtonSv2000eSavefile) + ON_BN_CLICKED(IDCANCEL, &CVideocard_SV2000E::OnBnClickedCancel) + ON_BN_CLICKED(IDOK, &CVideocard_SV2000E::OnBnClickedOk) +END_MESSAGE_MAP() + + +// CVideocard_SV2000E message handlers +//==================================== +BOOL CVideocard_SV2000E::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Add "About..." menu item to system menu. + + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); + + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != NULL) + { + BOOL bNameValid; + CString strAboutMenu; + bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); + ASSERT(bNameValid); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } + ((CButton *)GetDlgItem(IDC_RADIO_SV2000E_RGB))->SetCheck(TRUE); + ((CButton *)GetDlgItem(IDC_RADIO_SV2000E_GRAY))->SetCheck(FALSE); + + return TRUE; // return TRUE unless you set the focus to a control +} +//=================================================== +void CVideocard_SV2000E::OnBnClickedOk() +{ + LoadVideocard(); + SetTimer(1,50,NULL); + GetDlgItem(IDOK)->EnableWindow(false); +} +//=================================================== +void CVideocard_SV2000E::OnBnClickedCancel() +{ + UnloadVideocard(); + CDialog::OnCancel(); +} +//=================================================== +void CVideocard_SV2000E::OnBnClickedRadioSv2000eRgb() +{ + m_ConvertColorType=YUY2TORGB; +} + +//=================================================== +void CVideocard_SV2000E::OnBnClickedRadioSv2000eGray() +{ + m_ConvertColorType=YUY2TOGRAY; +} + +//=================================================== +void CVideocard_SV2000E::OnBnClickedCheckSv2000eMirrorVertically() +{ + if (((CButton *)GetDlgItem(IDC_CHECK_MIRROR_VERTICALLY))->GetCheck()) + { + m_bMirror=TRUE; + } + else + { + m_bMirror=FALSE; + } +} +//=================================================== +void CVideocard_SV2000E::OnBnClickedButtonSv2000eSavefile() +{ + CString CTmpString; + CString PathName; + CString path_and_fileName; + + PathName=_T("SV2000E.bmp"); + CString szFilter=_T("BMP Files(*.bmp)|*.bmp|ALL Files(*.*)|*.*||"); + CFileDialog fdlg(FALSE,_T("BMP"),PathName,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter); + + if( fdlg.DoModal()==IDOK) + { + m_SaveFile=fdlg.GetPathName(); + } + delete fdlg; + m_bSaveFile=TRUE; +} + +//======================================= +BOOL CVideocard_SV2000E::LoadVideocard() +{ + unsigned int bInitSdk=DXInitialize(); + + DEVICE_TAG devTags[100]; + unsigned num = 100; + DXEnumVideoCodecs(devTags, num); + //DXEnumAudioCodecs(devTags, num); + //DXEnumVideoDevices(devTags, num); + //DXEnumAudioDevices(devTags, num); + //DXEnumSoundDevices(devTags, num); + + m_nDevNum = DXGetDeviceCount(); + m_device= DXOpenDevice(0, NULL); + if((bInitSdk!=0)||(m_nDevNum<1)||(m_device==NULL)) + { + ::AfxMessageBox(_T("SV2000Eʼʧܣ")); + return FALSE; + } + + unsigned standard(VideoStandard_PAL_D); + unsigned colorspace(cs_yuy2);//cs_rgb24 + unsigned width(640);//640 + unsigned height(480);//480 + float framerate(25); + m_status=DXSetVideoPara(m_device,standard,colorspace,width,height,framerate); + + DXDeviceRun(m_device); + + m_dwCard=2; + m_status=DXSetVideoSource(m_device, 1); + + //======================================================================= + m_status=DXSetVideoPara(m_device,standard,colorspace,width,height,framerate); + //================================================================================ + m_status=DXSetDisplayPara( m_device, BRIGHTNESS, 5000,2); + m_status=DXSetDisplayPara( m_device, SATURATION, 5000,2); + m_status=DXSetDisplayPara( m_device, CONTRAST, 5000,2); + m_status=DXSetDisplayPara( m_device, HUE, 5000,2); + m_status=DXSetDisplayPara( m_device, SHARPNESS, 4,2); + + m_status=DXSetRawVideoCallback(m_device, SVAPrcVidCapCallBack, this); + m_status=DXStartRawVideoCallback(m_device,SVAPrcVidCapCallBack,this); + return true; + + return TRUE; +} + +//======================================= +BOOL CVideocard_SV2000E::UnloadVideocard() +{ + if (m_device) + { + m_status=DXStopRawVideoCallback(m_device); + m_status=DXSetRawVideoCallback(m_device, NULL, NULL); + m_status=DXDeviceStop(m_device); + DXCloseDevice(m_device); + DXUninitialize(); + } + return TRUE; +} +//================================================================ +void CVideocard_SV2000E::ConvertVideoSubType(const Image_Buffer& _ImageBuffer, BYTE *_pSrcData,ConvertColorType _type,BOOL _bMirror) +{ + int x=0; + int y=0; + long lCnt1=0; + long lCnt2=0; + long lCnt3=0; + int Color_R=0,Color_G=0,Color_B=0; + BYTE *pDstData=NULL; + for(y=0;y<480;y++) + { + lCnt1=0; + if(_bMirror) + pDstData=(BYTE*)_ImageBuffer.ScanLine[479-y]; + else + pDstData=(BYTE*)_ImageBuffer.ScanLine[y]; + for(x=0;x<640*3;x+=3) + { + switch(_type) + { + case RGB24TORGB: + { + pDstData[x+2]=_pSrcData[y*640*3+x+2]; + pDstData[x+1]=_pSrcData[y*640*3+x+1]; + pDstData[x]=_pSrcData[y*640*3+x]; + break; + } + case YUY2TORGB: + { + Color_R=(1164*(_pSrcData[lCnt2*2]-16)+1596*(_pSrcData[lCnt3+3]-128))/1000; + if(Color_R>255)Color_R=255; + if(Color_R<0)Color_R=0; + pDstData[x+2]=static_cast(Color_R); + + + Color_G=(1164*(_pSrcData[lCnt2*2]-16)-813*(_pSrcData[lCnt3+1]-128)-392*(_pSrcData[lCnt3+3]-128))/1000; + if(Color_G>255)Color_G=255; + if(Color_G<0)Color_G=0; + pDstData[x+1]=static_cast(Color_G); + + + Color_B=(1164*(_pSrcData[lCnt2*2]-16)+2017*(_pSrcData[lCnt3+1]-128))/1000; + if(Color_B>255)Color_B=255; + if(Color_B<0)Color_B=0; + pDstData[x]=static_cast(Color_B); + + break; + } + case RGB24TOGRAY: + { + pDstData[x+2]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + pDstData[x+1]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + pDstData[x]=(_pSrcData[lCnt2*3+2]+_pSrcData[lCnt2*3+1]+_pSrcData[lCnt2*3])/3; + break; + } + case YUY2TOGRAY: + { + pDstData[x+2]=_pSrcData[2*lCnt2]; + pDstData[x+1]=_pSrcData[2*lCnt2]; + pDstData[x]=_pSrcData[2*lCnt2]; + break; + } + } + if((lCnt1%2)==1) + lCnt3=lCnt3+4; + lCnt2++; + lCnt1++; + } + } +} +//================================================================ +BOOL CVideocard_SV2000E::SaveBitmapToFile(const CBitmap& _bitmap, CString _lpFileName) +{ + HBITMAP hBitmap; // ΪղŵĻλͼ + HDC hDC; //豸 + int iBits; //ǰʾֱÿռֽ + WORD wBitCount(24); //λͼÿռֽ + DWORD dwPaletteSize = 0, //ɫС + dwBmBitsSize, //λͼֽڴС + dwDIBSize, //λͼļС + dwWritten; //дļֽ + BITMAP Bitmap; //λͼԽṹ + BITMAPFILEHEADER bmhFiledr; //λͼļͷṹ + BITMAPINFOHEADER bi; //λͼϢͷṹ + LPBITMAPINFOHEADER lpbi; //ָλͼϢͷṹ + HANDLE hFile, //ļ + hDib, //ڴ + hPal, //ɫ + hOldPal = NULL; + + //λͼļÿռֽ + hBitmap = (HBITMAP)_bitmap; + hDC = CreateDC(_T("DISPLAY"),NULL,NULL,NULL); + iBits = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES); + DeleteDC(hDC); + + if (iBits <= 1) + wBitCount = 1; + else if (iBits <= 4) + wBitCount = 4; + else if (iBits <= 8) + wBitCount = 8; + else if (iBits <= 24) + wBitCount = 24; + else if (iBits <= 32) + wBitCount = 32; + + //ɫС + if (wBitCount <= 8) + dwPaletteSize = (1 << wBitCount) * sizeof (RGBQUAD); + + //λͼϢͷṹ + GetObject(hBitmap, sizeof (BITMAP), (LPSTR)&Bitmap); + bi.biSize = sizeof (BITMAPINFOHEADER); + bi.biWidth = Bitmap.bmWidth; + bi.biHeight = Bitmap.bmHeight; + bi.biPlanes = 1; + bi.biBitCount = wBitCount; + bi.biCompression = BI_RGB; + bi.biSizeImage = 0; + bi.biXPelsPerMeter = 0; + bi.biYPelsPerMeter = 0; + bi.biClrUsed = 0; + bi.biClrImportant = 0; + + dwBmBitsSize = ((Bitmap.bmWidth * wBitCount+31) / 32) * 4 * Bitmap.bmHeight; + + //Ϊλͼݷڴ + hDib = GlobalAlloc(GHND, dwBmBitsSize + dwPaletteSize + sizeof (BITMAPINFOHEADER)); + lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDib); + *lpbi = bi; + + // ɫ + hPal = GetStockObject(DEFAULT_PALETTE); + if (hPal) + { + hDC = ::GetDC(NULL); + hOldPal = ::SelectPalette(hDC, (HPALETTE)hPal, FALSE); + RealizePalette(hDC); + } + + // ȡõɫµֵ + GetDIBits(hDC, hBitmap, 0, (UINT) Bitmap.bmHeight, (LPSTR)lpbi + sizeof (BITMAPINFOHEADER) + dwPaletteSize, (LPBITMAPINFO)lpbi, DIB_RGB_COLORS); + + //ָɫ + if (hOldPal) + { + SelectPalette(hDC, (HPALETTE)hOldPal, TRUE); + RealizePalette(hDC); + ::ReleaseDC(NULL, hDC); + } + + //λͼļ + hFile = CreateFile(_lpFileName, GENERIC_WRITE, + 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); + + if (hFile == INVALID_HANDLE_VALUE) + return FALSE; + + // λͼļͷ + bmhFiledr.bfType = 0x4D42; // "BM" + dwDIBSize = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER) + dwPaletteSize + dwBmBitsSize; + bmhFiledr.bfSize = dwDIBSize; + bmhFiledr.bfReserved1 = 0; + bmhFiledr.bfReserved2 = 0; + bmhFiledr.bfOffBits = (DWORD)sizeof (BITMAPFILEHEADER) + (DWORD)sizeof (BITMAPINFOHEADER) + dwPaletteSize; + + // дλͼļͷ + WriteFile(hFile, (LPSTR)&bmhFiledr, sizeof(BITMAPFILEHEADER), &dwWritten, NULL); + + // дλͼļ + WriteFile(hFile, (LPSTR)lpbi, dwDIBSize,&dwWritten, NULL); + + // + GlobalUnlock(hDib); + GlobalFree(hDib); + CloseHandle(hFile); + + return TRUE; +}; +//================================================================ +void CVideocard_SV2000E::OnPaint() +{ + CDC* dc= this->GetDC(); + int nMode; + CDC* pMemDC = new CDC; + CBitmap pBitBmp; + ConvertVideoSubType(m_ImageBuffer,g_DataBuffer,m_ConvertColorType,m_bMirror); + BYTE *pData = (BYTE *)m_ImageBuffer.ScanLine; + BITMAPINFO bmpInfo; + bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmpInfo.bmiHeader.biWidth = 640; + bmpInfo.bmiHeader.biHeight = 480; + bmpInfo.bmiHeader.biPlanes = 1; + bmpInfo.bmiHeader.biBitCount = 24;//Xλɫ + bmpInfo.bmiHeader.biCompression = BI_RGB; + bmpInfo.bmiHeader.biSizeImage = 0; + bmpInfo.bmiHeader.biXPelsPerMeter = 30000; + bmpInfo.bmiHeader.biYPelsPerMeter = 30000; + bmpInfo.bmiHeader.biClrUsed = 0; + bmpInfo.bmiHeader.biClrImportant = 0; + + pBitBmp.CreateCompatibleBitmap(dc,640,480); + SetDIBits(dc->m_hDC,pBitBmp,0,480,pData,&bmpInfo,DIB_RGB_COLORS); + if (m_bSaveFile) + { + SaveBitmapToFile(pBitBmp,m_SaveFile); + //CImage imgTemp; + //imgTemp.Attach(pBitBmp.operator HBITMAP()); + //imgTemp.Save(m_SaveFile); + m_bSaveFile=FALSE; + } + + if (!pMemDC->m_hDC) + { + pMemDC->CreateCompatibleDC(dc); + } + CBitmap* pOldBitmap = pMemDC->SelectObject(&pBitBmp); + nMode = pMemDC->SetBkMode(TRANSPARENT); + + dc->BitBlt(0, 0, 640, 480, pMemDC,0,0, SRCCOPY); + + pMemDC->SetBkMode(nMode); + pMemDC->SelectObject(pOldBitmap); + ReleaseDC(pMemDC); + delete pMemDC; + ReleaseDC(dc); +} +//================================================================================================ +void CVideocard_SV2000E::OnTimer(UINT_PTR nIDEvent) +{ + switch(nIDEvent) + { + case 1: + { + OnPaint(); + break; + } + } + + CDialog::OnTimer(nIDEvent); +} + +//==================================SV2000E===================================== +unsigned CALLBACK SVAPrcVidCapCallBack(unsigned char* buffer, unsigned colorSpace, unsigned width, unsigned height, unsigned bytesWidth, void* context) +{ + UNREFERENCED_PARAMETER(colorSpace); + UNREFERENCED_PARAMETER(context); + UNREFERENCED_PARAMETER(bytesWidth); + memcpy(g_DataBuffer,(BYTE*)buffer,width*height*2); + return 0; +} diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.h new file mode 100644 index 0000000..64b53f3 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Videocard_SV2000E.h @@ -0,0 +1,46 @@ +#pragma once + + +// CVideocard_SV2000E dialog +unsigned CALLBACK SVAPrcVidCapCallBack(unsigned char* buffer, unsigned colorSpace, unsigned width, unsigned height, unsigned bytesWidth, void* context); +class CVideocard_SV2000E : public CDialog +{ + DECLARE_DYNAMIC(CVideocard_SV2000E) + +public: + CVideocard_SV2000E(CWnd* pParent = NULL); // standard constructor + virtual ~CVideocard_SV2000E(); + +// Dialog Data + enum { IDD = IDD_SO7_VIDEOCARD_SV2000E }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg void OnTimer(UINT_PTR nIDEvent); + DECLARE_MESSAGE_MAP() +public: + afx_msg void OnBnClickedRadioSv2000eRgb(); + afx_msg void OnBnClickedRadioSv2000eGray(); + afx_msg void OnBnClickedCheckSv2000eMirrorVertically(); + afx_msg void OnBnClickedButtonSv2000eSavefile(); + afx_msg void OnBnClickedCancel(); + afx_msg void OnBnClickedOk(); +protected: + unsigned int m_status; + device_handle m_device; + int m_nDevNum; + DWORD m_dwCard; + Image_Buffer m_ImageBuffer; + ConvertColorType m_ConvertColorType; + BOOL m_bMirror; + BOOL m_bSaveFile; + CString m_SaveFile; +public: + BOOL LoadVideocard(); + BOOL UnloadVideocard(); + void ConvertVideoSubType(const Image_Buffer& _ImageBuffer, BYTE *pSrcData,ConvertColorType _type,BOOL _bMirror); + BOOL SaveBitmapToFile(const CBitmap& bitmap, CString lpFileName); + +}; diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.read.1.tlog new file mode 100644 index 0000000..ceb2cdc Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.write.1.tlog new file mode 100644 index 0000000..5b5bddf Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/CL.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/cl.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/cl.command.1.tlog new file mode 100644 index 0000000..9c230c3 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/cl.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb-dll.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb-dll.log new file mode 100644 index 0000000..6224b03 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb-dll.log @@ -0,0 +1,69 @@ +Build started 4/21/2012 6:31:52 AM. + 1>Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lastbuildstate". + InitializeBuildStatus: + Creating "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /I..\src\driver /ZI /nologo /W3 /WX- /Od /Oy- /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"libusb0\"" /D TARGETTYPE=DYNLINK /D _WINDLL /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\\" /Fd"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\src\descriptors.c ..\src\error.c ..\src\install.c ..\src\registry.c ..\src\usb.c ..\src\windows.c + windows.c + usb.c + registry.c + install.c + error.c + descriptors.c + Generating Code... + ResourceCompile: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"libusb0\"" /D "MANIFEST_FILE=\"..\\manifest_x86.xml\"" /l"0x0409" /I..\src /nologo /fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\resource.res" ..\src\resource.rc + Link: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.dll" /NOLOGO setupapi.lib kernel32.lib advapi32.lib user32.lib shell32.lib gdi32.lib /DEF:"..\libusb0.def" /MANIFEST:NO /DEBUG /PDB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib" /MACHINE:X86 /DLL E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\resource.res + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\descriptors.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\error.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\install.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\registry.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\usb.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\windows.obj + Creating library E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib and object E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp + libusb-dll.vcxproj -> E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.dll + PostBuildEvent: + copy E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\*.* ..\..\LibUsb_Win\Lib\Msvc\*.* + :VCEnd + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\cl.command.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.read.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.write.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\descriptors.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\error.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\install.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb-dll.log + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.Build.CppClean.log + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.dll + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.ilk + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lastbuildstate + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.pdb + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.unsuccessfulbuild + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.write.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.read.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.write.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.command.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.read.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.write.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.command.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.read.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.write.1.tlog + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\registry.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\resource.res + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\usb.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.idb + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.pdb + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\windows.obj + 30 file(s) copied. + FinalizeBuildStatus: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.unsuccessfulbuild". + Touching "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lastbuildstate". + 1>Done Building Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:09.29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.Build.CppClean.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.Build.CppClean.log new file mode 100644 index 0000000..c2cf565 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.Build.CppClean.log @@ -0,0 +1,26 @@ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\cl.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\DESCRIPTORS.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\ERROR.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\INSTALL.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.DLL +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.ILK +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.PDB +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\REGISTRY.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\RESOURCE.RES +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\USB.OBJ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.idb +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\VC100.PDB +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\WINDOWS.OBJ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.exp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.exp new file mode 100644 index 0000000..f8a951b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.exp differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lastbuildstate b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lastbuildstate new file mode 100644 index 0000000..5213ef2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\| diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lib b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lib new file mode 100644 index 0000000..c3b08f4 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.write.1.tlog new file mode 100644 index 0000000..590bb82 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.command.1.tlog new file mode 100644 index 0000000..b191aef Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.read.1.tlog new file mode 100644 index 0000000..0c66717 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.write.1.tlog new file mode 100644 index 0000000..07e8990 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/link.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.command.1.tlog new file mode 100644 index 0000000..859bb35 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.read.1.tlog new file mode 100644 index 0000000..b92ea77 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.write.1.tlog new file mode 100644 index 0000000..5c08e30 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/rc.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/resource.res b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/resource.res differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/vc100.idb b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/vc100.idb new file mode 100644 index 0000000..67cfd25 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/libusb0/vc100.idb differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.read.1.tlog new file mode 100644 index 0000000..23efa76 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.write.1.tlog new file mode 100644 index 0000000..24bc1fe Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/CL.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache new file mode 100644 index 0000000..a3cc357 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/cl.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/cl.command.1.tlog new file mode 100644 index 0000000..c05da7a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/cl.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.command.1.tlog new file mode 100644 index 0000000..1bf5072 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.read.1.tlog new file mode 100644 index 0000000..318ee25 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.write.1.tlog new file mode 100644 index 0000000..4db4f0b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/link.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.command.1.tlog new file mode 100644 index 0000000..c272867 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.read.1.tlog new file mode 100644 index 0000000..c010f30 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.write.1.tlog new file mode 100644 index 0000000..ddde849 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/mt.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.command.1.tlog new file mode 100644 index 0000000..d74e35a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.read.1.tlog new file mode 100644 index 0000000..fcf5f2a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.write.1.tlog new file mode 100644 index 0000000..6307d2c Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/rc.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log new file mode 100644 index 0000000..6e4af70 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log @@ -0,0 +1,24 @@ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\cl.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\CL.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\CL.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link-cvtres.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link-cvtres.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN_RC.RES +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.INTERMEDIATE.MANIFEST +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.MANIFEST +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.ILK +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.PDB +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\vc100.idb +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\VC100.PDB diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest new file mode 100644 index 0000000..cca7079 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate new file mode 100644 index 0000000..5213ef2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\| diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.log new file mode 100644 index 0000000..2219b4b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.log @@ -0,0 +1,26 @@ +Build started 4/2/2012 4:13:18 PM. + 1>Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" on node 3 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + InitializeBuildStatus: + Creating "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /ZI /nologo /W3 /WX- /Od /Oy- /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"testlibusb-win\"" /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\\" /Fd"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\tests\testlibusb_win.c + testlibusb_win.c + ResourceCompile: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"testlibusb-win\"" /l"0x0409" /I..\src /nologo /fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win_rc.res" ..\tests\testlibusb_win_rc.rc + Link: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe" /NOLOGO kernel32.lib user32.lib gdi32.lib advapi32.lib setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" /MANIFESTUAC:NO /DEBUG /PDB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lib" /MACHINE:X86 "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win_rc.res" + "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win.obj" + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib + testlibusb-win.vcxproj -> E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe + Manifest: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.manifest" /manifest "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" + FinalizeBuildStatus: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild". + Touching "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + 1>Done Building Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.92 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb-win.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb_win_rc.res b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb_win_rc.res new file mode 100644 index 0000000..faaf2fa Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/testlibusb_win_rc.res differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/vc100.idb b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/vc100.idb new file mode 100644 index 0000000..2aa1740 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/Win32/Debug/testlibusb-win/vc100.idb differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/logo.png b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/logo.png new file mode 100644 index 0000000..d3cc52b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/logo.png differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/mv_config.cfg b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/mv_config.cfg new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Black.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Black.ico new file mode 100644 index 0000000..97050ce Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Black.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Gray.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Gray.ico new file mode 100644 index 0000000..a177e6b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Gray.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.ico new file mode 100644 index 0000000..a355278 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.rc2 b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.rc2 new file mode 100644 index 0000000..704a799 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/Mv_Util.rc2 @@ -0,0 +1,14 @@ +// +// Mv_Util.RC2 - resources Microsoft Visual C++ does not edit directly +// + +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + +///////////////////////////////////////////////////////////////////////////// +SYS_SNOOPY_NT RCDATA "..\\SniffUSB.exe" diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/White.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/White.ico new file mode 100644 index 0000000..aa92f97 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/White.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/green.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/green.ico new file mode 100644 index 0000000..61cf871 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/green.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/red.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/red.ico new file mode 100644 index 0000000..807c67e Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/red.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/复件 Mv_Util.ico b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/复件 Mv_Util.ico new file mode 100644 index 0000000..334f78c Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/res/复件 Mv_Util.ico differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/resource.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/resource.h new file mode 100644 index 0000000..c4990b2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/resource.h @@ -0,0 +1,657 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Mv_Util.rc +// +#define IDSTOP 3 +#define IDC_BUTTON_MOVE_W 3 +#define IDCANCEL3 3 +#define IDCANCEL2 4 +#define ID_OK_START 6 +#define IDM_ABOUTBOX 0x0010 +#define IDD_ABOUTBOX 100 +#define IDS_ABOUTBOX 101 +#define IDD_MV_UTIL_DIALOG 102 +#define IDD_DIALOG_FRAME_ID 104 +#define IDD_MV_UTIL_MOVE_LOCATION 105 +#define IDD_DIALOG_SET_LIGHTS 106 +#define IDD_DIALOG_MAIN_MENU 107 +#define IDD_DIALOG_PROTOCOL_ANALYZER 108 +#define IDD_DIALOG_AUTO_TEST 109 +#define IDD_DIALOG_UPDATE_MV_CONFIG 110 +#define IDD_MITU_UTIL_DIALOG 111 +#define IDD_DIALOG_AUTO_TEST_MITUTOYO 113 +#define IDD_DIALOG_FILE_UTILITIES 114 +#define IDD_SO7_UTIL_DIALOG 147 +#define IDD_SO7_UTIL_MOVE_LOCATION 148 +#define IDD_DIALOG_TEST_KEYENCE 149 +#define IDD_S07_UTIL_SEND_PARAMETER 151 +#define IDI_ICON1 152 +#define IDR_MAINFRAME 152 +#define IDD_SO7_UTIL_AUTO_ZOOM 153 +#define IDD_ANIMATICS_UTIL_DIALOG 154 +#define IDI_ICON_GREEN 155 +#define IDI_ICON_GRAY 157 +#define IDI_ICON_WHITE 158 +#define IDI_ICON_RED 159 +#define IDI_ICON_BLACK 160 +#define IDD_S07_OPTION_DIALOG 161 +#define IDD_DIALOG_VIDEOCARD_SDK3000 162 +#define IDD_SO7_VIDEOCARD_SDK3000 162 +#define IDD_DIALOG1 163 +#define IDD_SO7_VIDEOCARD_SV2000E 163 +#define IDD_SO7_UTIL_SETUP_CONFIGURE 164 +#define IDC_BUTTON_INIT_MVUSB 1001 +#define IDC_BUTTON_START_MACHINE 1002 +#define IDC_BUTTON_START_POLL_58 1004 +#define IDC_BUTTON_START_MACHINE2 1005 +#define IDC_BUTTON_START_SOMACHINE 1005 +#define IDC_BUTTON_START_SO7MACHINE 1005 +#define IDC_BUTTON_START_POLL_2B 1006 +#define IDC_BUTTON_TERM_MVUSB 1007 +#define IDC_BUTTON_STOP_MACHINE 1009 +#define IDC_BUTTON_POLL_EP_02 1010 +#define IDC_EDIT_STATUS 1011 +#define IDC_BUTTON_START_POLL 1012 +#define IDC_BUTTON_START_POLL_59 1013 +#define IDC_BUTTON_SEEK_HOME 1014 +#define IDC_BUTTON_GET_CONFIG 1016 +#define IDC_CHECK_ANNOTATED 1017 +#define IDC_RADIO_FORMAT_SNOOPY 1018 +#define IDC_RADIO_FORMAT_DMS 1019 +#define IDC_BUTTON_DISABLE_JOYSTICK 1020 +#define IDC_EDIT_X_POSITION_59 1021 +#define IDC_RADIO_EXTRACT 1022 +#define IDC_EDIT_Y_POSITION_59 1023 +#define IDC_RADIO_FULL 1023 +#define IDC_RADIO_REPLAY_FILE 1024 +#define IDC_EDIT_Z_POSITION_59 1025 +#define IDC_RADIO_SEGMENT_FILE 1025 +#define IDC_RADIO_FORMAT_MITU 1027 +#define IDC_EDIT_ZM_POSITION_59 1028 +#define IDC_EDIT_AXIAL_LIGHT 1029 +#define IDC_EDIT_BOTTOM_LIGHT 1030 +#define IDC_EDIT_HWS_1 1031 +#define IDC_BUTTON_LOAD_CONFIG 1032 +#define IDC_EDIT_HWS_0 1032 +#define IDC_BUTTON_CYCLE_RING 1033 +#define IDC_EDIT_X_POSITION_58 1034 +#define IDC_EDIT_Y_POSITION_58 1035 +#define IDC_EDIT_Z_POSITION_58 1036 +#define IDC_EDIT_ZM_POSITION_58 1037 +#define IDC_EDIT_X_POS_MM_CHANGE 1037 +#define IDC_BUTTON_SET_LIGHT 1038 +#define IDC_EDIT_Y_POS_MM_CHANGE 1038 +#define IDC_EDIT_Y_POSITION 1039 +#define IDC_EDIT_JS_MOVED 1039 +#define IDC_BUTTON_REPLAY_CAPTURE 1039 +#define IDC_EDIT_Z_POS_MM_CHANGE 1039 +#define IDC_BUTTON_GET_INDEX 1040 +#define IDC_EDIT_STAGE_STATUS_X 1040 +#define IDC_EDIT_Z_POSITION 1041 +#define IDC_EDIT_STAGE_STATUS_Y 1041 +#define IDC_BUTTON_REPLAY_STARTUP 1042 +#define IDC_EDIT_STAGE_STATUS_Z 1042 +#define IDC_EDIT_X_POSITION_EP02 1043 +#define IDC_EDIT_ZM_POSITION 1044 +#define IDC_EDIT_SC_X 1044 +#define IDC_EDIT_Y_POSITION_EP02 1045 +#define IDC_EDIT_SC_Y 1045 +#define IDC_CHECK_CONDENSED 1046 +#define IDC_EDIT_SC_Z 1046 +#define IDC_EDIT_Z_POSITION_EP02 1047 +#define IDC_EDIT_TS_0 1047 +#define IDC_BUTTON_MOVE_TO 1048 +#define IDC_EDIT_TS_1 1048 +#define IDC_EDIT_ZM_POSITION_EP02 1049 +#define IDC_EDIT_TS_2 1049 +#define IDC_EDIT_MOVE_TO_X 1050 +#define IDC_BUTTON_GET_INDEX2 1051 +#define IDC_EDIT_ACCEL_X 1051 +#define IDC_BUTTON_ENABLE_JOYSTICK 1052 +#define IDC_EDIT_MOVE_TO_Y 1053 +#define IDC_EDIT_MOVE_TO_Z 1054 +#define IDC_EDIT_X_INDEX 1055 +#define IDC_EDIT_ACCEL_Y 1055 +#define IDC_RADIO_MOVE_RELATIVE 1056 +#define IDC_EDIT_X_INDEX2 1056 +#define IDC_EDIT_RPX_POSITION 1056 +#define IDC_EDIT_Y_INDEX 1057 +#define IDC_EDIT_ACCEL_Z 1057 +#define IDC_EDIT_MOVE_TO_ZM 1058 +#define IDC_EDIT_RPY_POSITION 1058 +#define IDC_EDIT_Z_INDEX 1059 +#define IDC_EDIT_HWS_SPEED_X 1059 +#define IDC_RADIO_MOVE_ABSOLUTE 1060 +#define IDC_EDIT_Z_INDEX2 1060 +#define IDC_EDIT_RPZ_POSITION 1060 +#define IDC_EDIT_TSX 1061 +#define IDC_EDIT_ZM_INDEX 1062 +#define IDC_EDIT_TSY 1062 +#define IDC_RADIO_INCH 1063 +#define IDC_EDIT_ZM_INDEX2 1063 +#define IDC_EDIT_TS_XYZ 1063 +#define IDC_RADIO_MM 1064 +#define IDC_EDIT_TSZ 1064 +#define IDC_RADIO_FAST 1065 +#define IDC_RADIO_SPEED_FAST 1066 +#define IDC_EDIT_DECEL_X 1066 +#define IDC_EDIT_DECEL_Y 1067 +#define IDC_EDIT_DECEL_Z 1068 +#define IDC_RADIO_SPEED_SLOW 1070 +#define IDC_RADIO_SCALE 1072 +#define IDC_EDIT_SPEED_X 1073 +#define IDC_EDIT_SPEED_Y 1074 +#define IDC_EDIT_SPEED_Z 1075 +#define IDC_EDIT_ACC_X 1076 +#define IDC_EDIT_ACC_Y 1077 +#define IDC_EDIT_ACC_Z 1078 +#define IDC_EDIT_DEC_X 1079 +#define IDC_EDIT_DEC_Y 1080 +#define IDC_EDIT_DEC_Z 1081 +#define IDC_EDIT_MANUAL_SPEED_X 1082 +#define IDC_EDIT_MANUAL_SPEED_Y 1083 +#define IDC_EDIT_MANUAL_SPEED_Z 1084 +#define IDC_EDIT_MANUAL_ACC_X 1085 +#define IDC_EDIT_MANUAL_ACC_Y 1086 +#define IDC_EDIT_MANUAL_ACC_Z 1087 +#define IDC_EDIT_MANUAL_DEC_X 1088 +#define IDC_EDIT_MANUAL_DEC_Y 1089 +#define IDC_EDIT_MANUAL_DEC_Z 1090 +#define IDC_RADIO_SPEED_USER_DEFINED 1091 +#define IDC_CHECK_USE_MANUAL_MOTION_PARAMETERS 1092 +#define IDC_EDIT_MOVE_W 1093 +#define IDC_BUTTON_ALL_ON 1101 +#define IDC_BUTTON_ALL_OFF 1102 +#define IDC_POLLING_SPEEDTEST 1104 +#define IDC_BUTTON_BROWSE 1105 +#define IDC_BUTTON_START_CAPTURE 1106 +#define IDC_EDIT1 1107 +#define IDC_EDIT_SAMPLING 1108 +#define IDC_BUTTON_DIAGNOSTICS 1109 +#define IDC_EDIT_ITERATIONS 1110 +#define IDC_EDIT_INPUT_FILE 1111 +#define IDC_EDIT_STATUS_WINDOW 1112 +#define IDC_BUTTON_PROTOCOL_ANALYZER 1113 +#define IDC_EDIT_NEW_RING_POSITION 1114 +#define IDC_EDIT_MESSAGE 1116 +#define IDC_BUTTON_UPDATE_CONFIG 1118 +#define IDC_EDIT_SCALE_X 1119 +#define IDC_BUTTON_AUTO_TEST 1120 +#define IDC_EDIT_SCALE_Y 1124 +#define IDC_BUTTON_CREATE_CONFIG 1125 +#define IDC_STATIC_AUTO_TEST 1126 +#define IDC_EDIT_SCALE_Z 1128 +#define IDC_EDIT_MOTION_SPEED 1129 +#define IDC_BUTTON_FILE_UTILITIES 1130 +#define IDC_STATIC_COLLECTS_TEXT 1131 +#define IDC_EDIT_SCALE_ZM 1132 +#define IDC_STATIC_SEC 1133 +#define IDC_EDIT_TOP_LIGHT 1135 +#define IDC_EDIT_AUTO_TEST_TEXT 1136 +#define IDC_CHECK_CYCLE_RING_LIGHTS 1137 +#define IDC_CHECK_CYCLE_TOP_BOTTOM_LIGHTS 1138 +#define IDC_STATIC_OPTION 1139 +#define IDC_STATIC_FORMAT 1140 +#define IDC_CHECK_CYCLE_ZOOM 1141 +#define IDC_CHECK_CYCLE_ROTARY 1142 +#define IDC_RADIO_CREATE_MV_CONFIG 1143 +#define IDC_RADIO_DATA_CAPTURE_MODE 1144 +#define IDC_CHECK_CYCLE_STAGE 1145 +#define IDC_RADIO_DEDUPE 1146 +#define IDC_RADIO_HEX_ASCII2BIN 1149 +#define IDC_EDIT_MV_CONFIG_FILE 1150 +#define IDC_RADIO_DEMO_MODE 1152 +#define IDC_RADIO_DUMP_BINARY 1153 +#define IDC_BUTTON_GET_MV_CONFIG 1154 +#define IDC_RADIO_ENGINEERING_MODE 1156 +#define IDC_RADIO_MACHINE_MITUTOYO 1157 +#define IDC_EDIT_SNOOP_LOG 1160 +#define IDC_EDIT_SNOOP_LOG_FILE 1161 +#define IDC_BUTTON_BROWSE_LOG 1164 +#define IDC_RADIO_MACHINE_MICROVU 1165 +#define IDC_RADIO_UPDATE_MV_CONFIG 1168 +#define IDC_STATIC_MV_CONFIG 1169 +#define IDC_STATIC_USBSNOOP 1170 +#define IDC_STATIC_DIAGNOSTICS 1171 +#define IDC_STATIC_REPLAY 1172 +#define IDC_STATIC_PROTOCOL_ANALYZER 1173 +#define IDC_BUTTON_START_POSITION_POLL 1174 +#define IDC_BUTTON_TERM_MITUUSB 1175 +#define IDC_BUTTON_INIT_MITUUSB 1176 +#define IDC_BUTTON_LOAD_MITU_CONFIG 1177 +#define IDC_SPIN_RING_POSITION 1178 +#define IDC_BUTTON_RESERVED 1179 +#define IDC_BUTTON_MOVE_ABSOLUTE 1179 +#define IDC_EDIT_UPDATE_FREQUENCY 1180 +#define IDC_BUTTON_MOVE_RELATIVE 1180 +#define IDC_BUTTON_UPDATE_FREQUENCY 1181 +#define IDC_BUTTON_SET_ZOOM 1181 +#define IDC_EDIT_TPX_POSITION 1182 +#define IDC_EDIT_TPY_POSITION 1183 +#define IDC_EDIT_TPZ_POSITION 1184 +#define IDC_EDIT_TPZM_POSITION 1185 +#define IDC_EDIT_DPX_POSITION 1186 +#define IDC_EDIT_DPY_POSITION 1187 +#define IDC_EDIT_DPZ_POSITION 1188 +#define IDC_BUTTON_SET_LIGHTS 1189 +#define IDC_EDIT_NEW_COAXIAL_LIGHT 1190 +#define IDC_EDIT_NEW_STAGE_LIGHT 1191 +#define IDC_LIST_RING_POSITION 1192 +#define IDC_SPIN_ELLIPTIC_MIRROR 1196 +#define IDC_EDIT_MIRROR 1197 +#define IDC_RADIO_MACHINE_GENERIC 1198 +#define IDC_RADIO_GENERIC 1199 +#define IDC_CHECK_DE_DUPE 1202 +#define IDC_EDIT_CRITERIA 1203 +#define IDC_CHECK1 1204 +#define IDC_CHECK_NEGATE 1204 +#define IDC_CHECK_REPETESTX 1204 +#define IDC_CHECK_ZOOM_DEADBAND 1204 +#define IDC_CHECK_MIRROR_VERTICALLY 1204 +#define IDC_CHECK_SV2000E_MIRROR_VERTICALLY 1204 +#define IDC_CHECK_CONTINUE_READ_LASER_VALUE 1204 +#define IDC_RADIO_MACHINE_SevenOcean 1205 +#define IDC_BUTTON_INIT_SO7USB 1206 +#define IDC_BUTTON_LOAD_SOCONFIG 1207 +#define IDC_BUTTON_LOAD_SO7CONFIG 1207 +#define IDC_BUTTON_SO7_MOVE_X 1208 +#define IDC_BUTTON_SO7_MOVE_X_LEFT 1208 +#define IDC_BUTTON_SO7_MOVE_Y 1209 +#define IDC_BUTTON_SO7_MOVE_Y_FRONT 1209 +#define IDC_BUTTON_SO7_MOVE_Z 1210 +#define IDC_BUTTON_SO7_MOVE_Z_UP 1210 +#define IDC_BUTTON_SO7_RESET_XYZ 1211 +#define IDC_BUTTON_STOP_SO7MACHINE 1212 +#define IDC_BUTTON_TERM_SO7USB 1213 +#define IDC_EDIT_UPDATE_FREQ 1214 +#define IDC_BUTTON_SO7_READ_AXIS_XYZ 1215 +#define IDC_EDIT_X_AXIS 1216 +#define IDC_EDIT_Y_AXIS 1217 +#define IDC_EDIT_Z_AXIS 1218 +#define IDC_EDIT_ZM_AXIS 1219 +#define IDC_RADIO_SPEED_GEAR4 1222 +#define IDC_RADIO_MOVETEST 1222 +#define IDC_RADIO_HEX_BIN2ASCII 1222 +#define IDC_RADIO_SAMPLE_X 1222 +#define IDC_RADIO_VIDEOCARD_SDK3000 1222 +#define IDC_RADIO_RGB 1222 +#define IDC_RADIO_SV2000E_RGB 1222 +#define IDC_RADIO_SO7CONFIG_ZOOM_MOVE_FAST 1222 +#define IDC_BUTTON_INIT_KEYENCE_LASER 1223 +#define IDC_RADIO_SPEED_GEAR3 1223 +#define IDC_EDIT_LASER_VALUE2 1224 +#define IDC_RADIO_SPEED_GEAR2 1224 +#define IDC_EDIT_LASER_VALUE1 1225 +#define IDC_RADIO_SPEED_GEAR1 1225 +#define IDC_BUTTON_RUNCNC 1226 +#define IDC_BUTTON_INIT_KEYENCE_USB 1227 +#define IDC_BUTTON_RESET_KEYENCE_USB 1228 +#define IDC_BUTTON_EXIT_KEYENCE_USB 1229 +#define IDC_BUTTON_SO7_MOVE_X_RIGHT 1230 +#define IDC_BUTTON_SO7_MOVE_Y_BACK 1231 +#define IDC_BUTTON_SO7_MOVE_Z_DOWN 1232 +#define IDC_BUTTON_READ_PROBE 1233 +#define IDC_BUTTON_SO7_MOVE_ZOOM_IN 1236 +#define IDC_BUTTON_SO7_MOVE_ZOOM_OUT 1237 +#define IDC_BUTTON_MOVE_TO_ZOOM 1238 +#define IDC_BUTTON_MOVE_TO_XYZ_LASER 1239 +#define IDC_BUTTON_SO7_READ_AXIS_V 1239 +#define IDC_BUTTON_MOVE_TO_XYZ_JM 1240 +#define IDC_BUTTON_SO7_READ_ADC 1240 +#define IDC_BUTTON_MOVE_TO_XYZV 1241 +#define IDC_BUTTON_SO7_GET_RESET_FLAG 1241 +#define IDC_EDIT_RING_LIGHT 1242 +#define IDC_EDIT_COAXIAL_LIGHT 1243 +#define IDC_EDIT_COAXIAL_LIGHT2 1244 +#define IDC_EDIT_COAXIAL_LIGHT3 1245 +#define IDC_EDIT_COAXIAL_LIGHT4 1246 +#define IDC_RADIO_LIGHT1_SIZE 1247 +#define IDC_RADIO_LIGHT2_SIZE 1248 +#define IDC_RADIO_LIGHT3_SIZE 1249 +#define IDC_RADIO_LIGHT4_SIZE 1250 +#define IDC_EDIT_LIGHT_SIZE_VALUE 1251 +#define IDC_EDIT_LIGHT_SWITCH 1252 +#define IDC_EDIT_MOTOR_PLUSE_NUMBER 1253 +#define IDC_BUTTON_RESET_WORKTABLE 1257 +#define IDC_BUTTON_RESET_V 1258 +#define IDC_BUTTON_GET_FIXTURE_FLAG 1259 +#define IDC_BUTTON_SET_RESET_FLAG 1260 +#define IDC_BUTTON_RESET_WORKTABLE_RIGHT 1261 +#define IDC_RADIO_SELECT_X 1262 +#define IDC_RADIO_SELECT_Y 1263 +#define IDC_RADIO_SELECT_Z 1264 +#define IDC_BUTTON_SET_SECTION 1265 +#define IDC_BUTTON_CORRECTION_SCALE 1266 +#define IDC_BUTTON_FIXTURE_UPDOWN 1267 +#define IDC_BUTTON_FIXTURE_ONOFF 1268 +#define IDC_BUTTON_GET_LASER 1269 +#define IDC_BUTTON_PROBE_ONOFF 1270 +#define IDC_EDIT_SET_VER_NO 1271 +#define IDC_EDIT_X_SCALE_COEFFICIENT 1272 +#define IDC_EDIT_Y_SCALE_COEFFICIENT 1273 +#define IDC_EDIT3 1274 +#define IDC_EDIT_Z_SCALE_COEFFICIENT 1274 +#define IDC_EDIT_REPRETEST 1274 +#define IDC_EDIT_FRESHSPEED_X1 1274 +#define IDC_EDIT_SO7CONFIG_ZOOM_FASTSPEED 1274 +#define IDC_EDIT_FRESHSPEED_X2 1275 +#define IDC_EDIT_FRESHSPEED_X3 1276 +#define IDC_BUTTON_ZERO_SET 1277 +#define IDC_EDIT_FRESHSPEED_X4 1277 +#define IDC_EDIT_SAVE_INI_FILE 1278 +#define IDC_EDIT_FRESHSPEED_X5 1278 +#define IDC_EDIT_FRESHSPEED_Y1 1279 +#define IDC_BUTTON_SAVE 1280 +#define IDC_BUTTON_SAVE_PARAMETER 1281 +#define IDC_BUTTON_READ_PARAMETER_FROM_CONTROLLER 1282 +#define IDC_EDIT_FRESHSPEED_Y2 1283 +#define IDC_EDIT_FRESHSPEED_Y3 1284 +#define IDC_EDIT_REPETEST_TIMES 1285 +#define IDC_EDIT_FRESHSPEED_Y4 1285 +#define IDC_BUTTON_BEGIN_REPE_TEST 1286 +#define IDC_EDIT_FRESHSPEED_Y5 1286 +#define IDC_EDIT_REPETEST_DIS 1287 +#define IDC_EDIT_FRESHSPEED_Z1 1287 +#define IDC_EDIT_REPETEST_TIMES2 1288 +#define IDC_EDIT_REPETEST_INTERVAL 1288 +#define IDC_EDIT_FRESHSPEED_Z2 1288 +#define IDC_EDIT_FRESHSPEED_Z3 1289 +#define IDC_EDIT_REPETEST_ERRORRANGE 1289 +#define IDC_EDIT_REPETEST_DIS2 1289 +#define IDC_EDIT_REPETEST_DIS_FROM 1289 +#define IDC_EDIT_FRESHSPEED_Z4 1290 +#define IDC_BUTTON_SAVE_REPETEST 1291 +#define IDC_EDIT_FRESHSPEED_Z5 1291 +#define IDC_CHECK_REPETESTY 1292 +#define IDC_CHECK_REPETESTZ 1293 +#define IDC_CHECK_REPETEST_ABSOLUTE 1294 +#define IDC_EDIT_MAXSPEED_X1 1298 +#define IDC_EDIT_SLOWDIS_X1 1299 +#define IDC_EDIT_STARTSPEED_X1 1300 +#define IDC_EDIT_BASESPEED_X1 1301 +#define IDC_EDIT_MAXSPEED_X2 1302 +#define IDC_EDIT_SLOWDIS_X2 1303 +#define IDC_EDIT_STARTSPEED_X2 1304 +#define IDC_EDIT_BASESPEED_X3 1305 +#define IDC_EDIT_MAXSPEED_X3 1306 +#define IDC_EDIT_BASESPEED_X2 1307 +#define IDC_EDIT_SLOWDIS_X3 1308 +#define IDC_EDIT_STARTSPEED_X3 1309 +#define IDC_EDIT_BASESPEED_X4 1310 +#define IDC_EDIT_MAXSPEED_X4 1311 +#define IDC_EDIT_SLOWDIS_X4 1312 +#define IDC_EDIT_STARTSPEED_X4 1313 +#define IDC_EDIT_BASESPEED_X5 1314 +#define IDC_EDIT_MAXSPEED_X5 1315 +#define IDC_EDIT_SLOWDIS_X5 1316 +#define IDC_EDIT_STARTSPEED_X5 1317 +#define IDC_EDIT_BASESPEED_Y1 1318 +#define IDC_EDIT_MAXSPEED_Y1 1319 +#define IDC_EDIT_SLOWDIS_Y1 1320 +#define IDC_EDIT_STARTSPEED_Y1 1321 +#define IDC_EDIT_BASESPEED_Y2 1322 +#define IDC_EDIT_MAXSPEED_Y2 1323 +#define IDC_EDIT_SLOWDIS_Y2 1324 +#define IDC_EDIT_STARTSPEED_Y2 1325 +#define IDC_EDIT_BASESPEED_Y3 1326 +#define IDC_EDIT_MAXSPEED_Y3 1327 +#define IDC_EDIT_SLOWDIS_Y3 1328 +#define IDC_EDIT_STARTSPEED_Y3 1329 +#define IDC_EDIT_BASESPEED_Y4 1330 +#define IDC_EDIT_MAXSPEED_Y4 1331 +#define IDC_EDIT_SLOWDIS_Y4 1332 +#define IDC_EDIT_STARTSPEED_Y4 1333 +#define IDC_EDIT_BASESPEED_Y5 1334 +#define IDC_EDIT_MAXSPEED_Y5 1335 +#define IDC_EDIT_SLOWDIS_Y5 1336 +#define IDC_EDIT_STARTSPEED_Y5 1337 +#define IDC_EDIT_BASESPEED_Z1 1338 +#define IDC_EDIT_MAXSPEED_Z1 1339 +#define IDC_EDIT_SLOWDIS_Z1 1340 +#define IDC_EDIT_STARTSPEED_Z1 1341 +#define IDC_EDIT_BASESPEED_Z2 1342 +#define IDC_EDIT_MAXSPEED_Z2 1343 +#define IDC_EDIT_SLOWDIS_Z2 1344 +#define IDC_EDIT_STARTSPEED_Z2 1345 +#define IDC_EDIT_BASESPEED_Z3 1346 +#define IDC_EDIT_MAXSPEED_Z3 1347 +#define IDC_EDIT_SLOWDIS_Z3 1348 +#define IDC_EDIT_STARTSPEED_Z3 1349 +#define IDC_EDIT_BASESPEED_Z4 1350 +#define IDC_EDIT_MAXSPEED_Z4 1351 +#define IDC_EDIT_SLOWDIS_Z4 1352 +#define IDC_EDIT_STARTSPEED_Z4 1353 +#define IDC_EDIT_BASESPEED_Z5 1354 +#define IDC_EDIT_MAXSPEED_Z5 1355 +#define IDC_EDIT_SLOWDIS_Z5 1356 +#define IDC_EDIT_STARTSPEED_Z5 1357 +#define IDC_EDIT_WHEELBASE_X 1358 +#define IDC_EDIT_WHEELBASE_Y 1362 +#define IDC_BUTTON_SEND_DATA 1362 +#define IDC_EDIT_WHEELBASE_Z 1363 +#define IDC_EDIT_WHEELBASE_PULSENUM 1364 +#define IDC_EDIT_PRECISION_X 1365 +#define IDC_EDIT_PRECISION_Y 1366 +#define IDC_EDIT_PRECISION_Z 1367 +#define IDC_LIST_SHOWMESSAGE 1368 +#define IDC_EDIT_NEG_WORKLIMIT_X 1368 +#define IDC_EDIT_DATASEND 1369 +#define IDC_EDIT_NEG_WORKLIMIT_Y 1369 +#define IDC_BUTTON_CLEARMESSAGE 1370 +#define IDC_EDIT_NEG_WORKLIMIT_Z 1370 +#define IDC_BUTTON_AUTO_ZOOM 1371 +#define IDC_EDIT_POS_WORKLIMIT_X 1371 +#define IDC_STATIC_DEADBAND_UNITS 1372 +#define IDC_EDIT_POS_WORKLIMIT_Y 1372 +#define IDC_BUTTON_MOVEV_IN 1373 +#define IDC_EDIT_POS_WORKLIMIT_Z 1373 +#define IDC_BUTTON_MOVEV_OUT 1374 +#define IDC_EDIT_ZOOM_ANGLE 1376 +#define IDC_BUTTON_HOME_V 1377 +#define IDC_RADIO_SENDCMD 1378 +#define IDC_EDIT_ZOOM_DEADBAND 1379 +#define IDC_BUTTON_ZOOM_MOVETO 1380 +#define IDC_EDIT_ZOOM_MOVETO 1381 +#define IDC_BUTTON_ZOOM_SETZERO 1382 +#define IDC_EDIT_REPETEST_PAUSE 1383 +#define IDC_RADIO_ZOOM_GEAR1 1384 +#define IDC_RADIO_ZOOM_GEAR2 1385 +#define IDC_RADIO_ZOOM_GEAR3 1386 +#define IDC_RADIO_ZOOM_GEAR4 1387 +#define IDC_BUTTON_ZOOM_SETSPEED 1388 +#define IDC_EDIT_SETSPEED 1389 +#define IDC_CHECK_CONTINUEMOVE 1391 +#define IDC_BUTTON_SAVELOG 1392 +#define IDC_EDIT_ZOOM_LOG 1393 +#define IDC_CHECK2 1394 +#define IDC_CHECK_REVERSE 1394 +#define IDC_CHECK_AUTOZOOM_CONTINUE_READ 1394 +#define IDC_BUTTON_MANUAL_HOME 1395 +#define IDC_CHECK_ 1396 +#define IDC_CHECK_REPETEST_VOLCOMP 1396 +#define IDC_BUTTON_CALIBRATE_ENCODER 1397 +#define IDC_COMBOREPETEST_FROM 1398 +#define IDC_COMBO_REPETEST_FROM 1398 +#define IDC_COMBO_REPETEST_TO 1399 +#define IDC_BUTTON_REPETEST_BEGIN 1400 +#define IDC_EDIT_ZOOM_REPE_TIME 1401 +#define IDC_CHECK_REPETESTV 1402 +#define IDC_RADIO_MACHINE_ANIMATICS 1403 +#define IDC_BUTTON_POS_SET_ZERO 1406 +#define IDC_EDIT_ANIMATICS_CMD 1408 +#define IDC_RADIO_ANIMATICS_CMD_X 1411 +#define IDC_RADIO_ANIMATICS_CMD_Y 1412 +#define IDC_RADIO_ANIMATICS_CMD_Z 1413 +#define IDC_EDIT_ANIMATICS_CMD_RESPONSE 1414 +#define IDC_BUTTON_START_ANIMATICS_MACHINE 1415 +#define IDC_BUTTON_STOP_ANIMATICS_MACHINE 1416 +#define IDC_EDIT_ANIMATICS_SPEED_X1 1417 +#define IDC_EDIT_ANIMATICS_SPEED_X2 1418 +#define IDC_EDIT_ANIMATICS_SPEED_X3 1419 +#define IDC_EDIT_ANIMATICS_SPEED_X4 1420 +#define IDC_EDIT_ANIMATICS_SPEED_X5 1421 +#define IDC_EDIT_ANIMATICS_SPEED_Y1 1422 +#define IDC_EDIT_ANIMATICS_SPEED_Y2 1423 +#define IDC_EDIT_ANIMATICS_SPEED_Y3 1424 +#define IDC_EDIT_ANIMATICS_SPEED_Y4 1425 +#define IDC_EDIT_ANIMATICS_SPEED_Y5 1426 +#define IDC_EDIT_ANIMATICS_SPEED_Z1 1427 +#define IDC_EDIT_ANIMATICS_SPEED_Z2 1428 +#define IDC_EDIT_ANIMATICS_SPEED_Z3 1429 +#define IDC_EDIT_ANIMATICS_SPEED_Z4 1430 +#define IDC_EDIT_ANIMATICS_SPEED_Z5 1431 +#define IDC_EDIT_ANIMATICS_ACCEL_Z5 1432 +#define IDC_EDIT_ANIMATICS_ACCEL_Z4 1433 +#define IDC_EDIT_ANIMATICS_ACCEL_Z3 1434 +#define IDC_EDIT_ANIMATICS_ACCEL_Z2 1435 +#define IDC_EDIT_ANIMATICS_ACCEL_Z1 1436 +#define IDC_EDIT_ANIMATICS_ACCEL_Y5 1437 +#define IDC_EDIT_ANIMATICS_ACCEL_Y4 1438 +#define IDC_EDIT_ANIMATICS_ACCEL_Y3 1439 +#define IDC_EDIT_ANIMATICS_ACCEL_Y2 1440 +#define IDC_EDIT_ANIMATICS_ACCEL_Y1 1441 +#define IDC_EDIT_ANIMATICS_ACCEL_X5 1442 +#define IDC_EDIT_ANIMATICS_ACCEL_X4 1443 +#define IDC_EDIT_ANIMATICS_ACCEL_X3 1444 +#define IDC_EDIT_ANIMATICS_ACCEL_X2 1445 +#define IDC_EDIT_ANIMATICS_ACCEL_X1 1446 +#define IDC_EDIT_ANIMATICS_DECEL_X1 1447 +#define IDC_EDIT_ANIMATICS_DECEL_X2 1448 +#define IDC_EDIT_ANIMATICS_DECEL_X3 1449 +#define IDC_EDIT_ANIMATICS_DECEL_X4 1450 +#define IDC_EDIT_ANIMATICS_DECEL_X5 1451 +#define IDC_EDIT_ANIMATICS_DECEL_Y1 1452 +#define IDC_ANIMATICS_DECEL_Y2 1453 +#define IDC_EDIT_ANIMATICS_DECEL_Y2 1453 +#define IDC_EDIT_ANIMATICS_DECEL_Y3 1454 +#define IDC_EDIT_ANIMATICS_DECEL_Y4 1455 +#define IDC_EDIT_ANIMATICS_DECEL_Y5 1456 +#define IDC_EDIT_ANIMATICS_DECEL_Z1 1457 +#define IDC_EDIT_ANIMATICS_DECEL_Z2 1458 +#define IDC_EDIT_ANIMATICS_DECEL_Z3 1459 +#define IDC_EDIT_ANIMATICS_DECEL_Z4 1460 +#define IDC_EDIT_ANIMATICS_DECEL_Z5 1461 +#define IDC_BUTTON_ANIMATICS_MOVE_Z_UP 1462 +#define IDC_BUTTON_ANIMATICS_MOVE_Z_DOWN 1463 +#define IDC_BUTTON_ANIMATICS_MOVE_X_LEFT 1464 +#define IDC_BUTTON_ANIMATICS_MOVE_X_RIGHT 1465 +#define IDC_BUTTON_ANIMATICS_MOVE_Y_BACK 1466 +#define IDC_BUTTON_ANIMATICS_MOVE_Y_FRONT 1467 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR4 1468 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR_1 1468 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR3 1469 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR_2 1469 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR2 1470 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR_3 1470 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR1 1471 +#define IDC_RADIO_ANIMATICS_SPEED_GEAR_4 1471 +#define IDC_CHECK_ANIMATICS_REVERSE 1472 +#define IDC_EDIT_ANIMATICS_MOVE_TO_X 1473 +#define IDC_EDIT_ANIMATICS_MOVE_TO_Y 1474 +#define IDC_EDIT_ANIMATICS_MOVE_TO_Z 1475 +#define IDC_BUTTON_ANIMATICS_MOVE_TO_Y 1476 +#define IDC_BUTTON_ANIMATICS_MOVE_TO_X 1477 +#define IDC_BUTTON_ANIMATICS_MOVE_TO_Z 1478 +#define IDC_BUTTON_ANIMATICS_MOVE_TO_XYZ 1479 +#define IDC_EDIT_ANIMATICS_REPRETEST 1480 +#define IDC_EDIT_X_POS_MM 1481 +#define IDC_EDIT_X_POS 1482 +#define IDC_EDIT_Y_POS 1483 +#define IDC_EDIT_Z_POS 1484 +#define IDC_EDIT_Y_POS_MM 1485 +#define IDC_EDIT_Z_POS_MM 1486 +#define IDC_BUTTON_READ_CONFIG 1487 +#define IDC_BUTTON_SAVE_CONFIG 1488 +#define IDC_RADIO_MOVE_TO_ABSOLUTE 1489 +#define IDC_RADIO6 1490 +#define IDC_RADIO_MOVE_TO_RELATIVE 1490 +#define IDC_BUTTON_STATUS_MOVING_X 1493 +#define IDC_BUTTON_STATUS_HOME_X 1494 +#define IDC_BUTTON_STATUS_MOVING_Y 1495 +#define IDC_BUTTON_STATUS_MOVING_X3 1496 +#define IDC_BUTTON_STATUS_MOVING_Z 1496 +#define IDC_BUTTON_STATUS_HOME_Y 1497 +#define IDC_BUTTON_STATUS_HOME_z 1498 +#define IDC_BUTTON_STATUS_NEGLIMIT_X 1499 +#define IDC_BUTTON_STATUS_NEGLIMIT_Y 1500 +#define IDC_BUTTON_STATUS_NEGLIMIT_Z 1501 +#define IDC_BUTTON_STATUS_POSLIMIT_X 1502 +#define IDC_BUTTON_STATUS_POSLIMIT_Y 1503 +#define IDC_BUTTON_STATUS_POSLIMIT_Z 1504 +#define IDC_BUTTON_STATUS_DRIVER_RDY_X 1505 +#define IDC_BUTTON_STATUS_DRIVER_RDY_Y 1506 +#define IDC_BUTTON_STATUS_DRIVER_RDY_Z 1507 +#define IDC_BUTTON_STATUS_MOTOR_OFF_X 1508 +#define IDC_BUTTON_STATUS_MOTOR_OFF_Y 1509 +#define IDC_BUTTON_STATUS_MOTOR_OFF_Z 1510 +#define IDC_BUTTON_STATUS_VOLFAULT_X 1511 +#define IDC_BUTTON_STATUS_VOLFAULT_Y 1512 +#define IDC_BUTTON_STATUS_VOLFAULT_Z 1513 +#define IDC_BUTTON_STATUS_POSERR_X 1514 +#define IDC_BUTTON_STATUS_POSERR_Y 1515 +#define IDC_BUTTON_STATUS_POSERR_Z 1516 +#define IDC_EDIT_REPETEST_DIS_TO 1517 +#define IDC_BUTTON1 1518 +#define IDC_BUTTON_ANIMATICS_HOME 1518 +#define IDC_BUTTON_START_SAMPLE_SCURVE 1518 +#define IDC_BUTTON_SAVE_PICTURE 1518 +#define IDC_BUTTON_SV2000E_SAVEFILE 1518 +#define IDC_BTN_CONFIGURE_CALIBRATEV 1518 +#define IDC_BUTTON_SETUP_SO7CONFIG 1518 +#define IDC_BUTTON_SCAN_KEYENCE_LK_GLASER 1518 +#define IDC_STATIC_CANVAS 1519 +#define IDC_BUTTON_STATUS_OVERHEAT_X 1520 +#define IDC_EDIT_SAMPLE_TIME_SCURVE 1520 +#define IDC_BUTTON_STATUS_OVERHEAT_Y 1521 +#define IDC_EDIT_SAMPLE_SCURVE_DIS 1521 +#define IDC_BUTTON_STATUS_OVERHEAT_Z 1522 +#define IDC_RADIO_SAMPLE_Y 1522 +#define IDC_RADIO_SAMPLE_Z 1523 +#define IDC_BUTTON2 1524 +#define IDC_BUTTON_STOP_SAMPLE_SCURVE 1524 +#define IDC_BTN_CONFIGURE_MOVEVOUT 1524 +#define IDC_BUTTON_STOP_SCAN_KEYENCE_LK_GLASER 1524 +#define IDC_CUSTOM1 1525 +#define IDC_CUSTOM_CANVAS 1525 +#define IDC_RADIO_CONTROLLER 1526 +#define IDC_RADIO_VIDEOCARD_SV2000E 1528 +#define IDC_RADIO_VIDEOCARD_TC4000 1529 +#define IDC_STATIC_SDK3000_PICTURE 1531 +#define IDC_RADIO_GRAY 1532 +#define IDC_RADIO_SV2000E_GRAY 1533 +#define IDC_BTN_CONFIGURE_MOVEVIN 1534 +#define IDC_EDIT_CONFIGURE_MSGOUT 1535 +#define IDC_EDIT_SO7CONFIG_ZOOMID 1536 +#define IDC_BUTTON_SO7CONFIG_SET_SPEED 1537 +#define IDC_BUTTON_SO7CONFIG_ZOOM_NEGLIMIT 1538 +#define IDC_BUTTON_SO7CONFIG_ZOOM_POSLIMIT 1539 +#define IDC_EDIT_SO7CONFIG_ZOOM_SLOWSPEED 1540 +#define IDC_EDIT_SO7CONFIG_ZOOM_PRECISION 1541 +#define IDC_BUTTON_SO7CONFIG_ZOOM_PRECISION 1542 +#define IDC_RADIO_SO7CONFIG_ZOOM_MOVE_SLOW 1543 +#define IDC_BUTTON_SO7CONFIG_STEP1 1544 +#define IDC_BUTTON_SO7CONFIG_STEP2 1545 +#define IDC_EDIT_SO7CONFIG_READZOOM 1546 +#define IDC_BUTTON_SO7CONFIG_SET_SUBDIVISION 1547 +#define IDC_EDIT_SO7CONFIG_MOTOR_SUBDIVISION 1548 +#define IDC_EDIT_TESTZOOM_PRODUCTID 1549 +#define IDC_RADIO_CANVAS_SPEED_TIME 1550 +#define IDC_RADIO_CANVAS_POSTION_TIME 1551 +#define IDC_EDIT_SET_PARAMETER_MSGOUTPUT 1552 +#define IDC_RADIO2 1553 +#define IDC_RADIO_KEYENCE_LASER_LK_G 1553 +#define IDC_BUTTON_GET_SCAN_DATA_KEYENCE_LK_GLASER 1555 +#define IDC_EDIT_TEST_KEYENCE_MESSAGE 1556 +#define IDC_RADIO1 1557 +#define IDC_RADIO_MACHINE_KEYENCE_TM3000 1557 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 165 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1558 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.cpp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.cpp new file mode 100644 index 0000000..e86de86 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : source file that includes just the standard includes +// Mv_Util.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.h new file mode 100644 index 0000000..2d7ee04 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/stdafx.h @@ -0,0 +1,67 @@ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once + +#ifndef _SECURE_ATL +#define _SECURE_ATL 1 +#endif + +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif + +#include "targetver.h" + +#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit + +// turns off MFC's hiding of some common and often safely ignored warning messages +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions + + +#include // MFC Automation classes + + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC support for Internet Explorer 4 Common Controls +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + +#include // MFC support for ribbons and control bars + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_IA64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + +static CString GetAppPath() +{ + CWinApp* pApp=AfxGetApp(); + if(pApp==0) + return _T(""); + + TCHAR buf[256]; + GetModuleFileName(0,buf,256); + + CString sAppPath(buf); + int nPos=sAppPath.ReverseFind('\\'); + if(nPos) + sAppPath=sAppPath.Left(nPos); + return sAppPath; +} + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/targetver.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/targetver.h new file mode 100644 index 0000000..27867ba --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/targetver.h @@ -0,0 +1,26 @@ + +#pragma once + +// The following macros define the minimum required platform. The minimum required platform +// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run +// your application. The macros work by enabling all features available on platform versions up to and +// including the version specified. + +// Modify the following defines if you have to target a platform prior to the ones specified below. +// Refer to MSDN for the latest info on corresponding values for different platforms. +#ifndef WINVER // Specifies that the minimum required platform is Windows Vista. +#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. +#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. +#endif + +#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98. +#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. +#endif + +#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0. +#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE. +#endif + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/temp_mv_config.cfg b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/temp_mv_config.cfg new file mode 100644 index 0000000..075f548 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil/temp_mv_config.cfg @@ -0,0 +1,7 @@ +> [endpoint 0x00000001] 00000010 : 7000010020000000e4fb120012000000 +> [endpoint 0x00000001] 00000010 : 6f000100a7be056634e3ad00c8c7ae00 +> [endpoint 0x00000001] 00000021 : 4c0201000131160001869f0007a11d001e84760000000000000000000000000000 + +=7000010018b3c00000000000e1100366 +=6f00010090fb1200fe000000c4fa1200 +=4c02010001b74500030d40000f423f003d09020000000000000000000000000000 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.sln b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.sln new file mode 100644 index 0000000..3197d25 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.sln @@ -0,0 +1,32 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Usb_Util", "UsbUtil\Usb_Util.vcxproj", "{50B21A79-C887-4F7E-8911-7E3A685BFA25}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Template|Win32 = Template|Win32 + Template|x64 = Template|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.ActiveCfg = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|Win32.Build.0 = Debug|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|x64.ActiveCfg = Debug|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Debug|x64.Build.0 = Debug|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.ActiveCfg = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|Win32.Build.0 = Release|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|x64.ActiveCfg = Release|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Release|x64.Build.0 = Release|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Template|Win32.ActiveCfg = Template|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Template|Win32.Build.0 = Template|Win32 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Template|x64.ActiveCfg = Template|x64 + {50B21A79-C887-4F7E-8911-7E3A685BFA25}.Template|x64.Build.0 = Template|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.suo b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.suo new file mode 100644 index 0000000..b9ac7d5 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UsbUtil_VS2010.suo differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.read.1.tlog new file mode 100644 index 0000000..1302507 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.write.1.tlog new file mode 100644 index 0000000..a6fd648 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/CL.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/cl.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/cl.command.1.tlog new file mode 100644 index 0000000..89f11e3 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/cl.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb-dll.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb-dll.log new file mode 100644 index 0000000..3da09fa --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb-dll.log @@ -0,0 +1,69 @@ +Build started 7/16/2012 3:01:00 PM. + 1>Project "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" on node 3 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lastbuildstate". + InitializeBuildStatus: + Creating "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /I..\src\driver /ZI /nologo /W3 /WX- /Od /Oy- /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"libusb0\"" /D TARGETTYPE=DYNLINK /D _WINDLL /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\\" /Fd"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\src\descriptors.c ..\src\error.c ..\src\install.c ..\src\registry.c ..\src\usb.c ..\src\windows.c + windows.c + usb.c + registry.c + install.c + error.c + descriptors.c + Generating Code... + ResourceCompile: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"libusb0\"" /D "MANIFEST_FILE=\"..\\manifest_x86.xml\"" /l"0x0409" /I..\src /nologo /fo"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\resource.res" ..\src\resource.rc + Link: + C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.dll" /NOLOGO setupapi.lib kernel32.lib advapi32.lib user32.lib shell32.lib gdi32.lib /DEF:"..\libusb0.def" /MANIFEST:NO /DEBUG /PDB:"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib" /MACHINE:X86 /DLL C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\resource.res + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\descriptors.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\error.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\install.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\registry.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\usb.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\windows.obj + Creating library C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib and object C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp + libusb-dll.vcxproj -> C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.dll + PostBuildEvent: + copy C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\*.* ..\..\LibUsb_Win\Lib\Msvc\*.* + :VCEnd + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\cl.command.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\CL.read.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\CL.write.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\descriptors.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\error.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\install.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb-dll.log + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.Build.CppClean.log + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.dll + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.ilk + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lastbuildstate + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.pdb + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.unsuccessfulbuild + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.write.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link-cvtres.read.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link-cvtres.write.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.command.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.read.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.write.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.command.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.read.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.write.1.tlog + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\registry.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\resource.res + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\usb.obj + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\vc100.idb + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\vc100.pdb + C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\windows.obj + 30 file(s) copied. + FinalizeBuildStatus: + Deleting file "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.unsuccessfulbuild". + Touching "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lastbuildstate". + 1>Done Building Project "C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:04.52 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.Build.CppClean.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.Build.CppClean.log new file mode 100644 index 0000000..9a03cd0 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.Build.CppClean.log @@ -0,0 +1,39 @@ +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\cl.command.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\CL.read.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\CL.write.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\descriptors.obj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\error.obj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\install.obj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.dll +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.ilk +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.pdb +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.write.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb-dll.vcxprojResolveAssemblyReference.cache +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.command.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.read.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link.write.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link-cvtres.read.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\link-cvtres.write.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.command.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.read.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\rc.write.1.tlog +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\registry.obj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\resource.res +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\usb.obj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\vc100.idb +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\vc100.pdb +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\windows.obj +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\DESCRIPTORS.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\ERROR.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\INSTALL.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\LIBUSB0.DLL +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\LIBUSB0.ILK +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\LIBUSB0.PDB +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\REGISTRY.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\RESOURCE.RES +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\USB.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\VC100.PDB +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\DEBUG\LIBUSB0\WINDOWS.OBJ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.exp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.exp new file mode 100644 index 0000000..10792f2 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.exp differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lastbuildstate b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lastbuildstate new file mode 100644 index 0000000..3b30817 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\| diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lib b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lib new file mode 100644 index 0000000..de2bdfe Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.write.1.tlog new file mode 100644 index 0000000..7d3b3c0 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.lib +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp +C:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Debug\libusb0\libusb0.exp diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.command.1.tlog new file mode 100644 index 0000000..051d5ef Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.read.1.tlog new file mode 100644 index 0000000..525bc7b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.write.1.tlog new file mode 100644 index 0000000..69db365 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/link.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.command.1.tlog new file mode 100644 index 0000000..cc86360 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.read.1.tlog new file mode 100644 index 0000000..331f607 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.write.1.tlog new file mode 100644 index 0000000..a6150bd Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/rc.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/resource.res b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/resource.res differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/vc100.idb b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/vc100.idb new file mode 100644 index 0000000..eb7ec4a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/libusb0/vc100.idb differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.read.1.tlog new file mode 100644 index 0000000..23efa76 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.write.1.tlog new file mode 100644 index 0000000..24bc1fe Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/CL.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache new file mode 100644 index 0000000..a3cc357 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/cl.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/cl.command.1.tlog new file mode 100644 index 0000000..c05da7a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/cl.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.command.1.tlog new file mode 100644 index 0000000..1bf5072 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.read.1.tlog new file mode 100644 index 0000000..318ee25 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.write.1.tlog new file mode 100644 index 0000000..4db4f0b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/link.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.command.1.tlog new file mode 100644 index 0000000..c272867 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.read.1.tlog new file mode 100644 index 0000000..c010f30 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.write.1.tlog new file mode 100644 index 0000000..ddde849 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/mt.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.command.1.tlog new file mode 100644 index 0000000..d74e35a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.read.1.tlog new file mode 100644 index 0000000..fcf5f2a Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.write.1.tlog new file mode 100644 index 0000000..6307d2c Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/rc.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log new file mode 100644 index 0000000..6e4af70 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log @@ -0,0 +1,24 @@ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\cl.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\CL.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\CL.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link-cvtres.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\link-cvtres.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\mt.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\rc.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN_RC.RES +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.INTERMEDIATE.MANIFEST +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.MANIFEST +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.ILK +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.PDB +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\vc100.idb +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\TESTLIBUSB-WIN\VC100.PDB diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest new file mode 100644 index 0000000..cca7079 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.exe.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate new file mode 100644 index 0000000..5213ef2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\| diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.log new file mode 100644 index 0000000..2219b4b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.log @@ -0,0 +1,26 @@ +Build started 4/2/2012 4:13:18 PM. + 1>Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" on node 3 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + InitializeBuildStatus: + Creating "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /ZI /nologo /W3 /WX- /Od /Oy- /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"testlibusb-win\"" /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\\" /Fd"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\tests\testlibusb_win.c + testlibusb_win.c + ResourceCompile: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"testlibusb-win\"" /l"0x0409" /I..\src /nologo /fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win_rc.res" ..\tests\testlibusb_win_rc.rc + Link: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe" /NOLOGO kernel32.lib user32.lib gdi32.lib advapi32.lib setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" /MANIFESTUAC:NO /DEBUG /PDB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lib" /MACHINE:X86 "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win_rc.res" + "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb_win.obj" + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib + testlibusb-win.vcxproj -> E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe + Manifest: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.manifest" /manifest "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" + FinalizeBuildStatus: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild". + Touching "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + 1>Done Building Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.92 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb-win.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb_win_rc.res b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb_win_rc.res new file mode 100644 index 0000000..faaf2fa Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/testlibusb_win_rc.res differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/vc100.idb b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/vc100.idb new file mode 100644 index 0000000..2aa1740 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Debug/testlibusb-win/vc100.idb differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.read.1.tlog new file mode 100644 index 0000000..8c745be Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.write.1.tlog new file mode 100644 index 0000000..208d43c Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/CL.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/cl.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/cl.command.1.tlog new file mode 100644 index 0000000..787b976 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/cl.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb-dll.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb-dll.log new file mode 100644 index 0000000..420c9da --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb-dll.log @@ -0,0 +1,36 @@ +Build started 6/26/2012 4:09:15 PM. + 1>Project "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lastbuildstate". + InitializeBuildStatus: + Creating "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /I..\src\driver /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"libusb0\"" /D TARGETTYPE=DYNLINK /D _WINDLL /D _MBCS /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\\" /Fd"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\src\descriptors.c ..\src\error.c ..\src\install.c ..\src\registry.c ..\src\usb.c ..\src\windows.c + descriptors.c + error.c + install.c + registry.c + usb.c + windows.c + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"libusb0\"" /l"0x0409" /I..\src /nologo /fo"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\resource.res" ..\src\resource.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.dll" /NOLOGO setupapi.lib kernel32.lib advapi32.lib user32.lib shell32.lib gdi32.lib /DEF:"..\libusb0.def" /MANIFEST:NO /DEBUG /PDB:"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.pdb" /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lib" /MACHINE:X86 /DLL D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\resource.res + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\descriptors.obj + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\error.obj + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\install.obj + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\registry.obj + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\usb.obj + D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\windows.obj + Creating library D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lib and object D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.exp + Generating code + Finished generating code + libusb-dll.vcxproj -> D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.dll + FinalizeBuildStatus: + Deleting file "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.unsuccessfulbuild". + Touching "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lastbuildstate". + 1>Done Building Project "D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:03.69 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.Build.CppClean.log b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.Build.CppClean.log new file mode 100644 index 0000000..bc4d625 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.Build.CppClean.log @@ -0,0 +1,25 @@ +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\cl.command.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\CL.read.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\CL.write.1.tlog +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\DESCRIPTORS.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\ERROR.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\INSTALL.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\LIBUSB0.DLL +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.exp +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lib +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\LIBUSB0.PDB +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.write.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb-dll.vcxprojResolveAssemblyReference.cache +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\link.command.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\link.read.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\link.write.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\link-cvtres.read.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\link-cvtres.write.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\rc.command.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\rc.read.1.tlog +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\rc.write.1.tlog +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\REGISTRY.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\RESOURCE.RES +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\USB.OBJ +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\VC100.PDB +D:\PCDMIS\2012_MR1_QA_WORKING\THIRDPARTY\USBSUPPORT\USBUTILITY\WIN32\RELEASE\LIBUSB0\WINDOWS.OBJ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.exp b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.exp new file mode 100644 index 0000000..3196876 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.exp differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lastbuildstate b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lastbuildstate new file mode 100644 index 0000000..5918370 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Release|Win32|D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\| diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lib b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lib new file mode 100644 index 0000000..4e83871 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.write.1.tlog new file mode 100644 index 0000000..575eed0 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lib +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.lib +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.exp +D:\PcDmis\2012_MR1_QA_Working\ThirdParty\UsbSupport\UsbUtility\Win32\Release\libusb0\libusb0.exp diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.command.1.tlog new file mode 100644 index 0000000..938f5c1 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.read.1.tlog new file mode 100644 index 0000000..0dfcb22 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.write.1.tlog new file mode 100644 index 0000000..e31ce10 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/link.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.command.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.command.1.tlog new file mode 100644 index 0000000..d0f422b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.command.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.read.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.read.1.tlog new file mode 100644 index 0000000..2374d6e Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.read.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.write.1.tlog b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.write.1.tlog new file mode 100644 index 0000000..0d44ed1 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/rc.write.1.tlog differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/resource.res b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/Win32/Release/libusb0/resource.res differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/ipch/usb_util-21a4a48/usb_util-7fd55013.ipch b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/ipch/usb_util-21a4a48/usb_util-7fd55013.ipch new file mode 100644 index 0000000..620b847 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/ipch/usb_util-21a4a48/usb_util-7fd55013.ipch differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/logger.h b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/logger.h new file mode 100644 index 0000000..77b3188 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/logger.h @@ -0,0 +1,56 @@ +#if !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_) +#define LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_ + +#include +#include +#include +#include +#include +#include +#include + +const long LOGINIT = 0x0001; +const long LOGACTIONS = 0x0002; +const long LOGCOMM = 0x0004; +const long LOGFLUSH = 0x0008; + +class CLogger +{ +public: + + CLogger(CString m_Name) + { + m_File = NULL; + CString Path=_T(""); // Speed optimization - noticed slow in GlowCode + if (Path.IsEmpty()) { + CString tmpPath; + GetModuleFileName(NULL,tmpPath.GetBuffer(255),255); + tmpPath.ReleaseBuffer(); + tmpPath.TrimRight(); + int nLastSlash = tmpPath.ReverseFind('\\'); + if (nLastSlash >= 0) + tmpPath = tmpPath.Left(nLastSlash); + else + tmpPath.Empty(); + Path=tmpPath; + } + m_FileName=Path + m_Name;//_T("\\SO7_SSILog.txt"); + m_lLogMask=0; + }; + ~CLogger() + { + if (m_File) + fclose(m_File); + }; + void SendAtTime(const char* buffer); + void Send(LPCTSTR, ...); + void SendAndFlush(LPCTSTR, ...); + void SendAndFlushPerMode(LPCTSTR, ...); + CString m_FileName; + long m_lLogMask; + FILE *m_File; + _TCHAR m_Str[20000]; + _TCHAR m_Str2[20000]; +}; + +#endif // !defined(LOGGER_H__5142BB38_5565_4124_88A4_56EA08298154__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Driver_Install.doc b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Driver_Install.doc new file mode 100644 index 0000000..02a5c12 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Driver_Install.doc differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Usb_Device.inf b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Usb_Device.inf new file mode 100644 index 0000000..73e8d00 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/PcDmis_Usb_Device.inf differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/amd64/libusb0.sys b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/amd64/libusb0.sys new file mode 100644 index 0000000..897f9d7 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/amd64/libusb0.sys differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/ia64/libusb0.sys b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/ia64/libusb0.sys new file mode 100644 index 0000000..147c112 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/ia64/libusb0.sys differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/license/libusb0/installer_license.txt b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/license/libusb0/installer_license.txt new file mode 100644 index 0000000..6128be6 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/license/libusb0/installer_license.txt @@ -0,0 +1,851 @@ +Copyright (c) 2002-2004 Stephan Meyer, +Copyright (c) 2000-2004 Johannes Erdfelt, +Copyright (c) 2000-2004 Thomas Sailer, +Copyright (c) 2010 Travis Robinson, + +This software is distributed under the following licenses: +Driver: GNU General Public License (GPL) +Library, Test Files, Installer: GNU Lesser General Public License (LGPL) + +*********************************************************************** + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/x86/libusb0.sys b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/x86/libusb0.sys new file mode 100644 index 0000000..2c83778 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/MicroVu/x86/libusb0.sys differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/ReadMe.txt b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/ReadMe.txt new file mode 100644 index 0000000..a6077e2 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Tools/Usb_Installer/ReadMe.txt @@ -0,0 +1,13 @@ +This is the location of the device specifc installers for libusb. + +These are generate using the inf.wizard.exe located in ThirdParty\SourceForge\LibUsb_Win\bin + +To generate the installer use the following values :- + +MicroVu +======= + +Device Name : PcDmis Usb Device +Vendor Name : Hexagon Metrology +VID : 0x0D26 +PID : 0x1001 diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.h b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.h new file mode 100644 index 0000000..a4c4f01 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.h @@ -0,0 +1,284 @@ +// sdk3000_7130.h : main header file for the SDK3000_7130 DLL +// + +#if !defined(AFX_SDK3000_7130_H__37FDA63D_0A84_4797_9E52_320E37C41382__INCLUDED_) +#define AFX_SDK3000_7130_H__37FDA63D_0A84_4797_9E52_320E37C41382__INCLUDED_ + + +static const ULONG BrightnessDefault = 0x80; +static const ULONG ContrastDefault = 0x44; +static const ULONG SaturationDefault = 0x40; +static const ULONG HueDefault = 0x00; +static const ULONG SharpnessDefault = 0x00; + +#define MIN_VAMP_BRIGHTNESS_UNITS 0 +#define MAX_VAMP_BRIGHTNESS_UNITS 255 + +#define MIN_VAMP_CONTRAST_UNITS -128 +#define MAX_VAMP_CONTRAST_UNITS 127 + +#define MIN_VAMP_HUE_UNITS -128 +#define MAX_VAMP_HUE_UNITS 127 + +#define MIN_VAMP_SATURATION_UNITS -128 +#define MAX_VAMP_SATURATION_UNITS 127 + +#define MIN_VAMP_SHARPNESS_UNITS -8 +#define MAX_VAMP_SHARPNESS_UNITS 7 + +//ͼʽ +typedef enum +{ + IMAGE_BMP = 1, //BMPļʽ + IMAGE_JPG = 2 //JPGļʽ +}enImageType; + +//ƵԴ˿ +typedef enum +{ + VIDEO_IN_1 = 0, //AVƵԴ1 + VIDEO_IN_2 = 1, //AVƵԴ2 + VIDEO_IN_3 = 2, //AVƵԴ3 + VIDEO_IN_4 = 3, //AVƵԴ4 + SVIDEO_IN = 4 //SVIDEOƵԴ +}VIDEOSOURCE; + +//Ƶ +typedef enum tagVideoProcAmpProperty +{ + VideoProcAmp_Brightness = 0, + VideoProcAmp_Contrast = VideoProcAmp_Brightness + 1, + VideoProcAmp_Hue = VideoProcAmp_Contrast + 1, + VideoProcAmp_Saturation = VideoProcAmp_Hue + 1, + VideoProcAmp_Sharpness = VideoProcAmp_Saturation + 1, + VideoProcAmp_Gamma = VideoProcAmp_Sharpness + 1, + VideoProcAmp_ColorEnable = VideoProcAmp_Gamma + 1, + VideoProcAmp_WhiteBalance = VideoProcAmp_ColorEnable + 1, + VideoProcAmp_BacklightCompensation = VideoProcAmp_WhiteBalance + 1, + VideoProcAmp_Gain = VideoProcAmp_BacklightCompensation + 1 +}VideoProcAmpProperty; + +//Ƶ +typedef enum +{ + VideoProperty_Brightness = VideoProcAmp_Brightness, // + VideoProperty_Contrast = VideoProcAmp_Contrast, //Աȶ + VideoProperty_Hue = VideoProcAmp_Hue, //ɫ + VideoProperty_Saturation = VideoProcAmp_Saturation, //Ͷ + VideoProperty_Gamma = VideoProcAmp_Gamma, //GammaУ + VideoProperty_ColorEnable = VideoProcAmp_ColorEnable, + VideoProperty_WhiteBalance = VideoProcAmp_WhiteBalance, //ƽ + VideoProperty_BacklightCompensation = VideoProcAmp_BacklightCompensation, + VideoProperty_Sharpness = VideoProcAmp_Sharpness, + VideoProperty_Gain = VideoProcAmp_Gain, +} VideoProperty; + +//SDK3000ҳ +typedef enum +{ + PropertyDlg_VideoCaptureFilter = 0,//SDK3000Ƶ豸ҳ + PropertyDlg_VideoCapturePin, //SDK3000Ƶ豸ҳ + PropertyDlg_VideoCrossbar, //Video Crossbarҳ + PropertyDlg_DeinterlaceFilter, //Deinterlace豸ҳ + PropertyDlg_DeinterlaceCapturePin, //Deinterlace豸ҳ + PropertyDlg_DeinterlacePreviewPin //Deinterlace豸Ԥҳ +} PropertyDialog; + +//Ƶ״̬ +typedef enum{ + STATE_STOP = 0, + STATE_RUN, + STATE_PAUSE +}GRAPH_STATE; + +//Ƶʽ +//VideoSubType_YUY2ʽ֧SDK3000йܡ +//ƵʽVideoSubType_YUY2⣬ֻ֧Ƶԭʼصʽ +typedef enum +{ + VideoSubType_None = -1, + VideoSubType_RGB555 = 0, + VideoSubType_RGB24, + VideoSubType_YUY2, + VideoSubType_RGB8, + VideoSubType_RGB32 +} VideoSubType; + +//Ƶʽ +typedef enum +{ + VideoStandard_None = 0x00000000, + VideoStandard_NTSC_M = 0x00000001, + VideoStandard_NTSC_M_J = 0x00000002, + VideoStandard_NTSC_433 = 0x00000004, + VideoStandard_PAL_B = 0x00000010, + VideoStandard_PAL_D = 0x00000020, + VideoStandard_PAL_H = 0x00000080, + VideoStandard_PAL_I = 0x00000100, + VideoStandard_PAL_M = 0x00000200, + VideoStandard_PAL_N = 0x00000400, + VideoStandard_PAL_60 = 0x00000800, + VideoStandard_SECAM_B = 0x00001000, + VideoStandard_SECAM_D = 0x00002000, + VideoStandard_SECAM_G = 0x00004000, + VideoStandard_SECAM_H = 0x00008000, + VideoStandard_SECAM_K = 0x00010000, + VideoStandard_SECAM_K1 = 0x00020000, + VideoStandard_SECAM_L = 0x00040000, + VideoStandard_SECAM_L1 = 0x00080000, +} VideoStandard; + +// +typedef enum +{ + Even_Field = 0, //ż + Odd_Field, //泡 + Odd_Even_Field, //泡ż + Interlaced_Field//ϳ +}VideoFieldType; + +//ƵӲ +typedef struct +{ + LONG cfHeight; //ַ߶ + LONG cfWidth; //ַ + LONG cfWeight; //ַϸ + LONG cfSpacing; //ַ + BOOL cfItalic; //б + BOOL cfUnderline; //» + BOOL cfStrikeOut; //ɾ + COLORREF cfBkColor; //ɫ + COLORREF cfTextColor; //ǰɫ + TCHAR cfFaceName[32]; // +}OSDPARAM; + +//ƵԷΧ +typedef struct +{ + long nValue; //ǰֵ + long nMin; //Сֵ + long nMax; //ֵ + long nStepDelta; //Сֵ + long nDefault; //Ĭֵ + long nCapsFlags; // +} VIDEOPROPERTYRANGE; + +//ƵϢ +typedef struct +{ + VideoSubType subtype; //Ƶʽ + RECT rcSource; //ƵԴΧ + RECT rcTarget; //ĿƵΧ + DWORD dwBitRate; // + DWORD dwBitErrorRate; //ش + LONGLONG AvgTimePerFrame;//֡ + BITMAPINFOHEADER bmiHeader; //ߡɫλʵ +} VIDEOSTREAMINFO; + +//ƵԴƵ +typedef enum +{ //@enum Field frequency + FIELD_FREQ_50HZ = 0, //@emem source is 50 Hz (PAL) + FIELD_FREQ_60HZ = 1, //@emem source is 60 Hz (NTSC) + FIELD_FREQ_0HZ = 2 //@emem source is 0 Hz (NO SIGNL) +}eFieldFrequency; + + +//̬ص +typedef void (CALLBACK *PrcCbMotionDetect)( long lnCardID, BOOL bMove, LPVOID lpContext ); +//ԭʼص +typedef void (CALLBACK *PrcCapSourceStream)( long lnCardID, long pBuf, long lnWidth, long lnHeight, long lnBiCount ); +//IOص +typedef void (CALLBACK *PrcIoAlertCallBack)( long lnCardID ); +typedef void (CALLBACK *PrcPicMessage)( long lnCardID, long pBuf, long lnWidth, long lnHeight); +//ʼSDK +HRESULT WINAPI VCAInitSdk(); +//ͷSDKԴ +void WINAPI VCAUnInitSdk(); +//õSDK3000豸 +HRESULT WINAPI VCAGetDevNum(int *pDevNum); +//豸 +HRESULT WINAPI VCAConnectDevice(int nCards, BOOL bOverlay, HWND hParentWnd, SIZE& szVidSize, VIDEOSOURCE enVideoSource, int nFrameRate = 25, VideoSubType enVideoSubType = VideoSubType_YUY2); +//Ͽ豸 +HRESULT WINAPI VCADisConnectDevice(int nCards); +//òļ +HRESULT WINAPI VCASetCaptureFile(int nCards, LPCTSTR szFileName); +//ʼ +HRESULT WINAPI VCAStartCapture(int nCards); +//ֹͣ +HRESULT WINAPI VCAStopCapture(int nCards); +//Ƿڲ +HRESULT WINAPI VCAIsCapturing(int nCards, BOOL* bIsCapturing); +//Ƶʾе +HRESULT WINAPI VCASetWindowPos(int nCards, RECT rc); +//ö̬ +HRESULT WINAPI VCAEnableMotionDetect(int nCards, BOOL bEnaDetect, BYTE *pAreaMap, LONG nSizeOfMap, LONG nPersistTime, LPVOID lpContext, PrcCbMotionDetect OnObjectMove); +//ץͼ +HRESULT WINAPI VCACapturePicture(int nCards, LPCTSTR szFileName, enImageType enImgType, RECT* rcImg, long nQuality, long nCapCount, BOOL bCapFast ); +//лƵԴ +HRESULT WINAPI VCASwitchVideoSource(int nCards, VIDEOSOURCE enVideoSource, BOOL bFast = TRUE ); +//Ƶ +HRESULT WINAPI VCASetVideoPropertyValue(int nCards, VideoProperty eVideoProperty, long value); +//õƵ +HRESULT WINAPI VCAGetVideoPropertyValue(int nCards, VideoProperty eVideoProperty, VIDEOPROPERTYRANGE* pVPR); +//IO +HRESULT WINAPI VCAIOAlertOut(int nCards, BOOL bHighLevel); +//ʼIO +HRESULT WINAPI VCAInitIOAlertIn(int nCards, PrcIoAlertCallBack ppCall); +//ʼȴIO +HRESULT WINAPI VCAStartIOAlertIn(int nCards, BOOL bHigh); +//ֹͣȴIO +HRESULT WINAPI VCAStopIOAlertIn(int nCards); +//ı +HRESULT WINAPI VCASetTextOSD(int nCards, BOOL bEnableOSD, TCHAR* pText, POINT ptTopLeft, BOOL bTransparent, OSDPARAM* pOSD, HWND nWndMain); +//ʱ +HRESULT WINAPI VCASetDateTimeOSD(int nCards, BOOL bEnableOSD, POINT ptTopLeft, BOOL bTransparent, OSDPARAM* pOSD, HWND nWndMain); +//ʾҳԻ +HRESULT WINAPI VCADisplayPropertyDialogs(int nCards, PropertyDialog id, HWND hParentWnd, LPCTSTR szCaption); +//Ƶ +HRESULT WINAPI VCARun(int nCards); +//ͣƵ +HRESULT WINAPI VCAPause(int nCards); +//ֹͣƵ +HRESULT WINAPI VCAStop(int nCards); +//õƵ״ +HRESULT WINAPI VCAGetStreamStatus(int nCards, GRAPH_STATE* pStatus); +//Ƶ֡ +HRESULT WINAPI VCASetFrameRate(int nCards, int nFrameRate); +//õƵϢ +HRESULT WINAPI VCAGetVideoInfo(int nCards, VIDEOSTREAMINFO * pVSI); +//ƵϢ +HRESULT WINAPI VCASetVideoInfo(int nCards, VIDEOSTREAMINFO * pVSI); +//ƵСΪȫ +HRESULT WINAPI VCASetFullScreen(int nCards, BOOL bFullSrc); +//ǷƵΪȫģʽ +HRESULT WINAPI VCAIsFullSrcMode(int nCards, BOOL* pFullSrc); +//õƵʽ +HRESULT WINAPI VCAGetVideoStandard(int nCards, VideoStandard* pVideoStandard, long* pAvailable); +//Ƶʽ +HRESULT WINAPI VCASetVideoStandard(int nCards, VideoStandard vs); +//öƵѹʽ +HRESULT WINAPI VCAEnumVideoCompressor(int nCards, char* arrCompDevName,int * pCompDevCount); +//õƵǰѹʽ +HRESULT WINAPI VCAGetCurrentVideoCompressor(int nCards, LPSTR pCompDevName); +//öƵǰѹʽ +HRESULT WINAPI VCASetCurrentVideoCompressor(int nCards, LPCTSTR pCompDevName); +//Ƶԭʼصʽ +HRESULT WINAPI VCAEnableCapSourceStream(int nCards, BOOL bCapStream, VideoFieldType enVideoFieldType, PrcCapSourceStream pCapStream); +// +HRESULT WINAPI VCAEnablePicMessage(int nCards, BOOL bPicMessage, PrcPicMessage pPicMessage); +//E2C +HRESULT WINAPI VCAReadE2C(int nCards, int iSubAddr, BYTE* pucData); +//дE2C +HRESULT WINAPI VCAWriteE2C(int nCards, int iSubAddr, BYTE ucData); +//õƵԴƵ( 0HZ / 50HZ / 60HZ )Ӧ( ź / PAL / NTSC ), οöٱeFieldFrequency +HRESULT WINAPI VCAGetVideoFieldFrq(int nCards, eFieldFrequency* pFieldFrequency); +//öƵ豸 +HRESULT WINAPI VCAEnumAudioCaptureDev(int nCards, char* arrAudDevName,int * pAudDevCount); +//ͨƵ豸Ƶɼ,һƵ豸()һ·, strAudDevName Ϊ"",ʾȡƵɼ +HRESULT WINAPI VCASetCurrentAudioCompressorName(int nCards, LPCTSTR strAudDevName); +//ͨƵ豸Ƶɼ,һƵ豸()һ·, nCurrentAudDevice Ϊ-1,ʾȡƵɼ +HRESULT WINAPI VCASetCurrentAudioCompressorNum(int nCards, int nCurrentAudDevice); +///////////////////////////////////////////////////////////////////////////// + +#endif // !defined(AFX_SDK3000_7130_H__37FDA63D_0A84_4797_9E52_320E37C41382__INCLUDED_) diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.lib b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.lib new file mode 100644 index 0000000..0ffd296 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.h b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.h new file mode 100644 index 0000000..3317fbe --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.h @@ -0,0 +1,328 @@ +// sdk3000_7130.h : main header file for the SDK3000_7130 DLL +// + +#if !defined(AFX_SDK3000_7130_H__37FDA63D_0A84_4797_9E52_320E37C41382__INCLUDED_) +#define AFX_SDK3000_7130_H__37FDA63D_0A84_4797_9E52_320E37C41382__INCLUDED_ + + + + + +#ifdef SDK3000_7130_EXPORTS +#define SDK_API extern "C" __declspec(dllexport) +#else +#define SDK_API extern "C" __declspec(dllimport) +#endif + +static const ULONG BrightnessDefault = 0x87; +static const ULONG ContrastDefault = 0x44; +static const ULONG SaturationDefault = 0x00; +static const ULONG HueDefault = 0x40; +static const ULONG SharpnessDefault = 0x00; + +#define MIN_VAMP_BRIGHTNESS_UNITS 0 +#define MAX_VAMP_BRIGHTNESS_UNITS 255 + +#define MIN_VAMP_CONTRAST_UNITS -128 +#define MAX_VAMP_CONTRAST_UNITS 127 + +#define MIN_VAMP_HUE_UNITS -128 +#define MAX_VAMP_HUE_UNITS 127 + +#define MIN_VAMP_SATURATION_UNITS -128 +#define MAX_VAMP_SATURATION_UNITS 127 + +#define MIN_VAMP_SHARPNESS_UNITS -8 +#define MAX_VAMP_SHARPNESS_UNITS 7 + +//ͼʽ +typedef enum +{ + IMAGE_BMP = 1, //BMPļʽ + IMAGE_JPG = 2 //JPGļʽ +}enImageType; + +//ƵԴ˿ +typedef enum +{ + VIDEO_IN_1 = 0, //AVƵԴ1 + VIDEO_IN_2 = 1, //AVƵԴ2 + VIDEO_IN_3 = 2, //AVƵԴ3 + VIDEO_IN_4 = 3, //AVƵԴ4 + SVIDEO_IN = 4 //SVIDEOƵԴ +}VIDEOSOURCE; + +//Ƶ +typedef enum tagVideoProcAmpProperty +{ + VideoProcAmp_Brightness = 0, + VideoProcAmp_Contrast = VideoProcAmp_Brightness + 1, + VideoProcAmp_Hue = VideoProcAmp_Contrast + 1, + VideoProcAmp_Saturation = VideoProcAmp_Hue + 1, + VideoProcAmp_Sharpness = VideoProcAmp_Saturation + 1, + VideoProcAmp_Gamma = VideoProcAmp_Sharpness + 1, + VideoProcAmp_ColorEnable = VideoProcAmp_Gamma + 1, + VideoProcAmp_WhiteBalance = VideoProcAmp_ColorEnable + 1, + VideoProcAmp_BacklightCompensation = VideoProcAmp_WhiteBalance + 1, + VideoProcAmp_Gain = VideoProcAmp_BacklightCompensation + 1 +}VideoProcAmpProperty; + +//Ƶ +typedef enum +{ + VideoProperty_Brightness = VideoProcAmp_Brightness, // + VideoProperty_Contrast = VideoProcAmp_Contrast, //Աȶ + VideoProperty_Hue = VideoProcAmp_Hue, //ɫ + VideoProperty_Saturation = VideoProcAmp_Saturation, //Ͷ + VideoProperty_Gamma = VideoProcAmp_Gamma, //GammaУ + VideoProperty_ColorEnable = VideoProcAmp_ColorEnable, + VideoProperty_WhiteBalance = VideoProcAmp_WhiteBalance, //ƽ + VideoProperty_BacklightCompensation = VideoProcAmp_BacklightCompensation, + VideoProperty_Sharpness = VideoProcAmp_Sharpness, + VideoProperty_Gain = VideoProcAmp_Gain, +} VideoProperty; + +//SDK3000ҳ +typedef enum +{ + PropertyDlg_VideoCaptureFilter = 0,//SDK3000Ƶ豸ҳ + PropertyDlg_VideoCapturePin, //SDK3000Ƶ豸ҳ + PropertyDlg_VideoCrossbar, //Video Crossbarҳ + PropertyDlg_DeinterlaceFilter, //Deinterlace豸ҳ + PropertyDlg_DeinterlaceCapturePin, //Deinterlace豸ҳ + PropertyDlg_DeinterlacePreviewPin //Deinterlace豸Ԥҳ +} PropertyDialog; + +//Ƶ״̬ +typedef enum{ + STATE_STOP = 0, + STATE_RUN, + STATE_PAUSE +}GRAPH_STATE; + +//Ƶʽ +//VideoSubType_YUY2ʽ֧SDK3000йܡ +//ƵʽVideoSubType_YUY2⣬ֻ֧Ƶԭʼصʽ +typedef enum +{ + VideoSubType_None = -1, + VideoSubType_RGB555 = 0, + VideoSubType_RGB24, + VideoSubType_YUY2, + VideoSubType_RGB8, + VideoSubType_RGB32 +} VideoSubType; + +//Ƶʽ +typedef enum +{ + VideoStandard_None = 0x00000000, + VideoStandard_NTSC_M = 0x00000001, + VideoStandard_NTSC_M_J = 0x00000002, + VideoStandard_NTSC_433 = 0x00000004, + VideoStandard_PAL_B = 0x00000010, + VideoStandard_PAL_D = 0x00000020, + VideoStandard_PAL_H = 0x00000080, + VideoStandard_PAL_I = 0x00000100, + VideoStandard_PAL_M = 0x00000200, + VideoStandard_PAL_N = 0x00000400, + VideoStandard_PAL_60 = 0x00000800, + VideoStandard_SECAM_B = 0x00001000, + VideoStandard_SECAM_D = 0x00002000, + VideoStandard_SECAM_G = 0x00004000, + VideoStandard_SECAM_H = 0x00008000, + VideoStandard_SECAM_K = 0x00010000, + VideoStandard_SECAM_K1 = 0x00020000, + VideoStandard_SECAM_L = 0x00040000, + VideoStandard_SECAM_L1 = 0x00080000, +} VideoStandard; + +// +typedef enum +{ + Even_Field = 0, //ż + Odd_Field, //泡 + Odd_Even_Field, //泡ż + Interlaced_Field//ϳ +}VideoFieldType; + + +#define MAX_FACENAME 32 +//ƵӲ +typedef struct +{ + LONG cfHeight; //ַ߶ + LONG cfWidth; //ַ + LONG cfWeight; //ַϸ + LONG cfSpacing; //ַ + BOOL cfItalic; //б + BOOL cfUnderline; //» + BOOL cfStrikeOut; //ɾ + COLORREF cfBkColor; //ɫ + COLORREF cfTextColor; //ǰɫ + TCHAR cfFaceName[MAX_FACENAME]; // +}OSDPARAM; + +//ƵԷΧ +typedef struct +{ + long nValue; //ǰֵ + long nMin; //Сֵ + long nMax; //ֵ + long nStepDelta; //Сֵ + long nDefault; //Ĭֵ + long nCapsFlags; // +} VIDEOPROPERTYRANGE; + +//ƵϢ +typedef struct +{ + VideoSubType subtype; //Ƶʽ + RECT rcSource; //ƵԴΧ + RECT rcTarget; //ĿƵΧ + DWORD dwBitRate; // + DWORD dwBitErrorRate; //ش + LONGLONG AvgTimePerFrame;//֡ + BITMAPINFOHEADER bmiHeader; //ߡɫλʵ +} VIDEOSTREAMINFO; + +//ƵԴƵ +typedef enum +{ //@enum Field frequency + FIELD_FREQ_50HZ = 0, //@emem source is 50 Hz (PAL) + FIELD_FREQ_60HZ = 1, //@emem source is 60 Hz (NTSC) + FIELD_FREQ_0HZ = 2 //@emem source is 0 Hz (NO SIGNL) +}eFieldFrequency; + +typedef enum +{ + E_MPEG_MPEG1 = 0, // generic ISO/IEC 11172-1/2 + E_MPEG_VCD, // MPEG-1 VideoCD + E_MPEG_MPEG2, // generic ISO/IEC 13818-1/2 + E_MPEG_SVCD, // MPEG-2 SuperVCD + E_MPEG_DVD // MPEG-2 DVD-Video +}eVideoMpegType; + +enum TVRecordFormat +{ + TVRF_AVI = 0, + TVRF_MPEG1 = 1, + TVRF_MPEG2 = 2, + TVRF_MPEG4 = 3, + TVRF_VCD = 4, + TVRF_SVCD = 5, + TVRF_DVD = 6, + TVRF_HIDVD = 7, + TVRF_CUSTOM +}; + + +//̬ص +typedef void (CALLBACK *PrcCbMotionDetect)( long lnCardID, BOOL bMove, LPVOID lpContext ); +//ԭʼص +typedef void (CALLBACK *PrcCapSourceStream)( long lnCardID, long pBuf, long lnWidth, long lnHeight, long lnBiCount ); +//IOص +typedef void (CALLBACK *PrcIoAlertCallBack)( long lnCardID ); +typedef void (CALLBACK *PrcPicMessage)( long lnCardID, long pBuf, long lnWidth, long lnHeight); +//ʼSDK +SDK_API HRESULT __stdcall VCAInitSdk(); +//ͷSDKԴ +SDK_API void __stdcall VCAUnInitSdk(); +//õSDK3000豸 +SDK_API HRESULT __stdcall VCAGetDevNum(int *pDevNum); +//豸 +SDK_API HRESULT __stdcall VCAConnectDevice(int nCards, BOOL bOverlay, HWND hParentWnd, SIZE& szVidSize, VIDEOSOURCE enVideoSource, int nFrameRate = 25, VideoSubType enVideoSubType = VideoSubType_YUY2); +//Ͽ豸 +SDK_API HRESULT __stdcall VCADisConnectDevice(int nCards); +//òļ +SDK_API HRESULT __stdcall VCASetCaptureFile(int nCards, char* szFileName); +//ʼ +SDK_API HRESULT __stdcall VCAStartCapture(int nCards); +//ֹͣ +SDK_API HRESULT __stdcall VCAStopCapture(int nCards); +//Ƿڲ +SDK_API HRESULT __stdcall VCAIsCapturing(int nCards, BOOL* bIsCapturing); +//Ƶʾе +SDK_API HRESULT __stdcall VCASetWindowPos(int nCards, RECT rc); +//ö̬ +SDK_API HRESULT __stdcall VCAEnableMotionDetect(int nCards, BOOL bEnaDetect, BYTE *pAreaMap, LONG nSizeOfMap, LONG nPersistTime, LPVOID lpContext, PrcCbMotionDetect OnObjectMove); +//ץͼ +SDK_API HRESULT __stdcall VCACapturePicture(int nCards, char* szFileName, enImageType enImgType, RECT* rcImg, long nQuality, long nCapCount, BOOL bCapFast ); +//лƵԴ +SDK_API HRESULT __stdcall VCASwitchVideoSource(int nCards, VIDEOSOURCE enVideoSource, BOOL bFast = TRUE ); +//Ƶ +SDK_API HRESULT __stdcall VCASetVideoPropertyValue(int nCards, VideoProperty eVideoProperty, long value); +//õƵ +SDK_API HRESULT __stdcall VCAGetVideoPropertyValue(int nCards, VideoProperty eVideoProperty, VIDEOPROPERTYRANGE* pVPR); +//IO +SDK_API HRESULT __stdcall VCAIOAlertOut(int nCards, BOOL bHighLevel); +//ʼIO +SDK_API HRESULT __stdcall VCAInitIOAlertIn(int nCards, PrcIoAlertCallBack ppCall); +//ʼȴIO +SDK_API HRESULT __stdcall VCAStartIOAlertIn(int nCards, BOOL bHigh); +//ֹͣȴIO +SDK_API HRESULT __stdcall VCAStopIOAlertIn(int nCards); +//ı +SDK_API HRESULT __stdcall VCASetTextOSD(int nCards, BOOL bEnableOSD, TCHAR* pText, POINT ptTopLeft, BOOL bTransparent, OSDPARAM* pOSD, HWND nWndMain); +//ʱ +SDK_API HRESULT __stdcall VCASetDateTimeOSD(int nCards, BOOL bEnableOSD, POINT ptTopLeft, BOOL bTransparent, OSDPARAM* pOSD, HWND nWndMain); +//ʾҳԻ +SDK_API HRESULT __stdcall VCADisplayPropertyDialogs(int nCards, PropertyDialog id, HWND hParentWnd, char* szCaption); +//Ƶ +SDK_API HRESULT __stdcall VCARun(int nCards); +//ͣƵ +SDK_API HRESULT __stdcall VCAPause(int nCards); +//ֹͣƵ +SDK_API HRESULT __stdcall VCAStop(int nCards); +//õƵ״ +SDK_API HRESULT __stdcall VCAGetStreamStatus(int nCards, GRAPH_STATE* pStatus); +//Ƶ֡ +SDK_API HRESULT __stdcall VCASetFrameRate(int nCards, int nFrameRate); +//õƵϢ +SDK_API HRESULT __stdcall VCAGetVideoInfo(int nCards, VIDEOSTREAMINFO * pVSI); +//ƵϢ +SDK_API HRESULT __stdcall VCASetVideoInfo(int nCards, VIDEOSTREAMINFO * pVSI); +//ƵСΪȫ +SDK_API HRESULT __stdcall VCASetFullScreen(int nCards, BOOL bFullSrc); +//ǷƵΪȫģʽ +SDK_API HRESULT __stdcall VCAIsFullSrcMode(int nCards, BOOL* pFullSrc); +//õƵʽ +SDK_API HRESULT __stdcall VCAGetVideoStandard(int nCards, VideoStandard* pVideoStandard, long* pAvailable); +//Ƶʽ +SDK_API HRESULT __stdcall VCASetVideoStandard(int nCards, VideoStandard vs); +//öƵѹʽ +SDK_API HRESULT __stdcall VCAEnumVideoCompressor(int nCards, char* arrCompDevName,int * pCompDevCount); +//õƵǰѹʽ +SDK_API HRESULT __stdcall VCAGetCurrentVideoCompressor(int nCards, char* pCompDevName); +//öƵǰѹʽ +SDK_API HRESULT __stdcall VCASetCurrentVideoCompressor(int nCards, char* pCompDevName); +//Ƶԭʼصʽ +SDK_API HRESULT __stdcall VCAEnableCapSourceStream(int nCards, BOOL bCapStream, VideoFieldType enVideoFieldType, PrcCapSourceStream pCapStream); +// +SDK_API HRESULT __stdcall VCAEnablePicMessage(int nCards, BOOL bPicMessage, PrcPicMessage pPicMessage); +//E2C +SDK_API HRESULT __stdcall VCAReadE2C(int nCards, int iSubAddr, BYTE* pucData); +//дE2C +SDK_API HRESULT __stdcall VCAWriteE2C(int nCards, int iSubAddr, BYTE ucData); +//õƵԴƵ( 0HZ / 50HZ / 60HZ )Ӧ( ź / PAL / NTSC ), οöٱeFieldFrequency +SDK_API HRESULT __stdcall VCAGetVideoFieldFrq(int nCards, eFieldFrequency* pFieldFrequency); +//öƵ豸 +SDK_API HRESULT __stdcall VCAEnumAudioCaptureDev(int nCards, char* arrAudDevName,int * pAudDevCount); +//ͨƵ豸Ƶɼ,һƵ豸()һ·, strAudDevName Ϊ"",ʾȡƵɼ +SDK_API HRESULT __stdcall VCASetCurrentAudioCompressorName(int nCards, char* strAudDevName); +//ͨƵ豸Ƶɼ,һƵ豸()һ·, nCurrentAudDevice Ϊ-1,ʾȡƵɼ +SDK_API HRESULT __stdcall VCASetCurrentAudioCompressorNum(int nCards, int nCurrentAudDevice); +// +SDK_API HRESULT __stdcall VCASetRecordMode(int nCards, TVRecordFormat tvRF); + +///////////////////////////////////////////////////////////////////////////// + +// ͼݵ +SDK_API HRESULT __stdcall VCACopyToClipBoard(int nCards); +// ǷOverlayʽʾ +SDK_API HRESULT __stdcall VCAIsOverlay(int nCards, BOOL* bIsOverlay); + + +SDK_API HRESULT __stdcall VCASetVideoMpegType(int nCards, eVideoMpegType eType); + +#endif \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.lib b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.lib new file mode 100644 index 0000000..24f4654 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SDK3000/sdk3000_7130_NEW.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.h b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.h new file mode 100644 index 0000000..b259fc0 --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.h @@ -0,0 +1,517 @@ + +#ifndef __DXMEDIACAP_2011__ +#define __DXMEDIACAP_2011__ + +#include "datastru.h" + +/* + + ʼ SDK ڵ֮ǰ + + +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXInitialize(); +void __stdcall DXUninitialize(); + +/* + + ȡʼɹ豸 + + +ֵ + ƥ豸 +// */ +unsigned __stdcall DXGetDeviceCount(); + +/* + + öƵ + + devTags - [out] ڷػõĹ TAG + num - [in/out] ָ devTags ԪظʱʵϻõĹ TAG ĸ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnumVideoCodecs(PDEVICE_TAG devTags, unsigned& num); +unsigned __stdcall DXEnumAudioCodecs(PDEVICE_TAG devTags, unsigned& num); + +/* + + öƵ׽豸 + + devTags - [out] ڷػõĹ TAG + num - [in/out] ָ devTags ԪظʱʵϻõĹ TAG ĸ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnumVideoDevices(PDEVICE_TAG devTags, unsigned& num); + +/* + + öƵ׽Ⱦ豸 + + devTags - [out] ڷػõĹ TAG + num - [in/out] ָ devTags ԪظʱʵϻõĹ TAG ĸ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnumAudioDevices(PDEVICE_TAG devTags, unsigned& num); +unsigned __stdcall DXEnumSoundDevices(PDEVICE_TAG devTags, unsigned& num); + +/* + + ռòɼ豸 + + idx - [in] 豸öٹе + err - [out] ش +ֵ + ɹ򷵻豸򷵻 NULLͨ err ô +// */ +device_handle __stdcall DXOpenDevice(unsigned idx, unsigned* err = NULL); +void __stdcall DXCloseDevice(device_handle device); + +/* + + ҳʾƶָ + + device - [in] 豸 + attrID - [in] + hOwner - [in] ľNULL - ҳ + rect - [in] ڸʾNULL - ʾͻ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXShowDeviceAttr(device_handle device, unsigned attrID, HWND hOwner, RECT* rect); + +// unsigned __stdcall DXShowDeviceAttr(device_handle device, HWND XBar, HWND Capture, HWND stream, HWND codec); + +/* + + ȡƵ + + device - [in] 豸 + standard - [out] Ƶʽ + colorspace - [out] ɫʿռ + width - [out] Ƶȣλأ + height - [out] Ƶ߶ȣλأ + framerate - [out] Ƶ֡ʣλ֡/룩 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetVideoPara(device_handle device, unsigned& standard, unsigned& colorspace, + unsigned& width, unsigned& height, float& framerate); + +/* + + Ƶ + + device - [in] 豸 + standard - [in] Ƶʽ + colorspace - [in] ɫʿռ + width - [in] Ƶȣλأ + height - [in] Ƶ߶ȣλأ + framerate - [in] Ƶ֡ʣλ֡/룩 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetVideoPara(device_handle device, unsigned standard, unsigned colorspace, + unsigned width, unsigned height, float framerate); + +/* + + ȡʾԵȡֵΧĬֵ־ + + device - [in] 豸 + paraType - [in] + 0 - ȣ1 - Աȶȣ2 - Ͷȣ3 - ɫȣ4 - + pMin - [in] Сֵ + pMax - [in] ֵ + pSteppingDelta - [in] + pDefault - [in] Ĭֵ + pCapsFlags - [in] Զ/ֶ־ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetDisplayParaRange(device_handle device, unsigned paraType, + long* pMin, long* pMax, long* pSteppingDelta, long* pDefault, long* pCapsFlags); + +/* + + ȡʾ + + device - [in] 豸 + paraType - [in] + 0 - ȣ1 - Աȶȣ2 - Ͷȣ3 - ɫȣ4 - + value - [out] ֵ + flag - [out] Զ/ֶ־ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetDisplayPara(device_handle device, unsigned paraType, long& value, long& flags); + +/* + + ʾ + + device - [in] 豸 + paraType - [in] + 0 - ȣ1 - Աȶȣ2 - Ͷȣ3 - ɫȣ4 - + value - [in] ֵ + flag - [in] Զ/ֶ־ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetDisplayPara(device_handle device, unsigned paraType, long value, long flags); + +/* + + ȡƵ + + device - [in] 豸 + mode - [out] ģʽ + bitrate - [out] ʣλkbps + keyinterval - [out] ؼ֡ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetVideoCodecPara(device_handle device, unsigned& mode, unsigned& bitrate, unsigned& keyinterval); + +/* + + Ƶ + + device - [in] 豸 + mode - [in] ģʽ + bitrate - [in] ʣλkbps + keyinterval - [in] ؼ֡ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetVideoCodecPara(device_handle device, unsigned mode, unsigned bitrate, unsigned keyinterval); + +/* + + ȡ豸ǰѡĶӺͰ + + device - [in] 豸 + curSource - [out] ǰѡӵšNULL - + sources - [out] ӵ飨磺S-VIDEODV...NULL - + num - [in/out] NULL - ԣʱɻȡǰѡ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetVideoSources(device_handle device, unsigned* curSource, unsigned* sources = NULL, unsigned char* num = NULL); + +/* + + 豸 + + device - [in] 豸 + source - [in] ǰѡӵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetVideoSource(device_handle device, unsigned source); + +/* + + ȡ豸ź״̬ + + device - [in] 豸 + signal - [out] ź״̬0 - źŶʧ1 - ź +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetSignalPresent(device_handle device, unsigned& signal); + +/* + + 豸״̬ + + device - [in] 豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXDeviceRun(device_handle device); +unsigned __stdcall DXDevicePause(device_handle device); +unsigned __stdcall DXDeviceStop(device_handle device); + +/* + + ȡ豸״̬ + + device - [in] 豸 + state - [out] 豸״̬ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetDeviceState(device_handle device, unsigned& state); + +/* + + Ƶʾָľ + + device - [in] 豸 + hWnd - [in] ʾƵĴNULL - ֹͣʾƵ + rect - [in] ƵʾľNULL - ռ + vmrtype - [in] ñ׼ָʾֻã +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStartPreview(device_handle device, HWND hWnd, PRECT rect, unsigned vmrtype); + +/* + + ֹͣԤ + + device - [in] 豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStopPreview(device_handle device); + +/* + + Ƶʾ + + device - [in] 豸 + bFreeze - [in] TRUE - ʾFALSE - ⶳʾ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXFreezePreview(device_handle device, BOOL bFreeze); + +/* + + 豸ǷƵ + + device - [in] 豸 + bHasAudio - [out] TRUE - ƵFALSE - ûƵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXHasAudio(device_handle device, BOOL& bHasAudio); + +/* + + Ϊ豸Ƶɼ豸 + ע⣺!!! ֻ state_stopped ״̬µ + + device - [in] 豸 + bSound - [in] TRUE - ʼFALSE - ֹ + audioDevice - [in] Ƶɼ豸NULL - ʹ豸ԴƵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetAudioDevice(device_handle device, PDEVICE_TAG audioDevice = NULL); + +/* + + ʼֹ + ע⣺!!! ֻпʼڡ¼ʱƵȲܳɹ + + device - [in] 豸 + bSound - [in] TRUE - ʼFALSE - ֹ + soundDevice - [in] 豸NULL - ʹĬ豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetSoundOut(device_handle device, BOOL bSound/*, PDEVICE_TAG soundDevice = NULL*/); + +/* + + + + device - [in] 豸 + bMute - [in] TRUE - FALSE - Ǿ +ֵ + 0 - ɹʧ򷵻ش룬һʧԭΪûпʼ +// */ +unsigned __stdcall DXEnableMute(device_handle device, BOOL bMute); + +/* + + ƽ + + device - [in] 豸 + volume - [in] СȡֵΧ(0, 100] + balance - [in] ƽ⣬ȡֵΧ[-10, 10]ʾǿǿ0 - ƽ + ע⣺!!! NULL - ʾƽ +ֵ + 0 - ɹʧ򷵻ش룬һʧԭΪûпʼ +// */ +unsigned __stdcall DXSetAudioVolume(device_handle device, unsigned char volume, unsigned char* const balance = NULL); + +/* + + ȡƽ + + device - [in] 豸 + volume - [out] СȡֵΧ(0, 100] + ע⣺!!! NULL - ʾȡ + balance - [out] ƽ⣬ȡֵΧ[-10, 10]ʾǿǿ0 - ƽ + ע⣺!!! NULL - ʾȡƽ +ֵ + 0 - ɹʧ򷵻ش룬һʧԭΪûпʼ +// */ +unsigned __stdcall DXGetAudioVolume(device_handle device, unsigned char* volume, unsigned char* balance = NULL); + +/* + + Ƶ + ע⣺!!! ڽ¼ʱʧ + + device - [in] 豸 + videoEncoder - [in] Ƶ TAGNULL - ʾñ룬¼ʱԭʼ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetVideoCodec(device_handle device, PDEVICE_TAG videoEncoder); + +/* + + Ƶ + ע⣺!!! ڽ¼ʱʧ + + device - [in] 豸 + audioEncoder - [in] Ƶ TAGNULL - ʾñ룬¼ʱԭʼ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetAudioCodec(device_handle device, PDEVICE_TAG audioEncoder); + +/* + + ʼ¼ + + device - [in] 豸 + szFileName - [in] ָ¼ļȫ·NULL - ֹͣ¼ + saveAudio - [in] ǷƵҲ¼Ƶļ + timeSize - [in] ޶¼ļʱ䳤ȣλ룩NULL - + dataSize - [in] ޶¼ļݳȣλֽڣNULL - + saveNotify - [in] ¼¼֪ͨӿָ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStartCapture(device_handle device, TCHAR* szFileName, BOOL saveAudio, + unsigned* timeSize = NULL, unsigned* dataSize = NULL, + ISaveNotify* saveNotify = NULL); + +/* + + ֹͣ¼ + + device - [in] 豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStopCapture(device_handle device); + +/* + + ¼񲿷֣ƵƵ + ע⣺!!! Ҫʱ¼ + + device - [in] 豸 + bFreeze - [in] TRUE - ¼FALSE - ⶳ¼ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXFreezeCaputre(device_handle device, BOOL bFreeze); + +/* + + ƵЧԭʼƵݣ + + device - [in] 豸 + ispTask - [in] ²ƵЧĽӿָ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXAttachIspTask(device_handle device, IispTask* ispTask); +unsigned __stdcall DXDetachIspTask(device_handle device, IispTask* ispTask); + +/* + + Ƶݻصĺԭ + + fourcc - [in] ȡıݵıFOURCC + buffer - [in] ָ + bufferSize - [out] ȡıݵĻСλֽڣ + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +typedef unsigned (__stdcall *fnEncVideoCallback)(unsigned fourcc, unsigned char* buffer, unsigned bufferSize, void* context); + +/* + + ñƵݻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetEncVideoCallback(device_handle device, fnEncVideoCallback fn, void* context); + +/* + + ʼƵݻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStartEncVideoCallback(device_handle device, fnEncVideoCallback fn, void* context); + +/* + + ֹͣƵݻصĺ + + device - [in] 豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStopEncVideoCallback(device_handle device); + +/* + + ʹȥй + + device - [in] 豸 + deinterlace - [in] ȥе㷨 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnableDeinterlace(device_handle device, unsigned deinterlace); + +/* + + ʹȥ빦 + + device - [in] 豸 + denoise - [in] ȥ㷨 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnableDenoise(device_handle device, unsigned denoise); + +/* + + ʹαʹ + + device - [in] 豸 + szPColorTemplateFile - [in] αʵģļNULL - ֹͣʹα + pcolorDepth - [in] αʵɫ˲ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnablePColor(device_handle device, TCHAR* szPColorTemplateFile, unsigned pcolorDepth); + +#endif // __DXMEDIACAP_2011__ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.lib b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.lib new file mode 100644 index 0000000..e2d6d57 Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/DXMediaCap.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.h b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.h new file mode 100644 index 0000000..857c65a --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.h @@ -0,0 +1,307 @@ + +#ifndef __DATA_ACQ_2011__ +#define __DATA_ACQ_2011__ + +#include + +#include "DXMediaCap.h" + +/* + + ȡָԭʼƵ֡ݵ + + device - [in] 豸 + buffer - [in] ָ򻺳NULL - Ӧݣ磬軺ĴСɫռ䡢Ƶߴ + bufferLen - [in] ָĻĴСλֽڣ + gotBufferLen - [out] ʵʻȡݵĴСλֽڣ + colorSpace - [out] ȡԭʼݵɫʿռ + width - [out] ȡԭʼݵؿ + height - [out] ȡԭʼݵظ߶ + bytesWidth - [out] ȡԭʼݵֽڿ + rect - [in] ָȡݵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXGetFrameBuffer(device_handle device, unsigned char* buffer, unsigned bufferLen, unsigned* gotBufferLen = NULL, + unsigned* colorSpace = NULL, unsigned* width = NULL, unsigned* height = NULL, unsigned* bytesWidth = NULL, + PRECT rect = NULL); + +/* + + ԭʼƵ֡ݵ BMPļ + + szFileName - [in] BMPļ· + buffer - [in] ָ򻺳 + bufferLen - [in] ָĻĴСλֽڣ + colorSpace - [in] ȡԭʼݵɫʿռ + width - [in] ȡԭʼݵؿ + height - [in] ȡԭʼݵظ߶ + bytesWidth - [in] ȡԭʼݵֽڿ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSaveBMPFile(TCHAR* szFileName, unsigned char* buffer, unsigned bufferLen, + unsigned colorSpace, unsigned width, unsigned height, unsigned bytesWidth); + +/* + + ԭʼƵ֡ݵ JPGļ + + szFileName - [in] JPGļ· + buffer - [in] ָ򻺳 + bufferLen - [in] ָĻĴСλֽڣ + colorSpace - [in] ȡԭʼݵɫʿռ + width - [in] ȡԭʼݵؿ + height - [in] ȡԭʼݵظ߶ + bytesWidth - [in] ȡԭʼݵֽڿ + quality - [in] JPGļĻ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSaveJPGFile(TCHAR* szFileName, unsigned char* buffer, unsigned bufferLen, + unsigned colorSpace, unsigned width, unsigned height, unsigned bytesWidth, unsigned quality); + +/* + + ֱץȡԭʼƵ֡ݵ BMPļ + + device - [in] 豸 + szFileName - [in] BMPļ· + rect - [in] ָȡݵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSnapToBMPFile(device_handle device, TCHAR* szFileName, PRECT rect = NULL); + +/* + + ֱץȡԭʼƵ֡ݵ BMPļ + + device - [in] 豸 + szFileName - [in] BMPļ· + buffer - [in] ָ򻺳 + bufferLen - [in] ָĻĴСλֽڣ + colorSpace - [in] ȡԭʼݵɫʿռ + width - [in] ȡԭʼݵؿ + height - [in] ȡԭʼݵظ߶ + bytesWidth - [in] ȡԭʼݵֽڿ + rect - [in] ָȡݵ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSnapToJPGFile(device_handle device, TCHAR* szFileName, unsigned quality, PRECT rect = NULL); + +/* + + ԭʼƵݻصĺԭ + + buffer - [in] ָ + colorSpace - [in] ȡԭʼݵɫʿռ + width - [in] ȡԭʼݵؿ + height - [in] ȡԭʼݵظ߶ + bytesWidth - [in] ȡԭʼݵֽڿ + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +typedef unsigned (__stdcall *fnRawVideoCallback)(unsigned char* buffer, unsigned colorSpace, + unsigned width, unsigned height, unsigned bytesWidth, void* context); + +/* + + ԭʼƵݻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetRawVideoCallback(device_handle device, fnRawVideoCallback fn, void* context); + +/* + + ʼԭʼƵݻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStartRawVideoCallback(device_handle device, fnRawVideoCallback fn, void* context); + +/* + + ֹͣԭʼƵݻصĺ + + device - [in] 豸 +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXStopRawVideoCallback(device_handle device); + +/* + + ԭʼƵݻصĺԭ + + buffer - [in] ָ + bufferLen - [in] ָĻĴСλֽڣ + wfx - [in] Ƶݸʽ + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +typedef unsigned (__stdcall *fnRawAudioCallback)(unsigned char* buffer, unsigned bufferLen, WAVEFORMATEX* wfx, void* context); + +/* + + ԭʼƵݻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetRawAudioCallback(device_handle device, fnRawAudioCallback fn, void* context); + + +/* + + ԭʼƵݵӻصĺԭ + + hdc - [in] ƵӵHDC + width - [in] ܹӵĿȣλأ + height - [in] ܹӵĸ߶ȣλأ + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +typedef unsigned (__stdcall *fnOSDCallback)(HDC hdc, unsigned width, unsigned height, void* context); + +/* + + Ƶݵӻصĺ + + device - [in] 豸 + fn - [in] صָ룬NULL - ֹͣص + context - [in] ص +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetOSDCallback(device_handle device, fnOSDCallback fn, void* context); + +enum {osd_text, osd_time, osd_image}; +#define MAX_OSD_TEXT_LEN 16 +/* + + ԭʼƵ֡ݵOSD + + device - [in] 豸 + osdType - [in] OSD + x - [in] ָOSDϽǺ + x - [in] ָOSDϽ + osdData - [in] OSDݣNULL - ȡOSD + osdType = osd_textMAX_OSD_TEXT_LENַ + osdType = osd_timeָʱʽ + osdType = osd_imageָͼƬ· + pointSize - [in] С + faceName - [in] + color - [in] osd_text, osd_time ͵OSDǰɫĬֵɫRGB(255, 255, 255) + bgcolor - [in] OSDıɫĬֵɫRGB(0, 0, 0) + opaque - [in] OSDıɫǷ͸Ĭֵǡѡ͸ʱ bgcolor ͸ + alpha - [in] alphaֵȡֵ[0 ~ 255]0 - OSD͸255 - OSD͸мֵ - OSDƵݽalpha +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXSetOSD(device_handle device, unsigned osdType, int x, int y, char* osdData, int pointSize = 120, LPCTSTR faceName = TEXT("Arial"), + COLORREF color = RGB(255, 255, 255), COLORREF bgcolor = RGB(0, 0, 0), BOOL opaque = TRUE, + unsigned char alpha = 255); + +/* + + /ԭʼƵ֡ݵOSD + + device - [in] 豸 + osdType - [in] OSD + enable - [in] TRUE - OSDFALSE - OSD +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXEnableOSD(device_handle device, unsigned osdType, BOOL enable); + +/* + + ͼƬ崴Ԥ + + imgbuffer - [in] ͼƬ + buffersize - [in] ͼƬĴСλֽڣ + colorspace - [in] ͼƬݵɫʿռ + width - [in] ͼƬĿȣλأ + height - [in] ͼƬĸ߶ȣλأ + err - [out] ش +ֵ + ɹ򷵻ͼ򷵻 NULLͨ err ô +// */ +image_handle __stdcall DXCreateBufferImg(unsigned char* imgbuffer, unsigned buffersize, + unsigned colorspace, unsigned width, unsigned height, + unsigned* err); + +/* + + ͼƬļԤ + + szImgFile - [in] ͼƬļȫ· + err - [out] ش +ֵ + ɹ򷵻ͼ򷵻 NULLͨ err ô +// */ +image_handle __stdcall DXCreateFileImg(TCHAR* szImgFile, unsigned* err); + +/* + + ɸԤָĴӦ + + img - [in] Ԥ + hPrevWnd - [in] ԤĴ + rect - [in] Ԥ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXUpdateImg(image_handle img, HWND hPrevWnd, RECT* rect); + +/* + + ɾԤ + + img - [in] Ԥ +ֵ + +// */ +void __stdcall DXDestroyImg(image_handle img); + +/* + + תƵ + + device - [in] 豸 + flip - [in] TRUE - ÷תFALSE - ÷ת +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXFlipVideo(device_handle device, BOOL flip); + +/* + + Ƶ + + device - [in] 豸 + mirror - [in] TRUE - þFALSE - þ +ֵ + 0 - ɹʧ򷵻ش +// */ +unsigned __stdcall DXMirrorVideo(device_handle device, BOOL mirror); + + +#endif // __DATA_ACQ_2011__ \ No newline at end of file diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.lib b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.lib new file mode 100644 index 0000000..ed18e9b Binary files /dev/null and b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/dataAcq.lib differ diff --git a/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/datastru.h b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/datastru.h new file mode 100644 index 0000000..371a50f --- /dev/null +++ b/PcDmis/Base/Interfac/Msi/Hsi/Videocard/SV2000E/datastru.h @@ -0,0 +1,155 @@ +/******************************************************************** + created: 2011/08/05 + created: 5:8:2011 9:31 + filename: .\libDXCap\datastru.h + file path: .\libDXCap + purpose: +*********************************************************************/ + +#ifndef __LIBDXCAP_DATASTRU__20110805__ +#define __LIBDXCAP_DATASTRU__20110805__ +typedef void* device_handle; +typedef void* image_handle; + +//static const long BrightnessDefault = 5000; +//static const long ContrastDefault = 5000; +//static const long SaturationDefault = 5000; +//static const long HueDefault = 5000; +//static const long SharpnessDefault = 4; + +#define MIN_BRIGHTNESS 0 +#define MAX_BRIGHTNESS 10000 + +#define MIN_CONTRAST 0 +#define MAX_CONTRAST 10000 + +#define MIN_SATURATION 0 +#define MAX_SATURATION 10000 + +#define MIN_HUE 0 +#define MAX_HUE 10000 + +#define MIN_SHARPNESS 0 +#define MAX_SHARPNESS 7 + + +typedef enum { //@enum Decoder control types + BRIGHTNESS = 0, //@emem control for brightness + CONTRAST = 1, //@emem control for contrast + SATURATION = 2, //@emem control for saturation + HUE = 3, //@emem control for hue + SHARPNESS = 4 //@emem control for sharpness +}COLORCONTROL; +//Ƶʽ +//typedef enum +//{ +// VideoStandard_None = 0x00000000, +// VideoStandard_NTSC_M = 0x00000001, +// VideoStandard_NTSC_M_J = 0x00000002, +// VideoStandard_NTSC_433 = 0x00000004, +// VideoStandard_PAL_B = 0x00000010, +// VideoStandard_PAL_D = 0x00000020, +// VideoStandard_PAL_H = 0x00000080, +// VideoStandard_PAL_I = 0x00000100, +// VideoStandard_PAL_M = 0x00000200, +// VideoStandard_PAL_N = 0x00000400, +// VideoStandard_PAL_60 = 0x00000800, +// VideoStandard_SECAM_B = 0x00001000, +// VideoStandard_SECAM_D = 0x00002000, +// VideoStandard_SECAM_G = 0x00004000, +// VideoStandard_SECAM_H = 0x00008000, +// VideoStandard_SECAM_K = 0x00010000, +// VideoStandard_SECAM_K1 = 0x00020000, +// VideoStandard_SECAM_L = 0x00040000, +// VideoStandard_SECAM_L1 = 0x00080000, +//} VideoStandard; +//ERROR MEAASGE +enum RETERRNO +{ + RET_NOERROR = 0, /* no error */ + RET_EXCEPTION, /* sdk exception error */ + RET_ERR_INIT, /* do not initialize or initialize failed */ + RET_INVALID_DEV, /* do not find valid media device */ + RET_INVALID_CHANNEL, /* invalid channel */ + RET_BAD_POINTER, /* invalid or Null pointer param */ + RET_NO_MATCH, /* do not match the compatiple object */ + RET_DX_FAILED, /* fail from direct show */ + RET_INVALID_HANDLE, /* find null handle */ + RET_INVALID_PARAM, /* invalid function param */ + RET_GDI_ERROR, /* GDI error */ + RET_IO_ERROR, /* common io read or write error */ + RET_FAILED, /* common error */ + RET_VIDFMT_ERROR, /* Video format selected do not support */ +}; +// ״̬ +enum {state_stopped, state_paused, state_running}; + +// ȥģʽ +enum {di_none, di_weave, di_blend, di_bob}; + +// ģʽ +enum {dn_none, dn_b}; + +// Ƶɫռ +enum {cs_rgb24, cs_rgb32, cs_yuy2}; + +// 豸ҳ +enum {attr_video, attr_audio, attr_encode}; + +// 豸Ϣ +#define MAX_DEVICE_NAME 128 +typedef struct _device_tag +{ + unsigned idx; // öٹе + TCHAR deviceName[MAX_DEVICE_NAME]; // +} DEVICE_TAG, *PDEVICE_TAG; + +// ¼֪ͨ +EXTERN_C const IID IID_ISaveNotify; +/* +// {BAE74021-AFEC-4336-8497-658ED4432F65} +DEFINE_GUID(IID_ISaveNotify, + 0xbae74021, 0xafec, 0x4336, 0x84, 0x97, 0x65, 0x8e, 0xd4, 0x43, 0x2f, 0x65); + // */ +class ISaveNotify : public IUnknown// ¼¼֪ͨ +{ +public: + virtual HRESULT foo() = 0; +}; + +// ispӿ +//EXTERN_C const IID IID_IispTask; +/* +/// {BC7DE54C-F483-4768-9CBA-3228D81600CD} +DEFINE_GUID(IID_IispTask, + 0xbc7de54c, 0xf483, 0x4768, 0x9c, 0xba, 0x32, 0x28, 0xd8, 0x16, 0x0, 0xcd); + // */ + +//class IispTask : public IUnknown // Ƶӿ +//{ +//public: +// virtual HRESULT QueryAccept(/*AM_MEDIA_TYPE**/void* mt) = 0; + +// virtual HRESULT BeginIsp() = 0; +// virtual HRESULT IspTask(/*IMediaSample**/void* pMS) = 0; +// virtual HRESULT EndIsp() = 0; +//}; +EXTERN_C const IID IID_IispTask; +class IispTask : public IUnknown +{ +public: + virtual /* [local][id] */ HRESULT STDMETHODCALLTYPE QueryAccept( + void *mt) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE BeginIsp( void) = 0; + + virtual /* [local][id] */ HRESULT STDMETHODCALLTYPE IspTask( + void *pMS) = 0; + + virtual /* [id] */ HRESULT STDMETHODCALLTYPE EndIsp( void) = 0; + +}; + + + +#endif // __LIBDXCAP_DATASTRU__20110805__ \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/amd64/libusb0.sys b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/amd64/libusb0.sys new file mode 100644 index 0000000..b1cf993 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/amd64/libusb0.sys differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/ia64/libusb0.sys b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/ia64/libusb0.sys new file mode 100644 index 0000000..88559bd Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/ia64/libusb0.sys differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/libusb-win32-bin-README.txt b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/libusb-win32-bin-README.txt new file mode 100644 index 0000000..71f3b9d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/libusb-win32-bin-README.txt @@ -0,0 +1,27 @@ +libusb-win32-bin v1.2.4.6 (05/12/2011) - [Package Information] + +ALL ARCHITECTURES: + x86\libusb0_x86.dll: x86 32-bit library. Must be renamed to libusb0.dll + On 64 bit, Installs to Windows\syswow64\libusb0.dll. + On 32 bit, Installs to Windows\system32\libusb0.dll. + + x86\inf-wizard.exe: inf-wizard application with embedded libusb-win32 + v1.2.4.6 binaries. + +X86 ONLY ARCHITECTURES: + x86\libusb0.sys: x86 32-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + +AMD64-INTEL64 ONLY ARCHITECTURES: + amd64\libusb0.sys: x64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + amd64\libusb0.dll: x64 64-bit library. + Installs to Windows\system32\libusb0.dll + +IA64 ONLY ARCHITECTURES: + ia64\libusb0.sys: IA64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + ia64\libusb0.dll: IA64 64-bit library. + Installs to Windows\system32\libusb0.dll diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/x86/libusb0.sys b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/x86/libusb0.sys new file mode 100644 index 0000000..3d453ad Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/bin/x86/libusb0.sys differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/lusb0_usb.h b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/lusb0_usb.h new file mode 100644 index 0000000..e9875bb --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/lusb0_usb.h @@ -0,0 +1,416 @@ +#ifndef __USB_H__ +#define __USB_H__ + +#include +#include + +/* + * 'interface' is defined somewhere in the Windows header files. This macro + * is deleted here to avoid conflicts and compile errors. + */ + +#ifdef interface +#undef interface +#endif + +/* + * PATH_MAX from limits.h can't be used on Windows if the dll and + * import libraries are build/used by different compilers + */ + +#define LIBUSB_PATH_MAX 512 + + +/* + * USB spec information + * + * This is all stuff grabbed from various USB specs and is pretty much + * not subject to change + */ + +/* + * Device and/or Interface Class codes + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* + * Descriptor types + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* + * Descriptor sizes per descriptor type + */ +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define USB_DT_HUB_NONVAR_SIZE 7 + + +/* ensure byte-packed structures */ +#include + + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header +{ + unsigned char bLength; + unsigned char bDescriptorType; +}; + +/* String descriptor */ +struct usb_string_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wData[1]; +}; + +/* HID descriptor */ +struct usb_hid_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdHID; + unsigned char bCountryCode; + unsigned char bNumDescriptors; +}; + +/* Endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; + unsigned char bRefresh; + unsigned char bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +/* Interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; + + struct usb_endpoint_descriptor *endpoint; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ + +struct usb_interface +{ + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* Configuration descriptor information.. */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; + + struct usb_interface *interface; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +/* Device descriptor */ +struct usb_device_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct usb_ctrl_setup +{ + unsigned char bRequestType; + unsigned char bRequest; + unsigned short wValue; + unsigned short wIndex; + unsigned short wLength; +}; + +/* + * Standard requests + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +/* 0x02 is reserved */ +#define USB_REQ_SET_FEATURE 0x03 +/* 0x04 is reserved */ +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Various libusb API related stuff + */ + +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* + * This is supposed to look weird. This file is generated from autoconf + * and I didn't want to make this too complicated. + */ +#define USB_LE16_TO_CPU(x) + +/* Data types */ +/* struct usb_device; */ +/* struct usb_bus; */ + +struct usb_device +{ + struct usb_device *next, *prev; + + char filename[LIBUSB_PATH_MAX]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; /* Darwin support */ + + unsigned char devnum; + + unsigned char num_children; + struct usb_device **children; +}; + +struct usb_bus +{ + struct usb_bus *next, *prev; + + char dirname[LIBUSB_PATH_MAX]; + + struct usb_device *devices; + unsigned long location; + + struct usb_device *root_dev; +}; + +/* Version information, Windows specific */ +struct usb_version +{ + struct + { + int major; + int minor; + int micro; + int nano; + } dll; + struct + { + int major; + int minor; + int micro; + int nano; + } driver; +}; + + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +#ifndef __USB_C__ +#define usb_busses usb_get_busses() +#endif + + + +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + + /* Function prototypes */ + + /* usb.c */ + usb_dev_handle *usb_open(struct usb_device *dev); + int usb_close(usb_dev_handle *dev); + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ + int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size); + int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout); + int usb_set_configuration(usb_dev_handle *dev, int configuration); + int usb_claim_interface(usb_dev_handle *dev, int interface); + int usb_release_interface(usb_dev_handle *dev, int interface); + int usb_set_altinterface(usb_dev_handle *dev, int alternate); + int usb_resetep(usb_dev_handle *dev, unsigned int ep); + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); + int usb_reset(usb_dev_handle *dev); + + char *usb_strerror(void); + + void usb_init(void); + void usb_set_debug(int level); + int usb_find_busses(void); + int usb_find_devices(void); + struct usb_device *usb_device(usb_dev_handle *dev); + struct usb_bus *usb_get_busses(void); + + + /* Windows specific functions */ + +#define LIBUSB_HAS_INSTALL_SERVICE_NP 1 + int usb_install_service_np(void); + void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 + int usb_uninstall_service_np(void); + void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_DRIVER_NP 1 + int usb_install_driver_np(const char *inf_file); + void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 + int usb_touch_inf_file_np(const char *inf_file); + void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 + int usb_install_needs_restart_np(void); + +#define LIBUSB_HAS_INSTALL_NP 1 + int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line, int starg_arg); + int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); + #define usb_install_np usb_install_npA + void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + const struct usb_version *usb_get_version(void); + + int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize); + int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + + int usb_submit_async(void *context, char *bytes, int size); + int usb_reap_async(void *context, int timeout); + int usb_reap_async_nocancel(void *context, int timeout); + int usb_cancel_async(void *context); + int usb_free_async(void **context); + + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_H__ */ + diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/usb.h b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/usb.h new file mode 100644 index 0000000..f28ef81 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/include/usb.h @@ -0,0 +1,415 @@ +#ifndef __USB_H__ +#define __USB_H__ + +#include +#include + +/* + * 'interface' is defined somewhere in the Windows header files. This macro + * is deleted here to avoid conflicts and compile errors. + */ + +#ifdef interface +#undef interface +#endif + +/* + * PATH_MAX from limits.h can't be used on Windows if the dll and + * import libraries are build/used by different compilers + */ + +#define LIBUSB_PATH_MAX 512 + + +/* + * USB spec information + * + * This is all stuff grabbed from various USB specs and is pretty much + * not subject to change + */ + +/* + * Device and/or Interface Class codes + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* + * Descriptor types + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* + * Descriptor sizes per descriptor type + */ +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define USB_DT_HUB_NONVAR_SIZE 7 + + +/* ensure byte-packed structures */ +#include + + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header +{ + unsigned char bLength; + unsigned char bDescriptorType; +}; + +/* String descriptor */ +struct usb_string_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wData[1]; +}; + +/* HID descriptor */ +struct usb_hid_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdHID; + unsigned char bCountryCode; + unsigned char bNumDescriptors; +}; + +/* Endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; + unsigned char bRefresh; + unsigned char bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +/* Interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; + + struct usb_endpoint_descriptor *endpoint; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ + +struct usb_interface +{ + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* Configuration descriptor information.. */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; + + struct usb_interface *interface; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +/* Device descriptor */ +struct usb_device_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct usb_ctrl_setup +{ + unsigned char bRequestType; + unsigned char bRequest; + unsigned short wValue; + unsigned short wIndex; + unsigned short wLength; +}; + +/* + * Standard requests + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +/* 0x02 is reserved */ +#define USB_REQ_SET_FEATURE 0x03 +/* 0x04 is reserved */ +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Various libusb API related stuff + */ + +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* + * This is supposed to look weird. This file is generated from autoconf + * and I didn't want to make this too complicated. + */ +#define USB_LE16_TO_CPU(x) + +/* Data types */ +/* struct usb_device; */ +/* struct usb_bus; */ + +struct usb_device +{ + struct usb_device *next, *prev; + + char filename[LIBUSB_PATH_MAX]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; /* Darwin support */ + + unsigned char devnum; + + unsigned char num_children; + struct usb_device **children; +}; + +struct usb_bus +{ + struct usb_bus *next, *prev; + + char dirname[LIBUSB_PATH_MAX]; + + struct usb_device *devices; + unsigned long location; + + struct usb_device *root_dev; +}; + +/* Version information, Windows specific */ +struct usb_version +{ + struct + { + int major; + int minor; + int micro; + int nano; + } dll; + struct + { + int major; + int minor; + int micro; + int nano; + } driver; +}; + + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +#ifndef __USB_C__ +#define usb_busses usb_get_busses() +#endif + + + +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + + /* Function prototypes */ + + /* usb.c */ + usb_dev_handle *usb_open(struct usb_device *dev); + int usb_close(usb_dev_handle *dev); + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ + int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size); + int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout); + int usb_set_configuration(usb_dev_handle *dev, int configuration); + int usb_claim_interface(usb_dev_handle *dev, int interface); + int usb_release_interface(usb_dev_handle *dev, int interface); + int usb_set_altinterface(usb_dev_handle *dev, int alternate); + int usb_resetep(usb_dev_handle *dev, unsigned int ep); + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); + int usb_reset(usb_dev_handle *dev); + + char *usb_strerror(void); + + void usb_init(void); + void usb_set_debug(int level); + int usb_find_busses(void); + int usb_find_devices(void); + struct usb_device *usb_device(usb_dev_handle *dev); + struct usb_bus *usb_get_busses(void); + + + /* Windows specific functions */ + +#define LIBUSB_HAS_INSTALL_SERVICE_NP 1 + int usb_install_service_np(void); + void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 + int usb_uninstall_service_np(void); + void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_DRIVER_NP 1 + int usb_install_driver_np(const char *inf_file); + void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 + int usb_touch_inf_file_np(const char *inf_file); + void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 + int usb_install_needs_restart_np(void); + +#define LIBUSB_HAS_INSTALL_NP 1 + int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line, int starg_arg); + int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); + #define usb_install_np usb_install_npA + void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + const struct usb_version *usb_get_version(void); + + int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize); + int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_submit_async(void *context, char *bytes, int size); + int usb_reap_async(void *context, int timeout); + int usb_reap_async_nocancel(void *context, int timeout); + int usb_cancel_async(void *context); + int usb_free_async(void **context); + + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_H__ */ + diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog new file mode 100644 index 0000000..ceb2cdc Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog new file mode 100644 index 0000000..5b5bddf Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog new file mode 100644 index 0000000..9c230c3 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.log b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.log new file mode 100644 index 0000000..777bd40 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.log @@ -0,0 +1,27 @@ +Build started 4/21/2012 6:31:52 AM. + 1>Project "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lastbuildstate". + InitializeBuildStatus: + Creating "E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I..\src /I..\src\driver /ZI /nologo /W3 /WX- /Od /Oy- /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"libusb0\"" /D TARGETTYPE=DYNLINK /D _WINDLL /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\\" /Fd"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.pdb" /Gd /TC /wd4996 /analyze- /errorReport:prompt ..\src\descriptors.c ..\src\error.c ..\src\install.c ..\src\registry.c ..\src\usb.c ..\src\windows.c + windows.c + usb.c + registry.c + install.c + error.c + descriptors.c + Generating Code... + ResourceCompile: + C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"libusb0\"" /D "MANIFEST_FILE=\"..\\manifest_x86.xml\"" /l"0x0409" /I..\src /nologo /fo"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\resource.res" ..\src\resource.rc + Link: + d:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.dll" /NOLOGO setupapi.lib kernel32.lib advapi32.lib user32.lib shell32.lib gdi32.lib /DEF:"..\libusb0.def" /MANIFEST:NO /DEBUG /PDB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib" /MACHINE:X86 /DLL E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\resource.res + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\descriptors.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\error.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\install.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\registry.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\usb.obj + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\windows.obj + Creating library E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib and object E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp + libusb-dll.vcxproj -> E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.dll diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb.lib b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb.lib new file mode 100644 index 0000000..0e04f98 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb.lib differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.Build.CppClean.log b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.Build.CppClean.log new file mode 100644 index 0000000..c2cf565 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.Build.CppClean.log @@ -0,0 +1,26 @@ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\cl.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\CL.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\DESCRIPTORS.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\ERROR.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\INSTALL.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.DLL +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.ILK +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\LIBUSB0.PDB +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\link-cvtres.write.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.command.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.read.1.tlog +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\rc.write.1.tlog +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\REGISTRY.OBJ +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\RESOURCE.RES +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\USB.OBJ +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\vc100.idb +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\VC100.PDB +E:\PCDMIS\2012_MR1_QA\PCDLRN\INTERFAC\MSI\HSI\MICROVU\MV_UTIL\WIN32\DEBUG\LIBUSB0\WINDOWS.OBJ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.dll.back b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.dll.back new file mode 100644 index 0000000..98f4250 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.dll.back differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp new file mode 100644 index 0000000..f8a951b Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lastbuildstate b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lastbuildstate new file mode 100644 index 0000000..5213ef2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|Win32|E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\| diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib new file mode 100644 index 0000000..c3b08f4 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib.back b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib.back new file mode 100644 index 0000000..f244c2d Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.lib.back differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.unsuccessfulbuild b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog new file mode 100644 index 0000000..590bb82 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.lib +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp +E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Win32\Debug\libusb0\libusb0.exp diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog new file mode 100644 index 0000000..b191aef Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog new file mode 100644 index 0000000..0c66717 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog new file mode 100644 index 0000000..07e8990 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog new file mode 100644 index 0000000..859bb35 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog new file mode 100644 index 0000000..b92ea77 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog new file mode 100644 index 0000000..5c08e30 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/resource.res b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/resource.res differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb new file mode 100644 index 0000000..67cfd25 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_i64/libusb.lib b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_i64/libusb.lib new file mode 100644 index 0000000..547e908 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_i64/libusb.lib differ diff --git a/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_x64/libusb.lib b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_x64/libusb.lib new file mode 100644 index 0000000..06eefdc Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/LibUsb_Win/lib/msvc_x64/libusb.lib differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/AUTHORS.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/AUTHORS.txt new file mode 100644 index 0000000..6edc318 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/AUTHORS.txt @@ -0,0 +1,16 @@ + +Library, Test Programs: + +Stephan Meyer, +Johannes Erdfelt, +Thomas Sailer, + +Drivers, Installer: + +Stephan Meyer, +Travis Robinson, + +Testing, Technical support: + +Xiaofan Chen, + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_GPL.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_GPL.txt new file mode 100644 index 0000000..818433e --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_GPL.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_LGPL.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_LGPL.txt new file mode 100644 index 0000000..b14ca0a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/COPYING_LGPL.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/Makefile b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/Makefile new file mode 100644 index 0000000..6521cfa --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/Makefile @@ -0,0 +1,261 @@ +# LIBUSB-WIN32, Generic Windows USB Library +# Copyright (c) 2002-2005 Stephan Meyer +# Copyright (c) 2010 Travis Robinson +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +# Supported arugments: all, dll, filter, infwizard, test, testwin, driver +# +# + +# If you're cross-compiling and your mingw32 tools are called +# i586-mingw32msvc-gcc and so on, then you can compile libusb-win32 +# by running +# make host_prefix=i586-mingw32msvc all + +ifdef host_prefix + override host_prefix := $(host_prefix)- +endif +ifdef host_prefix_x86 + override host_prefix_x86 := $(host_prefix_x86)- +endif +ifdef cflags + DBG_DEFINE = $(cflags) +endif + +CC = $(host_prefix)gcc +LD = $(host_prefix)ld +WINDRES = $(host_prefix)windres +DLLTOOL = $(host_prefix)dlltool + +CC86 = $(host_prefix_x86)gcc +LD86 = $(host_prefix_x86)ld +WINDRES86 = windres +DLLTOOL86 = dlltool + +MAKE = make +CP = cp +CD = cd +MV = mv +RM = -rm -fr +TAR = tar +ISCC = iscc +INSTALL = install +LIB = lib +IMPLIB = implib +UNIX2DOS = unix2dos + +TARGET = libusb +DLL_TARGET = $(TARGET)0 +LIB_TARGET = $(TARGET) +DRIVER_TARGET = $(TARGET)0.sys +INSTALL_DIR = /usr +VPATH = .:./src:./src/driver:./tests + +LIBWDI_DIR = ./projects/additional/libwdi/libwdi +SRC_DIR = ./src +DRIVER_SRC_DIR = $(SRC_DIR)/driver + +LIBWDI_CONFIG_H = -DWDF_VER=\"01009\" -DUSER_DIR=\"\" -DOPT_M32 -DWINVER=0x500 + +DRIVER_OBJECTS = abort_endpoint.o claim_interface.o clear_feature.o \ + dispatch.o get_configuration.o \ + get_descriptor.o get_interface.o get_status.o \ + ioctl.o libusb_driver.o pnp.o release_interface.o reset_device.o \ + reset_endpoint.o set_configuration.o set_descriptor.o \ + set_feature.o set_interface.o transfer.o vendor_request.o \ + power.o driver_registry.o error.o libusb_driver_rc.o + +LIBWDI_OBJECTS = $(LIBWDI_DIR)/logging.5.o \ + $(LIBWDI_DIR)/tokenizer.5.o \ + $(LIBWDI_DIR)/vid_data.5.o \ + $(LIBWDI_DIR)/libwdi_dlg.5.o \ + $(LIBWDI_DIR)/libwdi.5.o + + +INCLUDES = -I./src -I./src/driver -I. + +CFLAGS = -O2 -Wall -DWINVER=0x500 $(DBG_DEFINE) +WIN_CFLAGS = $(CFLAGS) -mwindows + +WINDRES_FLAGS = -I$(SRC_DIR) + +STDC_LD_LIBS=-lkernel32 \ + -luser32 \ + -lgdi32 \ + -lwinspool \ + -lcomdlg32 \ + -ladvapi32 \ + -lshell32 \ + -lole32 \ + -loleaut32 \ + -luuid \ + -lodbc32 \ + -lodbccp32 + +LDFLAGS = -s -L. -lusb -lgdi32 -luser32 -lcfgmgr32 -lsetupapi -lcomctl32 +TEST_WIN_LDFLAGS = -s -L. -lusb -lkernel32 -lgdi32 -luser32 -lnewdev -lsetupapi -lcomctl32 -lole32 -mwindows +WIN_LDFLAGS = -s -L. -lkernel32 -lgdi32 -luser32 -lnewdev -lsetupapi -lcomctl32 -lole32 -mwindows +DLL_LDFLAGS = -s -mdll \ + -Wl,--kill-at \ + -Wl,--out-implib,$(LIB_TARGET).a \ + -Wl,--enable-stdcall-fixup \ + -L. -lcfgmgr32 -lsetupapi -lgdi32 + +LIBWDI_DLL_LDFLAGS = -s -shared \ + -Wl,--kill-at \ + -Wl,--out-implib,libwdi.a \ + -Wl,--enable-stdcall-fixup \ + -L. -lnewdev -lsetupapi -lole32 + +DRIVER_LDFLAGS = -s -shared -Wl,--entry,_DriverEntry@8 \ + -nostartfiles -nostdlib -L. -lusbd -lntoskrnl -lhal + + +.PHONY: all +all: dll filter infwizard test testwin driver + +.PHONY: dll +dll: DLL_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"$(DLL_TARGET)-dll\" -DTARGETTYPE=DYNLINK +dll: $(DLL_TARGET).dll + +$(DLL_TARGET).dll: usb.2.o error.2.o descriptors.2.o windows.2.o install.2.o registry.2.o resource.2.o + $(CC) $(DLL_CFLAGS) -o $@ -I./src $^ $(DLL_TARGET).def $(DLL_LDFLAGS) + +%.2.o: %.c libusb_driver.h driver_api.h error.h + $(CC) $(DLL_CFLAGS) -c $< -o $@ $(CPPFLAGS) $(INCLUDES) + +%.2.o: %.rc + $(WINDRES) $(CPPFLAGS) $(WINDRES_FLAGS) $< -o $@ + +.PHONY: filter +filter: FILTER_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"install-filter\" -DTARGETTYPE=PROGRAMconsole -DLOG_STYLE_SHORT +filter: FILTER_LDFLAGS = -s -L. -lgdi32 -luser32 -lcfgmgr32 -lsetupapi +filter: install-filter.exe + + +install-filter.exe: install_filter.1.o error.1.o install.1.o registry.1.o install_filter_rc.1.o + $(CC) $(FILTER_CFLAGS) -o $@ -I./src $^ $(FILTER_LDFLAGS) + +%.1.o: %.c libusb_driver.h driver_api.h error.h + $(CC) $(FILTER_CFLAGS) -c $< -o $@ $(CPPFLAGS) $(INCLUDES) + +%.1.o: %.rc + $(WINDRES) $(CPPFLAGS) $(WINDRES_FLAGS) $< -o $@ + +.PHONY: test +test: dll +test: TEST_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"testlibusb\" -DTARGETTYPE=PROGRAMconsole +test: testlibusb.exe + +testlibusb.exe: testlibusb.3.o + $(CC) $(TEST_CFLAGS) -o $@ -I./src $^ $(LDFLAGS) + +%.3.o: %.c libusb_driver.h driver_api.h error.h + $(CC) -c $< -o $@ $(TEST_CFLAGS) $(CPPFLAGS) $(INCLUDES) + +.PHONY: testwin +testwin: dll +testwin: TESTWIN_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"testlibusb-win\" -DTARGETTYPE=PROGRAMwindows +testwin: testlibusb-win.exe + +testlibusb-win.exe: testlibusb_win.4.o testlibusb_win_rc.4.o + $(CC) $(TESTWIN_CFLAGS) -o $@ -I./src $^ $(TEST_WIN_LDFLAGS) + +%.4.o: %.c libusb_driver.h driver_api.h error.h + $(CC) -c $< -o $@ $(TESTWIN_CFLAGS) $(CPPFLAGS) $(INCLUDES) + +%.4.o: %.rc + $(WINDRES) $(CPPFLAGS) $(WINDRES_FLAGS) $< -o $@ + +# +# LIBWDI installer_x86 +# +.PHONY: installer_x86 +installer_x86: INSTALLER_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"installer_x86\" -DTARGETTYPE=PROGRAMconsole $(LIBWDI_CONFIG_H) +installer_x86: INSTALLER_LDFLAGS = -s -L. -ladvapi32 -lnewdev -lsetupapi +installer_x86: installer_x86.exe + +installer_x86.exe: $(LIBWDI_DIR)/installer.6.o + $(CC86) $(INSTALLER_CFLAGS) -o $@ -I$(LIBWDI_DIR) $^ $(INSTALLER_LDFLAGS) + $(CP) $(LIBWDI_DIR)/../msvc/config.h $(LIBWDI_DIR) + +%.6.o: %.c $(LIBWDI_DIR)/installer.h + $(CC86) -c $< -o $@ $(INSTALLER_CFLAGS) $(CPPFLAGS) -DWINVER=0x500 -I$(LIBWDI_DIR) + +# +# LIBWDI embedder +# +.PHONY: embedder +embedder: installer_x86 +embedder: EMBEDDER_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"embedder\" -DTARGETTYPE=PROGRAMconsole $(LIBWDI_CONFIG_H) +embedder: EMBEDDER_LDFLAGS = -s -L. -luser32 -lversion +embedder: embedder.exe + +embedder.exe: $(LIBWDI_DIR)/embedder.7.o + $(CC86) $(EMBEDDER_CFLAGS) -o $@ -I$(LIBWDI_DIR) $^ $(EMBEDDER_LDFLAGS) + $(CP) -u $(LIBWDI_DIR)/winusb.inf.in ./ + $(CP) -u $(LIBWDI_DIR)/libusb-win32.inf.in ./ + ./embedder.exe embedded.h + +%.7.o: %.c $(LIBWDI_DIR)/embedder.h + $(CC86) -c $< -o $@ $(EMBEDDER_CFLAGS) $(CPPFLAGS) -DWINVER=0x500 -I$(LIBWDI_DIR) + +.PHONY: infwizard +infwizard: embedder +infwizard: INFWIZARD_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"infwizard\" -DTARGETTYPE=PROGRAMwindows +infwizard: inf-wizard.exe + +inf-wizard.exe: inf_wizard.5.o inf_wizard_rc.5.o $(LIBWDI_OBJECTS) + $(CC86) $(WIN_CFLAGS) -o $@ -I./src -I$(LIBWDI_DIR) $^ $(WIN_LDFLAGS) + +%.5.o: %.c libusb-win32_version.h $(LIBWDI_DIR)/libwdi.h + $(CC86) -c $< -o $@ -I$(LIBWDI_DIR) $(INFWIZARD_CFLAGS) $(CPPFLAGS) $(INCLUDES) + +%.5.o: %.rc + $(WINDRES86) $(CPPFLAGS) $(WINDRES_FLAGS) $< -o $@ + +.PHONY: driver +driver: DRIVER_CFLAGS = $(CFLAGS) -DLOG_APPNAME=\"$(DLL_TARGET)-sys\" -DTARGETTYPE=DRIVER +driver: $(DRIVER_TARGET) + +$(DRIVER_TARGET): libusbd.a $(DRIVER_OBJECTS) + $(CC) -o $@ $(DRIVER_OBJECTS) $(DLL_TARGET)_drv.def $(DRIVER_LDFLAGS) + +libusbd.a: + $(DLLTOOL) --dllname usbd.sys --add-underscore --def ./src/driver/usbd.def --output-lib libusbd.a + +%.o: %.c libusb_driver.h driver_api.h error.h + $(CC) -c $< -o $@ $(DRIVER_CFLAGS) $(CPPFLAGS) $(INCLUDES) + +%.o: %.rc + $(WINDRES) $(CPPFLAGS) $(WINDRES_FLAGS) $< -o $@ + +.PHONY: cleantemp +cleantemp: + $(RM) *.o *.a *.exp *.tar.gz *~ *.iss *.rc *.h + $(RM) $(LIBWDI_DIR)/*.o + $(RM) $(LIBWDI_DIR)/config.h + $(RM) ./src/*~ *.log + $(RM) $(DRIVER_SRC_DIR)/*~ + $(RM) README.txt + $(RM) winusb.inf.in + $(RM) libusb-win32.inf.in + $(RM) inf_wizard.ico + +.PHONY: clean +clean: cleantemp + $(RM) *.dll *.lib *.exe *.sys diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.in new file mode 100644 index 0000000..76e2b49 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.in @@ -0,0 +1,12 @@ + +This is libusb-win32 (http://libusb-win32.sourceforge.net) version @VERSION@. +Libusb-win32 is a library that allows userspace application to access USB +devices on Windows operation systems (Win2k, WinXP, Vista, Win7). +It is derived from and fully API compatible to libusb available at +http://libusb.sourceforge.net. + +For more information visit the project's web site at: + +http://libusb-win32.sourceforge.net +http://sourceforge.net/projects/libusb-win32 + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.txt new file mode 100644 index 0000000..00c5edc --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/README.txt @@ -0,0 +1,12 @@ + +This is libusb-win32 (http://libusb-win32.sourceforge.net) version 1.2.4.0. +Libusb-win32 is a library that allows userspace application to access USB +devices on Windows operation systems (Win2k, WinXP, Vista, Win7). +It is derived from and fully API compatible to libusb available at +http://libusb.sourceforge.net. + +For more information visit the project's web site at: + +http://libusb-win32.sourceforge.net +http://sourceforge.net/projects/libusb-win32 + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/build_ddk.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/build_ddk.bat new file mode 100644 index 0000000..85b08c0 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/build_ddk.bat @@ -0,0 +1,27 @@ +@ECHO OFF +:: Use this batch file instead of the winddk "build" command. +:: +:: - Calls the winddk build command. Sets BUILD_ERRORLEVEL=1 if +:: a build error is detected. +:: - Sets LOG_APPNAME define (unless already set) +:: - Sets libusb-win32 version defines (unless already set) +:: + +IF "%LOG_APPNAME%"=="" SET LOG_APPNAME=$(TARGETNAME) +SET COMMON_C_DEFINES= +SET COMMON_C_DEFINES=%COMMON_C_DEFINES% /DLOG_APPNAME="\"$(LOG_APPNAME)\"" +IF DEFINED CMDVAR_LOG_DIRECTORY SET COMMON_C_DEFINES=%COMMON_C_DEFINES% /DLOG_DIRECTORY="\"$(CMDVAR_LOG_DIRECTORY)\"" +SET COMMON_C_DEFINES=%COMMON_C_DEFINES% %* + +IF EXIST "build%BUILD_ALT_DIR%.err" DEL /Q "build%BUILD_ALT_DIR%.err" >NUL +IF EXIST "build%BUILD_ALT_DIR%.wrn" DEL /Q "build%BUILD_ALT_DIR%.wrn" >NUL +SET BUILD_ERRORLEVEL=0 + +if exist libusb0.lib move /Y libusb0.lib libusb.lib >NUL + +build -cwgZ 2>NUL>NUL +IF EXIST "build%BUILD_ALT_DIR%.err" TYPE "build%BUILD_ALT_DIR%.err" +IF EXIST "build%BUILD_ALT_DIR%.wrn" TYPE "build%BUILD_ALT_DIR%.wrn" +IF EXIST "build%BUILD_ALT_DIR%.err" SET BUILD_ERRORLEVEL=1 +IF EXIST "build%BUILD_ALT_DIR%.err" SET ERRORLEVEL=1 + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/filter-bin-setup.iss.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/filter-bin-setup.iss.in new file mode 100644 index 0000000..44224bc --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/filter-bin-setup.iss.in @@ -0,0 +1,142 @@ +; LIBUSB-WIN32, Generic Windows USB Library +; Copyright (c) 2002-2010 Stephan Meyer +; Copyright (c) 2010 Travis Robinson +; +; This program is free software; you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 2 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program; if not, write to the Free Software +; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +[Setup] +AppName = LibUSB-Win32 +AppVerName = LibUSB-Win32-@VERSION@ +AppId = LibUSB-Win32 +AppPublisher = LibUSB-Win32 +AppPublisherURL = http://libusb-win32.sourceforge.net +AppVersion = @VERSION@ +VersionInfoVersion = @VERSION@ +DefaultDirName = {pf}\LibUSB-Win32 +DefaultGroupName = LibUSB-Win32 +LicenseFile = installer_license.txt +InfoBeforeFile = libusb-win32-changelog-@VERSION@.txt +Compression = lzma +SolidCompression = yes +OutputDir = . +OutputBaseFilename = @PCKGNAME@ +; requires Win2k, or higher +MinVersion = 0, 5.0.2195 +PrivilegesRequired=admin + +; "ArchitecturesInstallIn64BitMode=x64 ia64" requests that the install +; be done in "64-bit mode" on x64 & Itanium, meaning it should use the +; native 64-bit Program Files directory and the 64-bit view of the +; registry. On all other architectures it will install in "32-bit mode". +ArchitecturesInstallIn64BitMode=x64 ia64 +AllowNoIcons=yes + +[Code] +function IsX64: Boolean; +begin + Result := Is64BitInstallMode and (ProcessorArchitecture = paX64); +end; + +function IsI64: Boolean; +begin + Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64); +end; + +function IsX86: Boolean; +begin + Result := not IsX64 and not IsI64; +end; + +function Is64: Boolean; +begin + Result := IsX64 or IsI64; +end; + +function IsNormalInstall: Boolean; +begin + Result := not IsTaskSelected('installmode_upgade'); +end; + +[Files] +; LibUsb-win32 x86 (Windows 2000/XP and greater) +Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX86; +Source: @PACKAGE_BIN_DIR@x86\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX86; +Source: @PACKAGE_BIN_DIR@x86\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86; +Source: @PACKAGE_BIN_DIR@x86\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86; +Source: @PACKAGE_BIN_DIR@x86\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86; +Source: @PACKAGE_BIN_DIR@x86\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86; + +; LibUsb-win32 AMD 64bit +Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {syswow64}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64; +Source: @PACKAGE_BIN_DIR@amd64\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64; + +; LibUsb-win32 Itanium 64bit +Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {syswow64}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64; +Source: @PACKAGE_BIN_DIR@ia64\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64; + +;inf-wizard (x86 only) +Source: @PACKAGE_BIN_DIR@inf-wizard.exe; DestDir: {app}\bin; Flags: ignoreversion; + +Source: @LIBUSB_DIR@src\install-filter-help.txt; DestDir: {app}; Flags: ignoreversion; + +; test applications(x86 runtimes for 64bit machines) +Source: @PACKAGE_BIN_DIR@x86\testlibusb-win.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Check: Is64; +Source: @PACKAGE_BIN_DIR@x86\testlibusb.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Check: Is64; + +; Text, Licenses +Source: *.txt; DestDir: {app}; Flags: ignoreversion; + +; Test Certificate (This is only included in debug builds) +Source: *.cer; DestDir: {app}; Flags: ignoreversion skipifsourcedoesntexist; Check: Is64; + +; DebugView (This is only included in debug builds) +Source: @PACKAGE_ROOT_DIR@additional\dbgview.*; DestDir: {app}\additional; Flags: ignoreversion skipifsourcedoesntexist; + +[Icons] +; these icons are only used in debug builds +Name: "{group}\Libusb-Win32 Test Certificate"; Filename: {app}\LibusbWin32TestCert.cer; Flags: createonlyiffileexists; +Name: "{group}\DebugView\DebugView"; Filename: {app}\additional\Dbgview.exe; Flags: createonlyiffileexists; +Name: "{group}\DebugView\DebugView Help"; Filename: {app}\additional\dbgview.chm; Flags: createonlyiffileexists; + +; libusb-win32 icons +Name: "{group}\Test (Win) Program"; Filename: {app}\bin\testlibusb-win.exe; +Name: "{group}\Inf Wizard"; Filename: {app}\bin\inf-wizard.exe; +Name: "{group}\Filter Wizard"; Filename: {app}\bin\install-filter-win.exe; +Name: "{group}\Filter Console Help"; Filename: {app}\install-filter-help.txt; +Name: "{group}\Class Filter\Install all class filters"; Filename: {app}\bin\install-filter-win.exe; Parameters:"i -ac -p -w"; Comment: "Installs all libusb-win32 class filters." +Name: "{group}\Class Filter\Remove all class filters"; Filename: {app}\bin\install-filter-win.exe; Parameters:"u -ac -w"; Comment: "Removes all libusb-win32 class filters." +Name: "{group}\License\GPL License"; Filename: {app}\COPYING_GPL.txt; +Name: "{group}\License\LGPL License"; Filename: {app}\COPYING_LGPL.txt; +Name: "{group}\Uninstall LibUsb-Win32"; Filename: {uninstallexe}; + +[Run] +Filename: "{app}\bin\install-filter-win.exe"; Description: "Launch filter installer wizard"; Flags: postinstall nowait runascurrentuser; Check: not WizardNoIcons; + +[UninstallRun] +Filename: "rundll32.exe"; RunOnceID:"FilterAllDeviceClasses"; Parameters: "libusb0,usb_install_np_rundll u -ac"; + +[Messages] +StatusUninstalling=Uninstalling %1 and removing all class filters.. diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cfg b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cfg new file mode 100644 index 0000000..b2e18be --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cfg @@ -0,0 +1,110 @@ +; oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +; LIBUSB-WIN32 WINDDK MAKE CONFIGURATION FILE +; Travis Robinson (libusbdotnet@gmail.com) +; +; NOTE: param/values passed into make.cmd will override these values +; NOTE: destination directories are automatically created +; oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo + +; +; Sets the libusb-win32 build version +; +VERSION_MAJOR=1 +VERSION_MINOR=2 +VERSION_MICRO=4 +VERSION_NANO=0 + +; +; The libusb-win32 version string. +; (Should not be changed) +VERSION=!VERSION_MAJOR!.!VERSION_MINOR!.!VERSION_MICRO!.!VERSION_NANO! + +; +; Default WinDDK directory(s) Adjust these values to match your environment +; (REQUIRED) +WINDDK_BASE=Z:\WinDDK +WINDDK_DIR=!WINDDK_BASE!\6001.18002\ +; +; (optional) +WINDDK_W2K_DIR=!WINDDK_BASE!\6001.18002\ + +; +LIBWDI_DIR=..\projects\additional\libwdi\ +; +; Default build app (forced to all when packaging) +; (optional) +APP=all + +; +; Whether or not to use microsofts OACR +; (http://msdn.microsoft.com/en-us/library/ff549179%28v=VS.85%29.aspx) +; +WINDDK_AUTOCODEREVIEW=true + +; ## PACKAGING ONLY +; The variables below are only used when packaging. IE: dist, snapshot +; (package directories must NOT reside in the libusb-win32 trunk) +; +; Additional libusb-win32 content is placed here +PACKAGE_ROOT_DIR=Z:\packages\libusb-win32\ + +; Binaries are placed here (exe,sys,dll) +PACKAGE_BIN_DIR=!PACKAGE_ROOT_DIR!bin\ +; +; Libraries are placed here (lib,la) +PACKAGE_LIB_DIR=!PACKAGE_ROOT_DIR!lib\ +; +; Distributables and snapshots are placed here +PACKAGE_SAVE_DIR=!PACKAGE_ROOT_DIR!package\ +; +; Temporary packaging directory (WARNING: this directory is destroyed/created.) +PACKAGE_WORKING=!PACKAGE_ROOT_DIR!_working\ +; +; +; Base bin, src, setup package name (version/snapshotid is appended) +PACKAGE_BIN_NAME=libusb-win32-bin +PACKAGE_SRC_NAME=libusb-win32-src +PACKAGE_SETUP_NAME=libusb-win32-devel-filter + +; +; Path to 7Zip (http://www.7-zip.org/) +; (optional) +ZIP=C:\Program Files\7-Zip\7z.exe + +; +; Path to Inno Setup Compiler (http://www.jrsoftware.org/isdl.php) +ISCC=C:\Program Files (x86)\Inno Setup 5\ISCC.exe + +; +; Path to borland c implib tool (http://downloads.embarcadero.com/free/c_builder) +; (optional) +IMPLIB=C:\Borland\BCC55\Bin\implib.exe + +; +; Path to gcc dlltool tool (http://www.mingw.org/) +; (optional) +DLLTOOL=C:\MinGW\bin\dlltool.exe + +; +; Filename (only) of the digital test certificate to use for signing +; when the "testsigning=on" argument is used. make.cmd looks for this +; file in the !PACKAGE_ROOT_DIR!\cert directory. If the cert file does +; not exists is is created and used for subsequent signing requests. +; (optional) +CERT_FILE=LibusbWin32TestCert.cer + +; The directory where all log files are placed. +; File logging is disabled by default (see make.cmd help for more information) +; (Consider using DebugView instead of file logging) +; http://download.sysinternals.com/Files/DebugView.zip +; (optional) +;LOG_DIRECTORY=!SystemDrive!\\\\Log\\\\ + + +; +; Month, day, year, and snapshot id variables +; (Should not be changed) +_MM_=!DATE:~4,2! +_DD_=!DATE:~7,2! +_YYYY_=!DATE:~10,4! +SNAPSHOT_ID=!_YYYY_!!_MM_!!_DD_! diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cmd b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cmd new file mode 100644 index 0000000..a671f31 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make.cmd @@ -0,0 +1,1018 @@ +@ECHO OFF +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION +:: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo +:: LIBUSB-WIN32 WINDDK MAKE UTILITY +:: Travis Robinson [libusbdotnet@gmail.com] +:: +:: NOTE: param/values passed into make.cmd will override make.cfg +:: NOTE: destination directories are automatically created +:: oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo + +CALL :ToAbsoluteDirs DIR_LIBUSB_DDK "%~0" DIR_LIBUSB_WORKING "!CD!" +IF /I "!DIR_LIBUSB_DDK!" NEQ "!DIR_LIBUSB_WORKING!" ( + PUSHD !CD! + CD /D "!DIR_LIBUSB_DDK!" +) + +IF /I "%~1" EQU "" GOTO ShowHelp +IF /I "%~1" EQU "?" GOTO ShowHelp +IF /I "%~1" EQU "/?" GOTO ShowHelp +IF /I "%~1" EQU "--help" GOTO ShowHelp +IF /I "%~1" EQU "help" GOTO ShowHelp + +:BEGIN +CALL :ClearError + +CALL :ToAbsoluteDirs CMDVAR_LIBUSB_DIR "!DIR_LIBUSB_DDK!..\" + +ECHO Libusb-Win32 directory = !CMDVAR_LIBUSB_DIR! + +SET MAKE_CFG=!DIR_LIBUSB_DDK!make.cfg +IF NOT EXIST "!MAKE_CFG!" ( + ECHO !MAKE_CFG! configuration file not found. + GOTO CMDERROR +) + +CALL :LoadConfig + +IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + +SET _PACKAGE_TYPE_=%~1 + +:: oooooooooooooooooooooooooooooooooooo +:: Package build section [if any] +:: +IF /I "!_PACKAGE_TYPE_!" EQU "clean" ( + CALL :Super_Clean %* + GOTO CMDEXIT +) +IF /I "!_PACKAGE_TYPE_!" EQU "cleanpackage" ( + CALL :Package_Clean %* + GOTO CMDEXIT +) +IF /I "!_PACKAGE_TYPE_!" EQU "all" ( + CALL :Build_Binaries %* + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) +IF /I "!_PACKAGE_TYPE_!" EQU "bin" ( + CALL :Build_Binaries %* + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "!_PACKAGE_TYPE_!" EQU "dist" ( + SET LIBUSB_DIST_BUILD=true + CALL :TokenizeLibusbVersionH %* + CALL :Package_Distributables %* + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "!_PACKAGE_TYPE_!" EQU "snapshot" ( + CALL :Package_Distributables %* + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "!_PACKAGE_TYPE_!" EQU "makever" ( + CALL :TokenizeLibusbVersionH %* + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "%~1" EQU "packagebin" ( + CALL :PrepForPackaging %* + CALL :CheckOrBuildBinaries + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Bin + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "%~1" EQU "packagesrc" ( + CALL :PrepForPackaging %* + CALL :CheckOrBuildBinaries + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Src + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "%~1" EQU "packagesetup" ( + CALL :PrepForPackaging %* + CALL :CheckOrBuildBinaries + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Setup + IF "!BUILD_ERRORLEVEL!" NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "%~1" EQU "signfile" ( + CALL :SignFile %2 + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + GOTO CMDEXIT +) + +IF /I "%~1" EQU "launchdevenv" ( + CALL :ToShortName DIR_VS_IDE_10 "%VS100COMNTOOLS%..\IDE\" + CALL :ToShortName DIR_VS_IDE_9 "%VS90COMNTOOLS%..\IDE\" + IF EXIST "!DIR_VS_IDE_10!" ( + SET DIR_VS=!DIR_VS_IDE_10! + ) ELSE IF EXIST "!DIR_VS_IDE_9!" ( + SET DIR_VS=!DIR_VS_IDE_9! + ) ELSE ( + Echo failed locating visual studio ide directory + GOTO CMDEXIT + ) + + IF EXIST "!DIR_VS!devenv.exe" ( + "!DIR_VS!devenv.exe" %2 + ) ELSE IF EXIST "!DIR_VS!VCExpress.exe" ( + "!DIR_VS!VCExpress.exe" %2 + ) ELSE ( + Echo failed locating visual studio ide + GOTO CMDEXIT + ) + + GOTO CMDEXIT +) + +:: +:: End of Package build section +:: oooooooooooooooooooooooooooooooooooo + +:: oooooooooooooooooooooooooooooooooooo +:: WinDDK build section (not a package) +:: +SET _PACKAGE_TYPE_= +CALL :LoadArguments 0 %* + +IF NOT DEFINED CMDVAR_ARCH ( + ECHO The architecture must be specified. Example: CMD /C make.cmd "arch=x86" + GOTO CMDERROR +) + +CALL :CheckWinDDK pre +IF "!BUILD_ERRORLEVEL!" NEQ "0" GOTO CMDERROR + +SET _FRE_OR_CHECK_=fre +IF /I "!CMDVAR_DEBUGMODE!" equ "true" SET _FRE_OR_CHECK_=chk + +IF /I "!CMDVAR_ARCH!" EQU "notused" ( + CALL :SetDDK "!CMDVAR_WINDDK_DIR!" normal !_FRE_OR_CHECK_! WXP + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR +) ELSE IF /I "!CMDVAR_ARCH!" EQU "x64" ( + CALL :SetDDK "!CMDVAR_WINDDK_DIR!" normal !_FRE_OR_CHECK_! x64 WNET + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR +) ELSE IF /I "!CMDVAR_ARCH!" EQU "i64" ( + CALL :SetDDK "!CMDVAR_WINDDK_DIR!" normal !_FRE_OR_CHECK_! 64 WNET + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR +) ELSE IF /I "!CMDVAR_ARCH!" EQU "x86" ( + CALL :SetDDK "!CMDVAR_WINDDK_W2K_DIR!" forceoacr !_FRE_OR_CHECK_! W2K + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR +) ELSE ( + ECHO Invalid argument. arch=!CMDVAR_ARCH! + GOTO CMDERROR +) +CALL :CheckWinDDK post +IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + +call make_clean.bat +CALL :ClearError + +SET _LIBUSB_APP=!CMDVAR_APP! +IF EXIST "build!BUILD_ALT_DIR!.err" DEL /Q "build!BUILD_ALT_DIR!.err" +CALL :Build +IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR +IF EXIST "build!BUILD_ALT_DIR!.err" ( + SET BUILD_ERRORLEVEL=1 + GOTO CMDERROR +) + +:: +:: Copy binaries to the output directory +:: +CALL :SafeCreateDir "!CMDVAR_OUTDIR!" +IF !ERRORLEVEL! NEQ 0 ( + Unable to re-create output directory !CNDVAR_OUTPUT! + GOTO CMDERROR +) + +IF EXIST *.sys MOVE /Y *.sys "!CMDVAR_OUTDIR!" >NUL +IF EXIST *.dll MOVE /Y *.dll "!CMDVAR_OUTDIR!" >NUL +IF EXIST *.exe MOVE /Y *.exe "!CMDVAR_OUTDIR!" >NUL +IF EXIST libusb.lib COPY /Y libusb.lib "!CMDVAR_OUTDIR!" >NUL + +CALL :DestroyErrorMarker + +GOTO CMDEXIT + +:: +:: End of WinDDK build section +:: oooooooooooooooooooooooooooooooooooo + +:: oooooooooooooooooooooooooooooooooooo +:: building functions +:: +:Build + CALL :TokenizeLibusbVersionH true + SET _title=Building libusb-win32 !_LIBUSB_APP! (!BUILD_ALT_DIR!) + title !_title! + CALL make_clean.bat + + SET CMDVAR_BUILDARCH=!_BUILDARCH! + SET _ADD_C_DEFINES=/DLIBUSB0_DIR=\"!LIBUSB0_DIR!\" + IF DEFINED CMDVAR_LOG_OUTPUT ( + SET _LOG_OUTPUT_=LOG_OUTPUT_TYPE_!CMDVAR_LOG_OUTPUT:+=+LOG_OUTPUT_TYPE_! + SET _ADD_C_DEFINES=!_ADD_C_DEFINES! /DLOG_OUTPUT_TYPE=!_LOG_OUTPUT_! + ) + + CALL make_!_LIBUSB_APP!.bat !_ADD_C_DEFINES! + IF !ERRORLEVEL! NEQ 0 SET BUILD_ERRORLEVEL=1 + IF !BUILD_ERRORLEVEL! NEQ 0 ( + GOTO CMDERROR + ) + + IF /I "!CMDVAR_DIR_INTERMEDIATE!" NEQ "" ( + CALL :SafeCopyDir "!DIR_LIBUSB_DDK!obj!BUILD_ALT_DIR!\" "!CMDVAR_DIR_INTERMEDIATE!" + ) + + IF /I "!CMDVAR_NOCLEAN" NEQ "true" CALL make_clean.bat %1 + + IF /I "!CMDVAR_TESTSIGNING!" EQU "on" ( + IF EXIST libusb0.sys CALL :SignFile libusb0.sys + IF EXIST libusb0.dll CALL :SignFile libusb0.dll + ) + + CALL :ClearError + IF EXIST libusb0.lib move libusb0.lib libusb.lib %~1 +GOTO :EOF + +:Build_Binaries + CALL :PrepForPackaging %* + CALL :CheckPackaging + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :SafeCleanDir "!PACKAGE_BIN_DIR!" + IF !ERRORLEVEL! NEQ 0 GOTO :EOF + + REM CALL :Build_PackageBinaries w2k msvc w2k + REM IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Build_PackageBinaries x86 msvc x86 + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + PUSHD !CD! + CD /D !_OUTDIR_! + + :: + :: build gcc lib + :: + CALL :BuildLib_GCC libusb_gcc.a libusb0.dll "!DIR_LIBUSB!libusb0.def" + CALL :SafeMove libusb_gcc.a "!PACKAGE_LIB_DIR!gcc\libusb.a" + + :: + :: build bcc lib + :: + CALL :BuildLib_BCC libusb_bcc.lib libusb0.dll + CALL :SafeMove libusb_bcc.lib "!PACKAGE_LIB_DIR!bcc\libusb.lib" + + POPD + + CALL :Build_PackageBinaries x64 msvc_x64 amd64 + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Build_PackageBinaries i64 msvc_i64 ia64 + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :SafeCopy "..\src\libusb_dyn.c" "!PACKAGE_LIB_DIR!dynamic\" + + CALL :SafeCopy "!PACKAGE_ROOT_DIR!gcc\libusb.a" "!PACKAGE_LIB_DIR!gcc\libusb.a" false + CALL :SafeCopy "!PACKAGE_ROOT_DIR!bcc\libusb.lib" "!PACKAGE_LIB_DIR!bcc\libusb.lib" false + CALL :SafeMove "!PACKAGE_BIN_DIR!x86\libusb0.dll" "!PACKAGE_BIN_DIR!x86\libusb0_x86.dll" + + + CALL :SafeCopy "!DIR_LIBUSB_DDK!..\installer_license.txt" "!PACKAGE_ROOT_DIR!installer_license.txt" + CALL :TagEnv "!DIR_LIBUSB_DDK!..\!PACKAGE_BIN_NAME!-README.txt.in" "!PACKAGE_BIN_DIR!!PACKAGE_BIN_NAME!-README.txt" + + ECHO. + ECHO libusb-win32 v!VERSION! binaries built at '!PACKAGE_BIN_DIR!' + IF /I "!LIBUSB_DIST_BUILD!" EQU "true" ( + SET /P __DUMMY=[Sign these files now and/or press 'Enter' to continue] + ) + ECHO. + + SET _OUTDIR_=!PACKAGE_BIN_DIR! + CALL :CmdExe make.cmd !_ARG_LINE! "arch=x86" "app=inf_wizard" "outdir=!_OUTDIR_!" + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :SafeDelete "!_OUTDIR_!*.lib" + +GOTO :EOF + +:: oooooooooooooooooooooooooooooooooooo +:: Packaging functions +:: +:Build_PackageBinaries + SET _OUTDIR_=!PACKAGE_BIN_DIR!%3\ + CALL :SafeCreateDir "!_OUTDIR_!" + CALL :CmdExe make.cmd !_ARG_LINE! "arch=%1" "app=all" "outdir=!_OUTDIR_!" + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO :EOF + + CALL :SafeCreateDir "!PACKAGE_LIB_DIR!%2\" + CALL :SafeMove "!_OUTDIR_!\libusb.lib" "!PACKAGE_LIB_DIR!%2\" +GOTO :EOF + + +:PackageText + CALL :TagEnv "..\README.in" "%~2\README.txt" + COPY /Y "..\*.txt" "%~2" + IF EXIST "!PACKAGE_ROOT_DIR!libusb-win32-changelog-!CMDVAR_VERSION!.txt" ( + COPY /Y "!PACKAGE_ROOT_DIR!libusb-win32-changelog-!CMDVAR_VERSION!.txt" "%~2\" + ) ELSE ( + ECHO No change log.>"%~2\libusb-win32-changelog-!CMDVAR_VERSION!.txt" + ) + +GOTO :EOF + +:PrepForPackaging + CALL :LoadArguments 1 %* + CALL :TryCopyGccBinaries + CALL make_super_clean.bat +GOTO :EOF + +:SetPackage + IF /I "!_PACKAGE_TYPE_!" EQU "snapshot" ( + SET CMDVAR_PCKGNAME=%~1-!CMDVAR_SNAPSHOT_ID! + ) ELSE ( + SET CMDVAR_PCKGNAME=%~1-!CMDVAR_VERSION! + ) +GOTO :EOF + +:Package_Distributables +( + CALL :PrepForPackaging %* + CALL :CheckPackaging + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :CheckOrBuildBinaries + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Bin + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Src + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :Package_Setup + IF !BUILD_ERRORLEVEL! NEQ 0 GOTO CMDERROR + + GOTO :EOF +) +GOTO :EOF + +:Package_Bin + CALL :SetPackage "!PACKAGE_BIN_NAME!" + SET _WORKING_DIR=!PACKAGE_WORKING!!CMDVAR_PCKGNAME!\ + + CALL :SafeReCreateDir "!_WORKING_DIR!" + + CALL :SafeCopyDir "!PACKAGE_BIN_DIR!" "!_WORKING_DIR!bin\" + CALL :SafeCopyDir "!PACKAGE_LIB_DIR!" "!_WORKING_DIR!lib\" + + CALL :SafeCopyDir "..\examples\" "!_WORKING_DIR!examples\" + + CALL :SafeCopy "..\src\usb.h" "!_WORKING_DIR!include\" + + CALL :SafeCopy "!PACKAGE_ROOT_DIR!gcc\*" "!_WORKING_DIR!lib\gcc\" + CALL :SafeCopy "!PACKAGE_ROOT_DIR!bcc\*" "!_WORKING_DIR!lib\bcc\" + + CALL :PackageText bin "!_WORKING_DIR!" + + PUSHD "!CD!" + CD /D "!PACKAGE_WORKING!" + + CALL :DeleteAllDirectories ".svn" + + "!ZIP!" -tzip a -r "!PACKAGE_SAVE_DIR!!CMDVAR_PCKGNAME!.zip" ".\!CMDVAR_PCKGNAME!" + CALL :SafeDeleteDir ".\!CMDVAR_PCKGNAME!" + POPD + +GOTO :EOF + +:Package_Src + CALL make_super_clean.bat + CALL :SetPackage "!PACKAGE_SRC_NAME!" + SET _WORKING_DIR=!PACKAGE_WORKING!!CMDVAR_PCKGNAME!\ + CALL :SafeReCreateDir "!_WORKING_DIR!" + + CALL :SafeCopyDir "..\" "!_WORKING_DIR!" + + CALL :PackageText src "!_WORKING_DIR!" + + PUSHD "!CD!" + CD /D "!PACKAGE_WORKING!" + + CALL :DeleteAllDirectories ".svn" + "!ZIP!" -tzip a -r "!PACKAGE_SAVE_DIR!!CMDVAR_PCKGNAME!.zip" ".\!CMDVAR_PCKGNAME!" + CALL :SafeDeleteDir ".\!CMDVAR_PCKGNAME!\" + POPD +GOTO :EOF + +:Package_Setup + CALL :SetPackage "!PACKAGE_SETUP_NAME!" + SET _WORKING_DIR=!PACKAGE_WORKING!!PACKAGE_SETUP_NAME!\ + CALL :SafeReCreateDir "!_WORKING_DIR!" + + CALL :PackageText setup "!_WORKING_DIR!" + + IF /I "!CMDVAR_TESTSIGNING!" EQU "on" ( + CALL :SafeCopy "!PACKAGE_ROOT_DIR!cert\!CERT_FILE!" "!_WORKING_DIR!" + ) + + CALL :TagEnv "filter-bin-setup.iss.in" "!_WORKING_DIR!filter-bin-setup.iss" + + PUSHD "!CD!" + CD /D "!_WORKING_DIR!" + CALL :DeleteAllDirectories ".svn" + "!ISCC!" "filter-bin-setup.iss" + IF !ERRORLEVEL! NEQ 0 GOTO CMDERROR + + CALL :SafeMove "!CMDVAR_PCKGNAME!.exe" "!PACKAGE_SAVE_DIR!" + DEL /Q "!_WORKING_DIR!*" + POPD +GOTO :EOF + +:Super_Clean + CALL :LoadArguments 1 %* + CALL make_super_clean.bat +GOTO :EOF + +:Package_Clean + CALL :LoadArguments 1 %* + CALL :SafeCleanDir "!PACKAGE_BIN_DIR!" + CALL :SafeCleanDir "!PACKAGE_LIB_DIR!" + CALL :SafeCleanDir "!PACKAGE_WORKING!" + CALL :SafeCleanDir "!PACKAGE_SAVE_DIR!" + CALL make_super_clean.bat +GOTO :EOF + +:: oooooooooooooooooooooooooooooooooooo +:: Internal functions +:: +:SafeCleanDir + IF EXIST "%~1" ( + ECHO [SafeCleanDir] %~1 + RMDIR /S /Q "%~1" + GOTO :EOF + ) +GOTO :EOF + +:SafeCopyDir + SET __SafeCopyDir_Src=%~dp1 + SET __SafeCopyDir_Dst=%~dp2 + IF NOT EXIST "!__SafeCopyDir_Src!" ( + ECHO [SafeCopyDir] %~1 does not exists. + GOTO :EOF + ) + + IF "!__SafeCopyDir_Dst:~-1!" EQU "\" SET __SafeCopyDir_Dst=!__SafeCopyDir_Dst:~0,-1! + FOR /F "usebackq eol=; tokens=* delims=" %%A IN (`DIR /S /B /A-H-S-R-D "!__SafeCopyDir_Src!\*.*"`) DO ( + CALL :StrRemove "%%~A" "!__SafeCopyDir_Src!" + SET __SafeCopyDir_File=!__SafeCopyDir_Dst!\!StrRemove! + CALL :ToAbsoluteDirs __SafeCopyDir_Dir "!__SafeCopyDir_File!" + IF NOT EXIST "!__SafeCopyDir_Dir!" MKDIR "!__SafeCopyDir_Dir!" + ECHO [SafeCopyDir] File = !__SafeCopyDir_Dir!%%~nxA + COPY /Y "%%~A" "!__SafeCopyDir_Dir!" >NUL + + ) +GOTO :EOF + +:StrRemove + SET StrRemove=%~1 + SET StrRemove=!StrRemove:%~2=! +GOTO :EOF + +:SafeReCreateDir + CALL :SafeCleanDir "%~1" + CALL :SafeCreateDir "%~1" +GOTO :EOF + +:SafeCreateDir + IF NOT EXIST "%~1" ( + ECHO [SafeCreateDir] %~1 + MKDIR "%~1" + GOTO :EOF + ) +GOTO :EOF + +:SafeDeleteDir + IF EXIST "%~1" ( + ECHO [SafeDeleteDir] %~1 + RMDIR /S /Q "%~1" + GOTO :EOF + ) +GOTO :EOF + + +:SafeDelete + IF EXIST "%~1" ( + ECHO [SafeDelete] %~1 + DEL /Q "%~1" + GOTO :EOF + ) +GOTO :EOF + +:SafeCopy + IF /I "%3" EQU "false" ( + ECHO [SafeCopy] %~2 already exists. skipping.. + IF EXIST "%~2" GOTO :EOF + ) + IF EXIST "%~1" ( + ECHO [SafeCopy] %~1 %~2 + CALL :SafeCreateDir "%~dp2" + COPY /Y "%~1" "%~2" 2>NUL>NUL + GOTO :EOF + ) +GOTO :EOF + +:SafeMove + IF EXIST "%~1" ( + ECHO [SafeMove] %~1 %~2 + CALL :SafeCreateDir "%~dp2" + MOVE /Y "%~1" "%~2" + GOTO :EOF + ) +GOTO :EOF + +:DeleteAllDirectories + CALL :CreateTempFile CLEAN_SVN_TMP + + DIR /B /S "%~1">!CLEAN_SVN_TMP! + FOR /F "eol=; tokens=1* usebackq delims=" %%I IN (!CLEAN_SVN_TMP!) DO ( + CALL :SafeDeleteDir "%%I" + ) + + CALL :DestroyTempFile CLEAN_SVN_TMP + +GOTO :EOF + +:: +:: params = outlibfile indllfile indeffile +:: +:BuildLib_GCC + IF NOT EXIST "!CMDVAR_DLLTOOL!" ( + ECHO [WARNING] gcc dlltool not found. Skipping gcc lib build.. + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) + + "!CMDVAR_DLLTOOL!" --output-lib "%~1" --dllname "%~2" --input-def "%~3" + IF !ERRORLEVEL! NEQ 0 ECHO [WARNING] gcc dlltool tool failed. +GOTO :EOF + +:: +:: params = outlibfile indllfile +:: +:BuildLib_BCC + IF NOT EXIST "!CMDVAR_IMPLIB!" ( + ECHO [WARNING] bcc implib tool not found. Skipping bcc lib build.. + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) + + "!CMDVAR_IMPLIB!" -a %~1 %~2 + IF !ERRORLEVEL! NEQ 0 ECHO [WARNING] bcc implib tool failed. +GOTO :EOF + +:TryCopyGccBinaries + CALL :SafeCopy ..\libusb.a "!PACKAGE_ROOT_DIR!gcc\" +GOTO :EOF + +:SetDDK + PUSHD !CD! + SET SELECTED_DDK=%~1 + SHIFT /1 + IF /I "%~1" EQU "forceoacr" SET WINDDK_AUTOCODEREVIEW= + SHIFT /1 + IF NOT EXIST "!SELECTED_DDK!\bin\setenv.bat" ( + ECHO Failed locating WinDDK setenv.bat at '!SELECTED_DDK!\bin\setenv.bat' + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) + CALL "!SELECTED_DDK!\bin\setenv.bat" !SELECTED_DDK! %1 %2 %3 %4 !WINDDK_AUTOCODEREVIEW! + SET BUILD_ERRORLEVEL=!ERRORLEVEL! + POPD + IF NOT !BUILD_ERRORLEVEL!==0 ( + ECHO Failed setting DDK environment + ) +GOTO :EOF + +:CheckOrBuildBinaries + IF NOT EXIST "!PACKAGE_BIN_DIR!x86\*.dll" GOTO BinariesNotBuilt + IF NOT EXIST "!PACKAGE_BIN_DIR!x86\*.sys" GOTO BinariesNotBuilt + IF NOT EXIST "!PACKAGE_BIN_DIR!x86\*.exe" GOTO BinariesNotBuilt + IF NOT EXIST "!PACKAGE_BIN_DIR!amd64\*.dll" GOTO BinariesNotBuilt + IF NOT EXIST "!PACKAGE_BIN_DIR!amd64\*.sys" GOTO BinariesNotBuilt + IF NOT EXIST "!PACKAGE_BIN_DIR!amd64\*.exe" GOTO BinariesNotBuilt + GOTO :EOF + + :BinariesNotBuilt + ECHO Binaries not found. Building binaries first.. + CALL :CmdExe make.cmd bin + IF NOT !BUILD_ERRORLEVEL!==0 ( + ECHO [CheckOrBuildBinaries] Failed. + pause + ) + +GOTO :EOF + +:CheckPackaging + CALL :ToAbsolutePaths ZIP "!ZIP!" ISCC "!ISCC!" + IF NOT EXIST "!ZIP!" ( + ECHO [CheckPackaging] Failed locating zip utility: !ZIP! + ECHO [CheckPackaging] See !MAKE_CFG! + GOTO CMDERROR + ) + IF NOT EXIST "!ISCC!" ( + ECHO [CheckPackaging] Failed locating inno setup compiler: !ISCC! + ECHO [CheckPackaging] See !MAKE_CFG! + GOTO CMDERROR + ) +GOTO :EOF + +:CheckWinDDK + SET BUILD_ERRORLEVEL=1 + + IF /I "%1" EQU "pre" ( + IF NOT EXIST "!CMDVAR_WINDDK_DIR!" GOTO WINDDK_NOTFOUND + IF NOT EXIST "!CMDVAR_WINDDK_W2K_DIR!" GOTO WINDDK_W2K_NOTFOUND + SET BUILD_ERRORLEVEL=0 + GOTO :EOF + :WINDDK_NOTFOUND + ECHO Invalid WinDDK Directory !CMDVAR_WINDDK_DIR! + GOTO :EOF + + :WINDDK_W2K_NOTFOUND + ECHO Invalid WinDDK W2K Directory !CMDVAR_WINDDK_W2K_DIR! + GOTO :EOF + ) ELSE ( + IF DEFINED _NT_TARGET_VERSION ( + ECHO WinDDK ok. Target version = !_NT_TARGET_VERSION! + SET BUILD_ERRORLEVEL=0 + ) ELSE ( + ECHO Unable to configure WinDDK. + GOTO :EOF + ) + ) +GOTO :EOF + +:LoadConfig + IF NOT EXIST "!MAKE_CFG!" ( + ECHO Config file not found "!MAKE_CFG!". + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) + FOR /F "eol=; tokens=1,2* usebackq delims==" %%I IN (!MAKE_CFG!) DO ( + IF NOT "%%~I" EQU "" ( + SET _PNAME=%%~I + SET _PNAME=!_PNAME: =! + IF /I "!_PNAME!" EQU "ZIP" ( + CALL :ToShortName _PVALUE "%%~J" + ) ELSE IF /I "!_PNAME!" EQU "ISCC" ( + CALL :ToShortName _PVALUE "%%~J" + ) ELSE IF /I "!_PNAME!" EQU "IMPLIB" ( + CALL :ToShortName _PVALUE "%%~J" + ) ELSE IF /I "!_PNAME!" EQU "DLLTOOL" ( + CALL :ToShortName _PVALUE "%%~J" + ) ELSE ( + SET _PVALUE=%%J + ) + SET !_PNAME!=!_PVALUE! + SET CMDVAR_!_PNAME!=!_PVALUE! + ) + ) + SET LIBUSB0_DIR=!PACKAGE_ROOT_DIR:\=/! + IF "!LIBUSB0_DIR:~-1!" EQU "/" SET LIBUSB0_DIR=!LIBUSB0_DIR:~0,-1! + + IF /I "!WINDDK_AUTOCODEREVIEW!" EQU "false" ( + SET WINDDK_AUTOCODEREVIEW=no_oacr + ) ELSE ( + SET WINDDK_AUTOCODEREVIEW= + ) +GOTO :EOF + +:LoadArguments + CALL :ParamValsToEnv :LoadArgumentsCallback %* + + IF NOT EXIST "!DIR_LIBUSB_DDK!" ( + ECHO Invalid !MAKE_CFG!. + GOTO CMDERROR + ) + CALL :ToAbsolutePaths DIR_LIBUSB_DDK "!DIR_LIBUSB_DDK!" + CALL :ToAbsolutePaths DIR_LIBUSB "!DIR_LIBUSB_DDK!..\" + + IF "!CMDVAR_WINDDK!" NEQ "" SET CMDVAR_WINDDK_DIR=!CMDVAR_WINDDK! + IF "!CMDVAR_WIN2KDDK!" NEQ "" SET CMDVAR_WINDDK_W2K_DIR=!CMDVAR_WIN2KDDK! + IF "!CMDVAR_WINDDK_W2K_DIR!" EQU "" SET CMDVAR_WINDDK_W2K_DIR=!CMDVAR_WINDDK_DIR! + IF "!CMDVAR_OUTDIR!" EQU "" SET CMDVAR_OUTDIR=.\!CMDVAR_ARCH! + IF "!CMDVAR_APP!" EQU "" SET CMDVAR_APP=all +GOTO :EOF + +:: params = no_overwrite +:TokenizeLibusbVersionH + CALL :ToAbsolutePaths _H_IN "!DIR_LIBUSB_DDK!..\src\libusb-win32_version_h.in" + CALL :ToAbsolutePaths _H_OUT "!DIR_LIBUSB_DDK!..\src\libusb-win32_version.h" + IF /I "%~1" EQU "true" IF EXIST "!_H_OUT!" GOTO :EOF + CALL :SafeDelete "!_H_OUT!" + CALL :TagEnv "!_H_IN!" "!_H_OUT!" +GOTO :EOF + +:LoadArgumentsCallback + SET CMDVAR_%~1=%~2 +GOTO :EOF + +:: +:: Parses param/value pairs. +:: Params = CallbackFunction ArgSkipCount "param1=value1" "param2=value2" .. +:: +:ParamValsToEnv + SET _SKIP_ARG_LINE= + SET _ARG_LINE= + + SET _CALLBACK_FN=%~1 + SET _ARG_SKIP_COUNT=%~2 + SHIFT /1 + + :ParamValsToEnv_Next + SHIFT /1 + IF "%~1" EQU "" GOTO :EOF + IF !_ARG_SKIP_COUNT! GTR 0 ( + SET _SKIP_ARG_LINE=!_SKIP_ARG_LINE! "%~1" + SET /A _ARG_SKIP_COUNT=_ARG_SKIP_COUNT-1 + GOTO ParamValsToEnv_Next + ) + SET _ARG_LINE=!_ARG_LINE! %1 + SET _PARAM_VALUE_=%%~1 + FOR /F "usebackq tokens=1,2 delims==" %%H IN ('%%~1') DO ( + IF "%%~H" NEQ "" ( + CALL !_CALLBACK_FN! %%H %%I + ) + ) + GOTO ParamValsToEnv_Next +GOTO :EOF + +:ToAbsoluteDirs + IF NOT "%~1" EQU "" ( + SET %~1=%~dp2 + SHIFT /1 + SHIFT /1 + GOTO ToAbsoluteDirs + ) +GOTO :EOF + +:GetDDKToolPath + CALL :FindInPath %1 "%~2" + IF "!%1!" EQU "" CALL :ToAbsolutePaths %1 "!CMDVAR_WINDDK_DIR!bin\x86\%~2" + IF NOT EXIST "!%1!" ( + ECHO %~2 was not found in the path or !CMDVAR_WINDDK_DIR!bin\x86 + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) +GOTO :EOF + + +:SignFile + CALL :GetDDKToolPath MAKE-CERT makecert.exe + IF "!BUILD_ERRORLEVEL!" NEQ "0" GOTO :EOF + + CALL :GetDDKToolPath CERT-MGR certmgr.exe + IF "!BUILD_ERRORLEVEL!" NEQ "0" GOTO :EOF + + CALL :GetDDKToolPath SIGN-TOOL signtool.exe + IF "!BUILD_ERRORLEVEL!" NEQ "0" GOTO :EOF + + ECHO [SignFile] NOTE - remember to type 'bcdedit -set testsigning on' to use + ECHO test certificates on x64 machines. + ECHO. + CALL :SafeCopy "!PACKAGE_ROOT_DIR!cert\!CMDVAR_CERT_FILE!" "!CD!" + IF NOT EXIST "!CMDVAR_CERT_FILE!" ( + + ECHO [SignFile] clearing LibusbCertStore + "!CERT-MGR!" -del -all -s LibusbCertStore + + ECHO [SignFile] making !CMDVAR_CERT_FILE! test certificate + "!MAKE-CERT!" -r -pe -ss LibusbCertStore -n "CN=Libusb-Win32 Testing" !CMDVAR_CERT_FILE! + IF "!ERRORLEVEL!" NEQ "0" ( + SET BUILD_ERRORLEVEL=1 + ECHO [SignFile] failed creating certificate !CMDVAR_CERT_FILE! + GOTO :EOF + ) + + CALL :SafeCopy !CMDVAR_CERT_FILE! "!PACKAGE_ROOT_DIR!cert\" + + ECHO [SignFile] adding !CMDVAR_CERT_FILE! to root + "!CERT-MGR!" -add !CMDVAR_CERT_FILE! -s -r localMachine root + IF "!ERRORLEVEL!" NEQ "0" ( + SET BUILD_ERRORLEVEL=1 + ECHO [SignFile] failed adding certificate to root + GOTO :EOF + ) + + ECHO [SignFile] adding !CMDVAR_CERT_FILE! to trustedpublisher + "!CERT-MGR!" -add !CMDVAR_CERT_FILE! -s -r localMachine trustedpublisher + IF "!ERRORLEVEL!" NEQ "0" ( + SET BUILD_ERRORLEVEL=1 + ECHO [SignFile] failed adding certificate to trustedpublisher + GOTO :EOF + ) + + ) + + "!SIGN-TOOL!" sign /s LibusbCertStore %1 + IF "!ERRORLEVEL!" NEQ "0" ( + SET BUILD_ERRORLEVEL=1 + GOTO :EOF + ) + DEL /Q !CMDVAR_CERT_FILE! +GOTO :EOF + +:: searches the directories listed in the PATH +:: environment variable for %2 and expands to the +:: drive letter and path of the first one found. +:: +:FindInPath + SET %1=%~dp$PATH:2 + IF "!%~1!" NEQ "" ( + CALL :ToAbsolutePaths %1 "!%~1!%2" + ECHO [FindInPath] found path for %1 + ) +GOTO :EOF + +:ToAbsolutePaths + IF NOT "%~1" EQU "" ( + SET %~1=%~f2 + SHIFT /1 + SHIFT /1 + GOTO ToAbsolutePaths + ) +GOTO :EOF + +:ToShortName + IF NOT "%~1" EQU "" ( + SET %~1=%~s2 + SHIFT /1 + SHIFT /1 + GOTO ToShortName + ) +GOTO :EOF + +:: +:: Params = +:: +:TagEnv + CALL :CreateTempFile TAG_ENV_TMP + + IF NOT DEFINED _LTAG_ SET _LTAG_=@ + IF NOT DEFINED _RTAG_ SET _RTAG_=@ + IF EXIST "%~2" DEL /Q "%~2" + ECHO [Tokenizing] %~1.. + SET CMDVAR_>!TAG_ENV_TMP! + FOR /F "tokens=1,* delims=]" %%A IN ('"type %1|find /n /v """') DO ( + SET "line=%%B" + IF DEFINED line ( + FOR /F "tokens=1,* usebackq delims==" %%I IN (!TAG_ENV_TMP!) DO ( + SET _TOKEN_KEY_=%%I + SET _TOKEN_KEY_=!_LTAG_!!_TOKEN_KEY_:~7!!_RTAG_! + CALL SET "line=%%line:!_TOKEN_KEY_!=%%~J%%" + ) + ECHO !line!>> "%~2" + ) ELSE ECHO.>> "%~2" + ) + CALL :DestroyTempFile TAG_ENV_TMP + +GOTO :EOF + +:CreateTempFile + SET %1=!DIR_LIBUSB_DDK!tf!RANDOM!.tmp +GOTO :EOF + +:DestroyTempFile + IF EXIST "!%1!" ( + DEL /Q "!%1!" + IF EXIST "!%1!" ECHO [DestroyTempFile] !%1! access denied. + ) ELSE ( + ECHO [DestroyTempFile] !%1! not found. + ) + SET %1= +GOTO :EOF + +:CreateErrorMarker + SET _EMARKER=1 + ECHO !_EMARKER!>"!DIR_LIBUSB_DDK!emarker.tmp" +GOTO :EOF + +:DestroyErrorMarker + SET _EMARKER= + IF EXIST "!DIR_LIBUSB_DDK!emarker.tmp" ( + DEL /Q "!DIR_LIBUSB_DDK!emarker.tmp" + SET _EMARKER=1 + ) +GOTO :EOF + +:CmdExe + CALL :CreateErrorMarker + CMD /C %* + IF NOT !ERRORLEVEL!==0 SET BUILD_ERRORLEVEL=1 + CALL :DestroyErrorMarker + IF DEFINED _EMARKER! ( + SET BUILD_ERRORLEVEL=1 + ECHO [CmdExe] Last build did not complete. + ) +GOTO :EOF + + +:ClearError + SET ERRORLEVEL=0 + SET BUILD_ERRORLEVEL=0 +GOTO :EOF + +:CMDERROR + SET BUILD_ERRORLEVEL=1 + SET ERRORLEVEL=1 +GOTO CMDEXIT + +:CMDEXIT +IF /I "!DIR_LIBUSB_DDK!" NEQ "!DIR_LIBUSB_WORKING!" POPD +EXIT /B !BUILD_ERRORLEVEL! + +:ShowHelp + +ECHO. +ECHO LIBUSB-WIN32 WinDDK build utility/application packager +ECHO. +ECHO Summary: This batch script automates the libusb-win32 WinDDK build process +ECHO and creates libusb-win32 redistributable packages. +ECHO [see also make.cfg] +ECHO. +ECHO BUILD USAGE: CMD /C make.cmd "Option=Value" +ECHO Options: +ECHO [req] ARCH w2k/x86/x64/i64 +ECHO APP all/dll/driver/install_filter/install_filter_win/inf_wizard/test/testwin +ECHO [Default = all] +ECHO OUTDIR Directory that will contain the compiled binaries +ECHO [Default = .\ARCH] +ECHO WINDDK WinDDK directory for WXP-WIN7 builds +ECHO [Default = see make.cfg] +ECHO WIN2KDDK WinDDK directory for Windows 2000 builds +ECHO [Default = see make.cfg] +ECHO DEBUGMODE Setting this option to 'true' makes chk builds instead of fre. +ECHO This also enables kernel debug messages and sets all default +ECHO log modes to the max verbosity. +ECHO [Default = false] +ECHO TESTSIGNING Setting this option to 'on' signs te dll and driver with a +ECHO test certifcate. +ECHO [Default = off] +ECHO LOG_OUTPUT Changes the log output type. By default, console apps send log +ECHO messages to stderr, dlls and windows apps send log messages to +ECHO OutputDebugString and kernel drivers send messages to +ECHO DbgPrint. Use DebugView to view DBGPRINT, DEBUGWINDOW logs. +ECHO http://download.sysinternals.com/Files/DebugView.zip +ECHO Log Output Types (case sensitive, combinable with +): +ECHO DEFAULT Use the build defaults. [see above] +ECHO REMOVE Strip all log messages [except errors]. +ECHO STDERR output to stderr +ECHO DEBUGWINDOW OutputDebugString, DbgPrint +ECHO FILE redirect log messages to a file. +ECHO. +ECHO [Note: See make.cfg for more options that can be used when building] +ECHO Examples: +ECHO CMD /C make.cmd "arch=x86" "app=all" "outdir=.\x86" +ECHO CMD /C make.cmd "arch=x64" "outdir=.\x64" "winddk=%SystemDrive%\WinDDK\7600.16385.0\" +ECHO CMD /C make.cmd "arch=x64" "testsigning=on" +ECHO CMD /C make.cmd "arch=x86" +ECHO. +ECHO PACKAGE USAGE: make.cmd PackageCommand "Option=Value" +ECHO Package Commands: +ECHO ALL Build binaries for all architectures. +ECHO DIST Creates libusb-win32 dist packages. +ECHO SNAPSHOT Creates libusb-win32 snapshot packages. +ECHO. +ECHO Additional Commands: +ECHO CLEAN Cleans all temporary files. +ECHO CLEANPACKAGE Cleans root package directory. +ECHO SIGNFILE Signs a dll or sys file with a test certificate. +ECHO MAKEVER Re/creates libusb-win32_version.h from the template. +ECHO. +ECHO [Note: See make.cfg for options that can be used when packaging] +ECHO. +ECHO Example: make.cmd clean +ECHO Example: make.cmd all +ECHO Example: make.cmd dist +ECHO. +GOTO CMDERROR + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_all.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_all.bat new file mode 100644 index 0000000..3615e53 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_all.bat @@ -0,0 +1,29 @@ +@echo off +call make_clean.bat +SET ERRORLEVEL=0 + +call make_dll.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR +call make_driver.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR +call make_test.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR +call make_test_win.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR +call make_install_filter.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR +call make_install_filter_win.bat %* +IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR + +REM DDK builkdInf-Wizard embeds drivers for multiple +REM platforms and can no longer be here. +REM +REM call make_inf_wizard.bat %* +REM IF NOT %ERRORLEVEL%==0 GOTO INF_BUILD_ERROR + +GOTO DONE + +:BUILD_ERROR +GOTO DONE + +:DONE diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_clean.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_clean.bat new file mode 100644 index 0000000..8266c7a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_clean.bat @@ -0,0 +1,40 @@ +@echo off + +set OUTDIR= + +if exist .\output\i386 set OUTDIR=.\output\i386 +if exist .\output\amd64 set OUTDIR=.\output\amd64 +if exist .\output\ia64 set OUTDIR=.\output\ia64 + +if "%OUTDIR%"=="" GOTO NO_OUTDIR + if exist %OUTDIR%\*.exe copy /y %OUTDIR%\*.exe . >NUL + if exist %OUTDIR%\*.dll copy /y %OUTDIR%\*.dll . >NUL + if exist %OUTDIR%\*.lib copy /y %OUTDIR%\*.lib . >NUL + if exist %OUTDIR%\*.sys copy /y %OUTDIR%\*.sys . >NUL +:NO_OUTDIR + +if exist .\output rmdir /s /q .\output + +if exist .\objchk_wxp_x86 rmdir /s /q .\objchk_wxp_x86 +if exist .\objchk_wnet_AMD64 rmdir /s /q .\objchk_wnet_AMD64 +if exist .\objchk_wnet_IA64 rmdir /s /q .\objchk_wnet_IA64 +if exist .\objchk_wxp_ia64 rmdir /s /q .\objchk_wxp_ia64 +if exist .\objchk_w2k_x86 rmdir /s /q .\objchk_w2k_x86 + +if exist .\objfre_wxp_x86 rmdir /s /q .\objfre_wxp_x86 +if exist .\objfre_wnet_AMD64 rmdir /s /q .\objfre_wnet_AMD64 +if exist .\objfre_wnet_IA64 rmdir /s /q .\objfre_wnet_IA64 +if exist .\objfre_wxp_ia64 rmdir /s /q .\objfre_wxp_ia64 +if exist .\objfre_w2k_x86 rmdir /s /q .\objfre_w2k_x86 + +if exist sources del /q sources +if exist *.def del *.def +if exist *.h del *.h +if exist *.c del *.c +if exist *.rc del *.rc +if exist manifest_*.xml del /q manifest_*.xml +if exist install-filter*.txt del /q install-filter*.txt +DEL /Q "..\*.o" "..\*.dll" "..\*.a" "..\*.exp" "..\*.lib" "..\*.exe" 2>NUL>NUL +DEL /Q "..\*.tar.gz" "..\*.iss" "..\*.rc" "..\*.h" "..\*.sys" "..\*.log" 2>NUL>NUL +DEL /Q /S "..\*~" 2>NUL>NUL +DEL /Q "..\README.txt" 2>NUL>NUL diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_dll.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_dll.bat new file mode 100644 index 0000000..ba396b2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_dll.bat @@ -0,0 +1,26 @@ +@echo off + +set SRC_DIR=..\src + +call make_clean.bat + +copy sources_dll sources >NUL + +copy %SRC_DIR%\*.c . >NUL +copy ..\*.def . >NUL +copy %SRC_DIR%\*.h . >NUL +copy %SRC_DIR%\*.rc . >NUL +copy %SRC_DIR%\driver\driver_api.h . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS +if exist libusb0.lib move /Y libusb0.lib libusb.lib >NUL +:BUILD_DONE \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_driver.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_driver.bat new file mode 100644 index 0000000..caa7a90 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_driver.bat @@ -0,0 +1,27 @@ +@echo off + +set SRC_DIR=..\src\driver + +call make_clean.bat + +copy sources_drv sources >NUL + +copy %SRC_DIR%\*.c . >NUL +copy %SRC_DIR%\*.h . >NUL +copy %SRC_DIR%\*.rc . >NUL +copy %SRC_DIR%\..\*.rc . >NUL +copy %SRC_DIR%\..\libusb-win32_version.h . >NUL +copy %SRC_DIR%\..\error.? . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS + +:BUILD_DONE \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_inf_wizard.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_inf_wizard.bat new file mode 100644 index 0000000..294be56 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_inf_wizard.bat @@ -0,0 +1,94 @@ +@ECHO OFF +SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION + +SET TESTS_DIR=..\tests +SET SRC_DIR=..\src +call make_clean.bat + +:: Check arguments +:: + +IF "!LIBWDI_DIR!" EQU "" SET LIBWDI_DIR=..\projects\additional\libwdi\ + +:: Check for libwdi ddk_build.cmd +:: +IF NOT EXIST "!LIBWDI_DIR!\ddk_build.cmd" ( + ECHO libwdi ddk_build.cmd not found at '!LIBWDI_DIR!' + GOTO SHOW_LIBWDI_HELP +) + +:: Build libwdi +:: +SET BUILD_ERRORLEVEL=0 +SET _CD_=!CD! +PUSHD !_CD_! + +CD /D "!LIBWDI_DIR!" +IF EXIST "build%BUILD_ALT_DIR%.err" DEL /Q "build%BUILD_ALT_DIR%.err" >NUL +IF EXIST "build%BUILD_ALT_DIR%.wrn" DEL /Q "build%BUILD_ALT_DIR%.wrn" >NUL + +IF EXIST "!LIBUSB0_DIR!" ( + SET C_DEFINES=/DLIBUSB0_DIR=\"!LIBUSB0_DIR!\" /DOPT_M32 /DOPT_M64 /DOPT_IA64 +) ELSE ( + ECHO. + ECHO [Warning] The LIBUSB0_DIR environment variable has not been set. This + ECHO inf-wizard will contain only the inf generator and not + ECHO embedded libusb-win32 binaries. + ECHO. + ECHO '!LIBUSB0_DIR!' + SET C_DEFINES=/DUSER_DIR=\"\" /DOPT_M32 /DOPT_M64 +) +ECHO Building (%BUILD_ALT_DIR%) libwdi.. +CALL ddk_build.cmd no_samples 2>NUL + +IF EXIST "build%BUILD_ALT_DIR%.err" SET BUILD_ERRORLEVEL=1 +IF EXIST "build%BUILD_ALT_DIR%.err" SET ERRORLEVEL=1 +IF !BUILD_ERRORLEVEL! NEQ 0 ( + + ECHO Failed building libwdi. + GOTO BUILD_ERROR +) + +POPD + +:: +:: Copy in the inf-wizard sources +COPY /Y "!LIBWDI_DIR!\libwdi\libwdi.lib" >NUL +COPY /Y "!LIBWDI_DIR!\libwdi\libwdi.h" >NUL +COPY /Y "!LIBWDI_DIR!\libwdi\msapi_utf8.h" >NUL +COPY /Y sources_inf_wizard sources >NUL +COPY /Y %SRC_DIR%\inf_wizard*.* >NUL +COPY /Y %SRC_DIR%\libusb-win32_version.* >NUL +copy %SRC_DIR%\*.manifest . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat !_ARGS_! +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 +GOTO BUILD_DONE + +:SHOW_LIBWDI_HELP +ECHO. +ECHO inf-wizard-libusb-win32 WinDDK build utility +ECHO. +ECHO Summary: This batch script automates the inf-wizard WinDDK build process +ECHO and creates inf-wizard with embedded binaries. +ECHO. +ECHO NOTE : This batch script must be run from a x86 windkk build environment. +ECHO. +ECHO USAGE EXAMPLE: +ECHO +ECHO example #1. +ECHO SET LIBUSB0_DIR=Z:\packages\libusb-win32\ +ECHO make_inf_wizard.bat +ECHO. +GOTO BUILD_DONE + +:BUILD_SUCCESS +GOTO BUILD_DONE + +:BUILD_DONE diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter.bat new file mode 100644 index 0000000..8f15c3a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter.bat @@ -0,0 +1,26 @@ +@echo off +set TESTS_DIR=..\tests +set SRC_DIR=..\src + +call make_clean.bat + +copy sources_install_filter sources >NUL +copy %SRC_DIR%\*.c . >NUL +copy %SRC_DIR%\*.h . >NUL +copy %SRC_DIR%\*.rc . >NUL +copy %SRC_DIR%\driver\driver_api.h . >NUL +copy %SRC_DIR%\install-filter*.* . >NUL +copy ..\manifest.txt . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS + +:BUILD_DONE diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter_win.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter_win.bat new file mode 100644 index 0000000..e01da11 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_install_filter_win.bat @@ -0,0 +1,26 @@ +@echo off +set TESTS_DIR=..\tests +set SRC_DIR=..\src + +call make_clean.bat + +copy sources_install_filter_win sources >NUL +copy %SRC_DIR%\*.c . >NUL +copy %SRC_DIR%\*.h . >NUL +copy %SRC_DIR%\*.rc . >NUL +copy %SRC_DIR%\driver\driver_api.h . >NUL +copy %SRC_DIR%\install_filter_win.* . >NUL +copy %SRC_DIR%\common_controls_admin.manifest . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS + +:BUILD_DONE diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_super_clean.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_super_clean.bat new file mode 100644 index 0000000..7866c86 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_super_clean.bat @@ -0,0 +1,51 @@ +@echo off + +call make_clean.bat +DEL /Q *.exe *.dll *.sys *.lib *.log *.wrn *.err *.cer *.manifest *.ico ..\*.inf.in 2>NUL>NUL + +if exist .\x86 rmdir /s /q .\x86 +if exist .\x64 rmdir /s /q .\x64 +if exist .\AMD64 rmdir /s /q .\AMD64 +if exist .\i64 rmdir /s /q .\i64 +if exist .\w2k rmdir /s /q .\w2k + +IF NOT EXIST ..\projects\ GOTO DONE + +PUSHD !CD! +CD ..\projects +RMDIR /S /Q .\Debug 2>NUL>NUL +RMDIR /S /Q .\Release 2>NUL>NUL +RMDIR /S /Q .\Win32 2>NUL>NUL +RMDIR /S /Q .\x64 2>NUL>NUL +RMDIR /S /Q .\_ReSharper.libusb-win32 2>NUL>NUL + +DEL /S /Q *.gitignore *.log *.user *.ncb *.resharper 2>NUL>NUL +DEL /S /Q /AH *.suo 2>NUL>NUL +DEL /S /Q .\additional\libwdi\*.exe 2>NUL>NUL +DEL /S /Q .\additional\libwdi\*.lib 2>NUL>NUL + +RMDIR /S /Q .\additional\libwdi\libwdi\objfre_wxp_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objchk_wxp_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objfre_wxp_amd64 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objchk_wxp_amd64 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objfre_w2k_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objchk_w2k_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objfre_w2k_amd64 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\libwdi\objchk_w2k_amd64 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\Win32 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\x64 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\examples\objfre_wxp_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\examples\objchk_wxp_x86 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\examples\objfre_wxp_w2k 2>NUL>NUL +RMDIR /S /Q .\additional\libwdi\examples\objchk_wxp_w2k 2>NUL>NUL + +DEL .\additional\libwdi\libwdi\embedded.h 2>NUL>NUL +DEL .\additional\libwdi\libwdi\config.h 2>NUL>NUL +DEL /S /Q .\additional\libwdi\*.o 2>NUL>NUL +RMDIR /S /Q ".\Win32" 2>NUL>NUL +RMDIR /S /Q ".\x64" 2>NUL>NUL +POPD + +:DONE + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test.bat new file mode 100644 index 0000000..d4cf109 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test.bat @@ -0,0 +1,24 @@ +@echo off + +set TESTS_DIR=..\tests +set SRC_DIR=..\src + +call make_clean.bat + +copy sources_test sources >NUL +copy %TESTS_DIR%\testlibusb.c . >NUL +copy %SRC_DIR%\usb.h . >NUL +copy %SRC_DIR%\*.rc . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS + +:BUILD_DONE \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test_win.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test_win.bat new file mode 100644 index 0000000..17a01bc --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/make_test_win.bat @@ -0,0 +1,27 @@ +@echo off + +set TESTS_DIR=..\tests +set SRC_DIR=..\src + +call make_clean.bat + +copy sources_test_win sources >NUL +copy %TESTS_DIR%\testlibusb_win.c . >NUL +copy %TESTS_DIR%\testlibusb_win_rc.rc . >NUL +copy %SRC_DIR%\usb.h . >NUL +copy %SRC_DIR%\libusb-win32_version.h . >NUL +copy %SRC_DIR%\*.rc . >NUL +copy %SRC_DIR%\*.manifest . >NUL + +ECHO Building (%BUILD_ALT_DIR%) %0.. +CALL build_ddk.bat %* +IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS +GOTO BUILD_ERROR + +:BUILD_ERROR +ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%) +EXIT /B 1 + +:BUILD_SUCCESS + +:BUILD_DONE \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/makefile b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/makefile new file mode 100644 index 0000000..53b9a3d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/makefile @@ -0,0 +1 @@ +!INCLUDE $(NTMAKEENV)\makefile.def diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_dll b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_dll new file mode 100644 index 0000000..be03bf7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_dll @@ -0,0 +1,18 @@ +TARGETNAME = libusb0 +TARGETPATH = output +TARGETTYPE = DYNLINK +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /Dwcsicmp=_wcsicmp /Dstricmp=_stricmp /DTARGETTYPE=DYNLINK /DLOG_APPNAME="\"$(TARGETNAME)-dll\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib + +INCLUDES=$(INCLUDES);$(DDK_INC_PATH); + +SOURCES = windows.c usb.c error.c install.c descriptors.c registry.c \ + resource.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_drv b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_drv new file mode 100644 index 0000000..160268c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_drv @@ -0,0 +1,36 @@ +TARGETNAME = libusb0 +TARGETPATH = output +TARGETTYPE = DRIVER +USER_C_FLAGS = /O2 + +C_DEFINES = $(COMMON_C_DEFINES) /DTARGETTYPE=DRIVER /DLOG_APPNAME="\"$(TARGETNAME)-sys\"" + +TARGETLIBS = $(DDK_LIB_PATH)\usbd.lib + +SOURCES = abort_endpoint.c \ +claim_interface.c \ +clear_feature.c \ +dispatch.c \ +driver_registry.c \ +get_configuration.c \ +get_descriptor.c \ +get_interface.c \ +get_status.c \ +ioctl.c \ +libusb_driver.c \ +pnp.c \ +power.c \ +release_interface.c \ +reset_device.c \ +reset_endpoint.c \ +set_configuration.c \ +set_descriptor.c \ +set_feature.c \ +set_interface.c \ +transfer.c \ +vendor_request.c \ +error.c \ +libusb_driver_rc.rc + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_inf_wizard b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_inf_wizard new file mode 100644 index 0000000..f19173a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_inf_wizard @@ -0,0 +1,20 @@ +TARGETNAME = inf-wizard +TARGETPATH = output +TARGETTYPE = PROGRAM +UMTYPE = windows +UMENTRY = winmain +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /Dstricmp=_stricmp /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\comdlg32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\ole32.lib \ + libwdi.lib + +SOURCES = inf_wizard.c inf_wizard_rc.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter new file mode 100644 index 0000000..7a09183 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter @@ -0,0 +1,18 @@ +TARGETNAME = install-filter +TARGETPATH = output +TARGETTYPE = PROGRAM +UMTYPE = console +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /DLOG_STYLE_SHORT /DTARGETTYPE=PROGRAMconsole /DLOG_APPNAME="\"$(TARGETNAME)\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\gdi32.lib + +INCLUDES=$(INCLUDES);$(DDK_INC_PATH); + +SOURCES = install_filter.c install.c registry.c error.c install_filter_rc.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter_win b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter_win new file mode 100644 index 0000000..7326931 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_install_filter_win @@ -0,0 +1,22 @@ +TARGETNAME = install-filter-win +TARGETPATH = output +TARGETTYPE = PROGRAM +UMTYPE = windows +UMENTRY = winmain +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /Dstricmp=_stricmp /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\comctl32.lib \ + $(SDK_LIB_PATH)\comdlg32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\ole32.lib + +INCLUDES=$(INCLUDES);$(DDK_INC_PATH); + +SOURCES = install_filter_win.c install.c registry.c error.c install_filter_win_rc.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test new file mode 100644 index 0000000..a991e1e --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test @@ -0,0 +1,17 @@ +TARGETNAME = testlibusb +TARGETPATH = output +TARGETTYPE = PROGRAM +UMTYPE = console +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /Dsnprintf=_snprintf /DTARGETTYPE=PROGRAMconsole \ + /DLOG_APPNAME="\"$(TARGETNAME)\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + libusb.lib + +SOURCES = testlibusb.c diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test_win b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test_win new file mode 100644 index 0000000..d60a436 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/sources_test_win @@ -0,0 +1,17 @@ +TARGETNAME = testlibusb-win +TARGETPATH = output +TARGETTYPE = PROGRAM +UMTYPE = windows +UMENTRY = winmain +USE_MSVCRT = 1 +386_STDCALL = 0 +USER_C_FLAGS = /Gd /O2 +C_DEFINES = $(COMMON_C_DEFINES) /Dvsnprintf=_vsnprintf /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\"" + +TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + libusb.lib + +SOURCES = testlibusb_win.c testlibusb_win_rc.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.am b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.am new file mode 100644 index 0000000..6ba0c74 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.am @@ -0,0 +1,31 @@ +sgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml + +# For when we have a man page :) +man_MANS = + +EXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \ + intro.sgml website.dsl $(man_MANS) + +# I grabbed this same hack from the VACM docs/Makfile.am +CLEANFILES = manual.dvi manual.aux manual.tex manual.log \ + manual.ps.gz; rm -rf html + +if BUILD_DOCS +#MANUALS = manual.ps.gz html/index.html +MANUALS = html/index.html +# Generating postscript takes forever on my laptop apparentely +else +MANUALS = +endif + +all: $(MANUALS) + +manual.ps.gz: $(sgml_files) website.dsl + @JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml + gzip manual.ps + +html/index.html: $(sgml_files) website.dsl + rm -rf html + mkdir html + @JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.in new file mode 100644 index 0000000..de57f27 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/Makefile.in @@ -0,0 +1,236 @@ +# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +BIGENDIAN = @BIGENDIAN@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +EXEEXT = @EXEEXT@ +JADE = @JADE@ +LIBTOOL = @LIBTOOL@ +LIBUSB_BINARY_AGE = @LIBUSB_BINARY_AGE@ +LIBUSB_INTERFACE_AGE = @LIBUSB_INTERFACE_AGE@ +LIBUSB_MAJOR_VERSION = @LIBUSB_MAJOR_VERSION@ +LIBUSB_MICRO_VERSION = @LIBUSB_MICRO_VERSION@ +LIBUSB_MINOR_VERSION = @LIBUSB_MINOR_VERSION@ +LIBUSB_VERSION = @LIBUSB_VERSION@ +LN_S = @LN_S@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ + +sgml_files = manual.sgml intro.sgml api.sgml functions.sgml examples.sgml +# For when we have a man page :) +man_MANS = +EXTRA_DIST = manual.sgml api.sgml examples.sgml functions.sgml \ +# I grabbed this same hack from the VACM docs/Makfile.am +CLEANFILES = manual.dvi manual.aux manual.tex manual.log \ +MANUALS = +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = doc + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-man +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-man +uninstall: uninstall-am +all-am: Makefile $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: install-man uninstall-man tags distdir info-am info dvi-am dvi \ +check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + + + intro.sgml website.dsl $(man_MANS) + + manual.ps.gz; rm -rf html + +if BUILD_DOCS +# Generating postscript takes forever on my laptop apparentely +else +endif + +all: $(MANUALS) + +manual.ps.gz: $(sgml_files) website.dsl + @JADE@ -t ps -d $(srcdir)/website.dsl\#print $(srcdir)/manual.sgml + gzip manual.ps + +html/index.html: $(sgml_files) website.dsl + rm -rf html + mkdir html + @JADE@ -t sgml -d $(srcdir)/website.dsl\#html $(srcdir)/manual.sgml + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/api.sgml b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/api.sgml new file mode 100644 index 0000000..1b689b2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/api.sgml @@ -0,0 +1,38 @@ + + + API + + This is the external API for applications to use. + The API is relatively lean and designed to have close analogies to the USB specification. The v0.1 API was mostly hacked together and kludged together without much forethought and as a result, it's missing quite a few features. v1.0 is intended to rectify this. + + + + Devices and interfaces + + The libusb API ties an open device to a specific interface. This means that if you want to claim multiple interfaces on a device, you should open the device multiple times to receive one usb_dev_handle for each interface you want to communicate with. Don't forget to call . + + + + Timeouts + + Timeout's in libusb are always specified in milliseconds. + + + + Data Types + + libusb uses both abstracted and non abstracted structures to maintain portability. + + + + Synchronous + + All functions in libusb v0.1 are synchronous, meaning the functions block and wait for the operation to finish or timeout before returning execution to the calling application. Asynchronous operation will be supported in v1.0, but not v0.1. + + + + Return values + + There are two types of return values used in libusb v0.1. The first is a handle returned by . The second is an int. In all cases where an int is returned, >= 0 is a success and < 0 is an error condition. + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/examples.sgml b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/examples.sgml new file mode 100644 index 0000000..f86138a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/examples.sgml @@ -0,0 +1,71 @@ + Examples + + There are some nonintuitive parts of libusb v0.1 that aren't difficult, but are probably easier to understand with some examples. + + + + Basic Examples + Before any communication can occur with a device, it needs to be found. This is accomplished by finding all of the busses and then finding all of the devices on all of the busses: + + + + After this, the application should manually loop through all of the busess and all of the devices and matching the device by whatever criteria is needed: + +next) { + struct usb_device *dev; + + for (dev = bus->devices; dev; dev = dev->next) { + /* Check if this device is a printer */ + if (dev->descriptor.bDeviceClass == 7) { + /* Open the device, claim the interface and do your processing */ + ... + } + + /* Loop through all of the configurations */ + for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { + /* Loop through all of the interfaces */ + for (i = 0; i < dev->config[c].bNumInterfaces; i++) { + /* Loop through all of the alternate settings */ + for (a = 0; a < dev->config[c].interface[i].num_altsetting; a++) { + /* Check if this interface is a printer */ + if (dev->config[c].interface[i].altsetting[a].bInterfaceClass == 7) { + /* Open the device, set the alternate setting, claim the interface and do your processing */ + ... + } + } + } + } + } + } +]]> + + + + + Examples in the source distribution + The tests directory has a program called testlibusb.c. It simply calls libusb to find all of the devices, then iterates through all of the devices and prints out the descriptor dump. It's very simple and as a result, it's of limited usefulness in itself. However, it could serve as a starting point for a new program. + + + + Other Applications + Another source of examples can be obtained from other applications. + + gPhoto uses libusb to communicate with digital still cameras. + rio500 utils uses libusb to communicate with SONICblue Rio 500 Digital Audio Player. + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/functions.sgml b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/functions.sgml new file mode 100644 index 0000000..61cb9d4 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/functions.sgml @@ -0,0 +1,540 @@ + Functions + + + Core + + + These functions comprise the core of libusb. They are used by all applications that utilize libusb. + + + + + usb_init + Initialize libusb + + + Description + + + void usb_init + + + + Just like the name implies, usb_init sets up some internal structures. usb_init must be called before any other libusb functions. + + + + + + usb_find_busses + Finds all USB busses on system + + + Description + + + int usb_find_busses + + + + usb_find_busses will find all of the busses on the system. Returns the number of changes since previous call to this function (total of new busses and busses removed). + + + + + + usb_find_devices + Find all devices on all USB devices + + + Description + + + int usb_find_devices + + + + usb_find_devices will find all of the devices on each bus. This should be called after . Returns the number of changes since the previous call to this function (total of new device and devices removed). + + + + + + usb_get_busses + Return the list of USB busses found + + + Description + + + struct usb_bus *usb_get_busses + + + + usb_get_busses simply returns the value of the global variable usb_busses. This was implemented for those languages that support C calling convention and can use shared libraries, but don't support C global variables (like Delphi). + + + + + + Device operations + + This group of functions deal with the device. It allows you to open and close the device as well standard USB operations like setting the configuration, alternate settings, clearing halts and resetting the device. It also provides OS level operations such as claiming and releasing interfaces. + + + + + usb_open + Opens a USB device + + + Description + + + usb_dev_handle *usb_open + struct *usb_device dev + + + usb_open is to be used to open up a device for use. usb_open must be called before attempting to perform any operations to the device. Returns a handle used in future communication with the device. + + + + + + usb_close + Closes a USB device + + + Description + + + int usb_close + usb_dev_handle *dev + + + usb_close closes a device opened with . No further operations may be performed on the handle after usb_close is called. Returns 0 on success or < 0 on error. + + + + + + usb_set_configuration + Sets the active configuration of a device + + + Description + + + int usb_set_configuration + usb_dev_handle *dev + int configuration + + + usb_set_configuration sets the active configuration of a device. The configuration parameter is the value as specified in the descriptor field bConfigurationValue. Returns 0 on success or < 0 on error. + + + + + + usb_set_altinterface + Sets the active alternate setting of the current interface + + + Description + + + int usb_set_altinterface + usb_dev_handle *dev + int alternate + + + usb_set_altinterface sets the active alternate setting of the current interface. The alternate parameter is the value as specified in the descriptor field bAlternateSetting. Returns 0 on success or < 0 on error. + + + + + + usb_resetep + Resets state for an endpoint + + + Description + + + int usb_resetep + usb_dev_handle *dev + unsigned int ep + + + usb_resetep resets all state (like toggles) for the specified endpoint. The ep parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or < 0 on error. + + Deprecated + usb_resetep is deprecated. You probably want to use . + + + + + + + usb_clear_halt + Clears any halt status on an endpoint + + + Description + + + int usb_clear_halt + usb_dev_handle *dev + unsigned int ep + + + usb_clear_halt clears any halt status on the specified endpoint. The ep parameter is the value specified in the descriptor field bEndpointAddress. Returns 0 on success or < 0 on error. + + + + + + usb_reset + Resets a device + + + Description + + + int usb_reset + usb_dev_handle *dev + + + usb_reset resets the specified device by sending a RESET down the port it is connected to. Returns 0 on success or < 0 on error. + + Causes re-enumeration + After calling usb_reset, the device will need to re-enumerate and thusly, requires you to find the new device and open a new handle. The handle used to call usb_reset will no longer work. + + + + + + + usb_claim_interface + Claim an interface of a device + + + Description + + + int usb_claim_interface + usb_dev_handle *dev + int interface + + + usb_claim_interface claims the interface with the Operating System. The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or < 0 on error. + + Must be called! + usb_claim_interface must be called before you perform any operations related to this interface (like , , etc). + + + + Return Codes + + + + code + description + + + + + -EBUSY + Interface is not available to be claimed + + + -ENOMEM + Insufficient memory + + + +
+
+
+ + + + usb_release_interface + Releases a previously claimed interface + + + Description + + + int usb_release_interface + usb_dev_handle *dev + int interface + + + usb_release_interface releases an interface previously claimed with . The interface parameter is the value as specified in the descriptor field bInterfaceNumber. Returns 0 on success or < 0 on error. + + +
+ + + Control Transfers + + This group of functions allow applications to send messages to the default control pipe. + + + + + usb_control_msg + Send a control message to a device + + + Description + + + int usb_control_msg + usb_dev_handle *dev + int requesttype + int request + int value + int index + char *bytes + int size + int timeout + + + usb_control_msg performs a control request to the default control pipe on a device. The parameters mirror the types of the same name in the USB specification. Returns number of bytes written/read or < 0 on error. + + + + + + usb_get_string + Retrieves a string descriptor from a device + + + Description + + + int usb_get_string + usb_dev_handle *dev + int index + int langid + char *buf + size_t buflen + + + usb_get_string retrieves the string descriptor specified by index and langid from a device. The string will be returned in Unicode as specified by the USB specification. Returns the number of bytes returned in buf or < 0 on error. + + + + + + usb_get_string_simple + Retrieves a string descriptor from a device using the first language + + + Description + + + int usb_get_string_simple + usb_dev_handle *dev + int index + char *buf + size_t buflen + + + usb_get_string_simple is a wrapper around usb_get_string that retrieves the string description specified by index in the first language for the descriptor and converts it into C style ASCII. Returns number of bytes returned in buf or < 0 on error. + + + + + + usb_get_descriptor + Retrieves a descriptor from a device's default control pipe + + + Description + + + int usb_get_descriptor + usb_dev_handle *dev + unsigned char type + unsigned char index + void *buf + int size + + + usb_get_descriptor retrieves a descriptor from the device identified by the type and index of the descriptor from the default control pipe. Returns number of bytes read for the descriptor or < 0 on error. + See for a function that allows the control endpoint to be specified. + + + + + + usb_get_descriptor_by_endpoint + Retrieves a descriptor from a device + + + Description + + + int usb_get_descriptor_by_endpoint + usb_dev_handle *dev + int ep + unsigned char type + unsigned char index + void *buf + int size + + + usb_get_descriptor_by_endpoint retrieves a descriptor from the device identified by the type and index of the descriptor from the control pipe identified by ep. Returns number of bytes read for the descriptor or < 0 on error. + + + + + + Bulk Transfers + + This group of functions allow applications to send and receive data via bulk pipes. + + + + + usb_bulk_write + Write data to a bulk endpoint + + + Description + + + int usb_bulk_write + usb_dev_handle *dev + int ep + char *bytes + int size + int timeout + + + usb_bulk_write performs a bulk write request to the endpoint specified by ep. Returns number of bytes written on success or < 0 on error. + + + + + + usb_bulk_read + Read data from a bulk endpoint + + + Description + + + int usb_bulk_read + usb_dev_handle *dev + int ep + char *bytes + int size + int timeout + + + usb_bulk_read performs a bulk read request to the endpoint specified by ep. Returns number of bytes read on success or < 0 on error. + + + + + + Interrupt Transfers + + This group of functions allow applications to send and receive data via interrupt pipes. + + + + + usb_interrupt_write + Write data to an interrupt endpoint + + + Description + + + int usb_interrupt_write + usb_dev_handle *dev + int ep + char *bytes + int size + int timeout + + + usb_interrupt_write performs an interrupt write request to the endpoint specified by ep. Returns number of bytes written on success or < 0 on error. + + + + + + usb_interrupt_read + Read data from a interrupt endpoint + + + Description + + + int usb_interrupt_read + usb_dev_handle *dev + int ep + char *bytes + int size + int timeout + + + usb_interrupt_read performs a interrupt read request to the endpoint specified by ep. Returns number of bytes read on success or < 0 on error. + + + + + + Non Portable + + These functions are non portable. They may expose some part of the USB API on one OS or perhaps a couple, but not all. They are all marked with the string _np at the end of the function name. + A C preprocessor macro will be defined if the function is implemented. The form is LIBUSB_HAS_ prepended to the function name, without the leading "usb_", in all caps. For example, if usb_get_driver_np is implemented, LIBUSB_HAS_GET_DRIVER_NP will be defined. + + + + + usb_get_driver_np + Get driver name bound to interface + + + Description + + + int usb_get_driver_np + usb_dev_handle *dev + int interface + char *name + int namelen + + + This function will obtain the name of the driver bound to the interface specified by the parameter interface and place it into the buffer named name limited to namelen characters. Returns 0 on success or < 0 on error. + Implemented on Linux only. + + + + + + usb_detach_kernel_driver_np + Detach kernel driver from interface + + + Description + + + int usb_detach_kernel_driver_np + usb_dev_handle *dev + int interface + + + This function will detach a kernel driver from the interface specified by parameter interface. Applications using libusb can then try claiming the interface. Returns 0 on success or < 0 on error. + Implemented on Linux only. + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/intro.sgml b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/intro.sgml new file mode 100644 index 0000000..c712777 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/intro.sgml @@ -0,0 +1,17 @@ + Introduction + + Overview + This documentation will give an overview of how the v0.1 libusb API works and relates to &usb;. Work is rapidly progressing on a newer version of libusb, to be v1.0, which will be a redesigned API and is intended to obsolete v0.1. You may want to check the libusb website to see if it is stable and recommended. + This documentation assumes that you have a good understanding of &usb; and how it works. If you don't have a good understanding of USB, it is recommended you obtain the USB v1.1 and/or v2.0 specs and read them. + libusb is geared towards &usb; 1.1, however from the perspective of libusb, &usb; 2.0 won't be a significant change for libusb + + + + Current OS support + + Linux (2.2, 2.4 and on) + FreeBSD, NetBSD and OpenBSD + Darwin/MacOS X + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/manual.sgml b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/manual.sgml new file mode 100644 index 0000000..6f94d51 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/manual.sgml @@ -0,0 +1,75 @@ + + + + + + +USB"> +]> + + + libusb Developers Guide + + + Johannes + Erdfelt + + +
johannes@erdfelt.com
+
+ + + + 0.3 + June 28, 2002 + jerdfelt + More cleanups. Add the rest of the API and clean up some places. Add some examples. Hopefully, this should document the entire 0.1 API now. + + + + 0.2 + June 11, 2002 + jerdfelt + Cleanup, update for all of the changes that have happened in the last couple of months. + + + + 0.1 + August 26, 2001 + jerdfelt + First stab. + + + + + libusb + +
+ + + Preface + + + This document's purpose is to explain the API for libusb and how to use it to make a &usb; aware application + Any suggestions, corrections and comments regarding this document can be sent to the author: Johannes Erdfelt or the libusb developers mailing list. + + + + +&intro; + + + +&api; + + + +&functions; + + + +&examples; + +
diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/website.dsl b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/website.dsl new file mode 100644 index 0000000..2a07c07 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/doc/website.dsl @@ -0,0 +1,197 @@ + +]> + + + + + + + ;; ============================== +;; customize the print stylesheet +;; ============================== + +(declare-characteristic preserve-sdata? + ;; this is necessary because right now jadetex does not understand + ;; symbolic entities, whereas things work well with numeric entities. + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" + #f) + +(define %generate-article-toc% + ;; Should a Table of Contents be produced for Articles? + #t) + +(define (toc-depth nd) + 2) + +(define %generate-article-titlepage-on-separate-page% + ;; Should the article title page be on a separate page? + #t) + +(define %section-autolabel% + ;; Are sections enumerated? + #t) + +(define %footnote-ulinks% + ;; Generate footnotes for ULinks? + #f) + +(define %bop-footnotes% + ;; Make "bottom-of-page" footnotes? + #f) + +(define %body-start-indent% + ;; Default indent of body text + 0pi) + +(define %para-indent-firstpara% + ;; First line start-indent for the first paragraph + 0pt) + +(define %para-indent% + ;; First line start-indent for paragraphs (other than the first) + 0pt) + +(define %block-start-indent% + ;; Extra start-indent for block-elements + 0pt) + +(define formal-object-float + ;; Do formal objects float? + #t) + +(define %hyphenation% + ;; Allow automatic hyphenation? + #t) + +(define %admon-graphics% + ;; Use graphics in admonitions? + #f) + + + + + + + + + + + + +;; ========================= +;; Indexes + +;; Returns the depth of the auto-generated TOC (table of contents) that +;; should be made at the nd-level +(define (toc-depth nd) + (if (string=? (gi nd) "book") + 2 ; the depth of the top-level TOC + 2 ; the depth of all other TOCs + )) + +(define %page-n-columns% + ;; Sets the number of columns on each page + 2) + +(define %generate-article-toc% + #t) + + +(define %header-navigation% + #t) + +(define %footer-navigation% + #t) + +(define %gentext-nav-use-tables% + #t) + +(define %gentext-nav-tblwidth% + "100%") + + +(define %indent-programlisting-lines% + " ") + +(define %indent-screen-lines% + " ") + +(define %shade-verbatim% + #t) + +(define ($shade-verbatim-attr$) + (list + (list "BORDER" "0") + (list "BGCOLOR" "#E0E0E0") + (list "WIDTH" ($table-width$)))) + +(define %callout-default-col% + 70) + +(define biblio-number + #t) + +(define %graphic-default-extension% + "jpg") + +(define %graphic-extensions% + '("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf")) + +(define %stylesheet% + "/base.css") + +(define %stylesheet-type% + "text/css") + +(define %use-id-as-filename% + #t) + +(define use-output-dir + #t) + +(define %output-dir% + "html") + +(define %html-ext% + ".html") + +(define %root-filename% + "index") + +(define %html-use-lang-in-filename% + #f) + +(define %html40% + #t) + +(define %fix-para-wrappers% + #t) + +(define %section-autolabel% + #t) + +(define (chunk-skip-first-element-list) + '()) + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/BenchmarkHelp.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/BenchmarkHelp.txt new file mode 100644 index 0000000..5ee02c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/BenchmarkHelp.txt @@ -0,0 +1,68 @@ + +USAGE: benchmark [list] + [pid=] [vid=] [ep=] [intf=] [altf=] + [read|write|loop] [notestselect] + [verify|verifydetail] + [retry=] [timeout=] [refresh=] [priority=] + [mode=] [buffersize=] [buffercount=] [packetsize=] + +Commands: + list : Display a list of connected devices before starting. + Select the device to use for the test from the list. + read : Read from the device. + write : Write to the device. + loop : [Default] Read and write to the device at the same time. + + notestselect : Skips submitting the control transfers to get/set the + test type. This makes the application compatible + with non-benchmark firmwared. Use at your own risk! + + verify : Verify received data for loop and read tests. Report + basic information on data validation errors. + verifydetail : Same as verify except reports detail information for + each byte that fails validation. + +Switches: + vid : Vendor id of device. (hex) (Default=0x0666) + pid : Product id of device. (hex) (Default=0x0001) + retry : Number of times to retry a transfer that timeout. + (Default = 0) + timeout : Transfer timeout value. (milliseconds) (Default=5000) + The timeout value used for read/write operations. If a + transfer times out more than {retry} times, the test + fails and the operation is aborted. + mode : Sync|Async (Default=Sync) + Sync uses the libusb-win32 sync transfer functions. + Async uses the libusb-win32 asynchronous api. + buffersize : Transfer test size in bytes. (Default=4096) + Increasing this value will generally yield higher + transfer rates. + buffercount: (Async mode only) Number of outstanding transfers on + an endpoint (Default=1, Max=10). Increasing this value + will generally yield higher transfer rates. + refresh : The display refresh interval. (in milliseconds) + (Default=1000) This also effect the running status. + priority : AboveNormal|BelowNormal|Highest|Lowest|Normal + (Default=Normal) The thread priority level to use + for the test. + ep : The loopback endpoint to use. For example ep=0x01, would + read from 0x81 and write to 0x01. (default is to use the + (first read/write endpoint(s) in the interface) + intf : The interface id the read/write endpoints reside in. + intf : The alt interface id the read/write endpoints reside in. + packetsize : For isochronous use only. Sets the iso packet size. + If not specified, the endpoints maximum packet size + is used. +WARNING: + This program should only be used with USB devices which implement + one more more "Benchmark" interface(s). Using this application + with a USB device it was not designed for can result in permanent + damage to the device. + +Examples: + +benchmark vid=0x0666 pid=0x0001 +benchmark vid=0x4D2 pid=0x162E +benchmark vid=0x4D2 pid=0x162E buffersize=65536 +benchmark read vid=0x4D2 pid=0x162E +benchmark vid=0x4D2 pid=0x162E buffercount=3 buffersize=0x2000 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark.c new file mode 100644 index 0000000..a625150 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark.c @@ -0,0 +1,1620 @@ +/* USB Benchmark for libusb-win32 + + Copyright 2010 Travis Robinson. + website: http://sourceforge.net/projects/libusb-win32 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, please visit www.gnu.org. +*/ + +#include +#include +#include +#include + +#include "usb.h" + +#define _BENCHMARK_VER_ONLY +#include "benchmark_rc.rc" + +#define MAX_OUTSTANDING_TRANSFERS 10 + +// This is used only in VerifyData() for display information +// about data validation mismatches. +#define CONVDAT(format,...) printf("[data-mismatch] " format,__VA_ARGS__) + +// All output is directed through these macros. +// +#define LOG(LogTypeString,format,...) printf("%s[" __FUNCTION__ "] "format, LogTypeString, __VA_ARGS__) +#define CONERR(format,...) LOG("Error:",format,__VA_ARGS__) +#define CONMSG(format,...) LOG("",format,__VA_ARGS__) +#define CONWRN(format,...) LOG("Warn:",format,__VA_ARGS__) +#define CONDBG(format,...) LOG("",format,__VA_ARGS__) + +#define CONERR0(message) CONERR("%s", message) +#define CONMSG0(message) CONMSG("%s", message) +#define CONWRN0(message) CONWRN("%s", message) +#define CONDBG0(message) CONDBG("%s", message) + +// This is the libusb-win32 return code for a transfer that timed out. +#define TRANSFER_TIMEDOUT -116 + +// Custom vendor requests that must be implemented in the benchmark firmware. +// Test selection can be bypassed with the "notestselect" argument. +// +enum BENCHMARK_DEVICE_COMMANDS +{ + SET_TEST = 0x0E, + GET_TEST = 0x0F, +}; + +// Tests supported by the official benchmark firmware. +// +enum BENCHMARK_DEVICE_TEST_TYPE +{ + TestTypeNone = 0x00, + TestTypeRead = 0x01, + TestTypeWrite = 0x02, + TestTypeLoop = TestTypeRead|TestTypeWrite, +}; + +// This software was mainly created for testing the libusb-win32 kernel & user driver. +enum BENCHMARK_TRANSFER_MODE +{ + // Tests for the libusb-win32 sync transfer function. + TRANSFER_MODE_SYNC, + + // Test for async function, iso transfers, and queued transfers + TRANSFER_MODE_ASYNC, +}; + +// Holds all of the information about a test. +struct BENCHMARK_TEST_PARAM +{ + // User configurable value set from the command line. + // + INT Vid; // Vendor ID + INT Pid; // Porduct ID + INT Intf; // Interface number + INT Altf; // Alt Interface number + INT Ep; // Endpoint number (1-15) + INT Refresh; // Refresh interval (ms) + INT Timeout; // Transfer timeout (ms) + INT Retry; // Number for times to retry a timed out transfer before aborting + INT BufferSize; // Number of bytes to transfer + INT BufferCount; // Number of outstanding asynchronous transfers + BOOL NoTestSelect; // If true, don't send control message to select the test type. + BOOL UseList; // Show the user a device list and let them choose a benchmark device. + INT IsoPacketSize; // Isochronous packet size (defaults to the endpoints max packet size) + INT Priority; // Priority to run this thread at. + BOOL Verify; // Only for loop and read test. If true, verifies data integrity. + BOOL VerifyDetails; // If true, prints detailed information for each invalid byte. + enum BENCHMARK_DEVICE_TEST_TYPE TestType; // The benchmark test type. + enum BENCHMARK_TRANSFER_MODE TransferMode; // Sync or Async + + // Internal value use during the test. + // + usb_dev_handle* DeviceHandle; + struct usb_device* Device; + BOOL IsCancelled; + BOOL IsUserAborted; + + BYTE* VerifyBuffer; // Stores the verify test pattern for 1 packet. + WORD VerifyBufferSize; // Size of VerifyBuffer +}; + +// The benchmark transfer context used for asynchronous transfers. see TransferAsync(). +struct BENCHMARK_TRANSFER_HANDLE +{ + VOID* Context; + BOOL InUse; + CHAR* Data; + INT DataMaxLength; + INT ReturnCode; +}; + +// Holds all of the information about a transfer. +struct BENCHMARK_TRANSFER_PARAM +{ + struct BENCHMARK_TEST_PARAM* Test; + + HANDLE ThreadHandle; + DWORD ThreadID; + struct usb_endpoint_descriptor Ep; + INT IsoPacketSize; + BOOL IsRunning; + + LONGLONG TotalTransferred; + LONG LastTransferred; + + LONG Packets; + DWORD StartTick; + DWORD LastTick; + DWORD LastStartTick; + + INT TotalTimeoutCount; + INT RunningTimeoutCount; + + INT TotalErrorCount; + INT RunningErrorCount; + + INT ShortTransferCount; + + INT TransferHandleNextIndex; + INT TransferHandleWaitIndex; + INT OutstandingTransferCount; + + struct BENCHMARK_TRANSFER_HANDLE TransferHandles[MAX_OUTSTANDING_TRANSFERS]; + + // Placeholder for end of structure; this is where the raw data for the + // transfer buffer is allocated. + // + BYTE Buffer[0]; +}; + +// Benchmark device api. +struct usb_dev_handle* Bench_Open(WORD vid, WORD pid, INT interfaceNumber, INT altInterfaceNumber, struct usb_device** deviceForHandle); +int Bench_SetTestType(struct usb_dev_handle* dev, enum BENCHMARK_DEVICE_TEST_TYPE testType, int intf); +int Bench_GetTestType(struct usb_dev_handle* dev, enum BENCHMARK_DEVICE_TEST_TYPE* testType, int intf); + +// Critical section for running status. +CRITICAL_SECTION DisplayCriticalSection; + +// Finds the interface for [interface_number] in a libusb-win32 config descriptor. +// If first_interface is not NULL, it is set to the first interface in the config. +// +struct usb_interface_descriptor* usb_find_interface(struct usb_config_descriptor* config_descriptor, + INT interface_number, + INT alt_interface_number, + struct usb_interface_descriptor** first_interface); + +// Internal function used by the benchmark application. +void ShowHelp(void); +void ShowCopyright(void); +void SetTestDefaults(struct BENCHMARK_TEST_PARAM* test); +char* GetParamStrValue(const char* src, const char* paramName); +BOOL GetParamIntValue(const char* src, const char* paramName, INT* returnValue); +int ValidateBenchmarkArgs(struct BENCHMARK_TEST_PARAM* testParam); +int ParseBenchmarkArgs(struct BENCHMARK_TEST_PARAM* testParams, int argc, char **argv); +void FreeTransferParam(struct BENCHMARK_TRANSFER_PARAM** testTransferRef); +struct BENCHMARK_TRANSFER_PARAM* CreateTransferParam(struct BENCHMARK_TEST_PARAM* test, int endpointID); +void GetAverageBytesSec(struct BENCHMARK_TRANSFER_PARAM* transferParam, DOUBLE* bps); +void GetCurrentBytesSec(struct BENCHMARK_TRANSFER_PARAM* transferParam, DOUBLE* bps); +void ShowRunningStatus(struct BENCHMARK_TRANSFER_PARAM* transferParam); +void ShowTestInfo(struct BENCHMARK_TEST_PARAM* testParam); +void ShowTransferInfo(struct BENCHMARK_TRANSFER_PARAM* transferParam); + +void WaitForTestTransfer(struct BENCHMARK_TRANSFER_PARAM* transferParam); +void ResetRunningStatus(struct BENCHMARK_TRANSFER_PARAM* transferParam); + +// The thread transfer routine. +DWORD TransferThreadProc(struct BENCHMARK_TRANSFER_PARAM* transferParams); + +#define TRANSFER_DISPLAY(TransferParam, ReadingString, WritingString) \ + ((TransferParam->Ep.bEndpointAddress & USB_ENDPOINT_DIR_MASK) ? ReadingString : WritingString) + +#define INC_ROLL(IncField, RollOverValue) if ((++IncField) >= RollOverValue) IncField = 0 + +#define ENDPOINT_TYPE(TransferParam) (TransferParam->Ep.bmAttributes & 3) +const char* TestDisplayString[] = {"None", "Read", "Write", "Loop", NULL}; +const char* EndpointTypeDisplayString[] = {"Control", "Isochronous", "Bulk", "Interrupt", NULL}; + +void SetTestDefaults(struct BENCHMARK_TEST_PARAM* test) +{ + memset(test,0,sizeof(struct BENCHMARK_TEST_PARAM)); + + test->Ep = 0x00; + test->Vid = 0x0666; + test->Pid = 0x0001; + test->Refresh = 1000; + test->Timeout = 5000; + test->TestType = TestTypeLoop; + test->BufferSize = 4096; + test->BufferCount = 1; + test->Priority = THREAD_PRIORITY_NORMAL; +} + +struct usb_interface_descriptor* usb_find_interface(struct usb_config_descriptor* config_descriptor, + INT interface_number, + INT alt_interface_number, + struct usb_interface_descriptor** first_interface) +{ + struct usb_interface_descriptor* intf; + int intfIndex; + + if (first_interface) + *first_interface = NULL; + + if (!config_descriptor) return NULL; + + for (intfIndex = 0; intfIndex < config_descriptor->bNumInterfaces; intfIndex++) + { + if (config_descriptor->interface[intfIndex].num_altsetting) + { + intf = &config_descriptor->interface[intfIndex].altsetting[0]; + if ((first_interface) && *first_interface == NULL) + *first_interface = intf; + + if (intf->bInterfaceNumber == interface_number && + (alt_interface_number==-1 || intf->bAlternateSetting==alt_interface_number)) + { + return intf; + } + } + } + + return NULL; +} +struct usb_dev_handle* Bench_Open(WORD vid, WORD pid, INT interfaceNumber, INT altInterfaceNumber, struct usb_device** deviceForHandle) +{ + struct usb_bus* bus; + struct usb_device* dev; + struct usb_dev_handle* udev; + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == vid && dev->descriptor.idProduct == pid) + { + if ((udev = usb_open(dev))) + { + if (dev->descriptor.bNumConfigurations) + { + if (usb_find_interface(&dev->config[0], interfaceNumber, altInterfaceNumber, NULL) != NULL) + { + if (deviceForHandle) *deviceForHandle = dev; + return udev; + } + } + + usb_close(udev); + } + } + } + } + return NULL; +} + +int Bench_SetTestType(struct usb_dev_handle* dev, enum BENCHMARK_DEVICE_TEST_TYPE testType, int intf) +{ + char buffer[1]; + int ret = 0; + + ret = usb_control_msg(dev, + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + SET_TEST, testType, intf, + buffer, 1, + 1000); + return ret; +} + +int Bench_GetTestType(struct usb_dev_handle* dev, enum BENCHMARK_DEVICE_TEST_TYPE* testType, int intf) +{ + char buffer[1]; + int ret = 0; + + ret = usb_control_msg(dev, + USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + GET_TEST, 0, intf, + buffer, 1, + 1000); + + if (ret == 1) + *testType = buffer[0]; + + return ret; +} +enum TRANSFER_VERIFY_STATE +{ + TVS_START, + TVS_KEY, + TVS_DATA, + TVS_FIND_START, + +}; + +INT VerifyData(struct BENCHMARK_TRANSFER_PARAM* transferParam, BYTE* data, INT dataLength) +{ + + WORD verifyDataSize = transferParam->Test->VerifyBufferSize; + BYTE* verifyData = transferParam->Test->VerifyBuffer; + BYTE keyC = 0; + BOOL seedKey = TRUE; + INT dataLeft = dataLength; + INT dataIndex = 0; + INT packetIndex = 0; + INT verifyIndex = 0; + + while(dataLeft > 1) + { + verifyDataSize = dataLeft > transferParam->Test->VerifyBufferSize ? transferParam->Test->VerifyBufferSize : dataLeft; + + if (seedKey) + keyC = data[dataIndex+1]; + else + { + if (data[dataIndex+1]==0) + { + keyC=0; + } + else + { + keyC++; + } + } + seedKey = FALSE; + // Index 0 is always 0. + // The key is always at index 1 + verifyData[1] = keyC; + if (memcmp(&data[dataIndex],verifyData,verifyDataSize) != 0) + { + // Packet verification failed. + + // Reset the key byte on the next packet. + seedKey = TRUE; + + CONVDAT("data mismatch packet-index=%d data-index=%d\n", packetIndex, dataIndex); + + if (transferParam->Test->VerifyDetails) + { + for (verifyIndex=0; verifyIndexEp.bEndpointAddress & USB_ENDPOINT_DIR_MASK) + { + ret = usb_bulk_read( + transferParam->Test->DeviceHandle, transferParam->Ep.bEndpointAddress, + transferParam->Buffer, transferParam->Test->BufferSize, + transferParam->Test->Timeout); + } + else + { + ret = usb_bulk_write( + transferParam->Test->DeviceHandle, transferParam->Ep.bEndpointAddress, + transferParam->Buffer, transferParam->Test->BufferSize, + transferParam->Test->Timeout); + } + + return ret; +} + +int TransferAsync(struct BENCHMARK_TRANSFER_PARAM* transferParam, struct BENCHMARK_TRANSFER_HANDLE** handleRef) +{ + int ret; + struct BENCHMARK_TRANSFER_HANDLE* handle; + + *handleRef = NULL; + + // Submit transfers until the maximum number of outstanding transfer(s) is reached. + while (transferParam->OutstandingTransferCount < transferParam->Test->BufferCount) + { + // Get the next available benchmark transfer handle. + *handleRef = handle = &transferParam->TransferHandles[transferParam->TransferHandleNextIndex]; + + // If a libusb-win32 transfer context hasn't been setup for this benchmark transfer + // handle, do it now. + // + if (!handle->Context) + { + // Data buffer(s) are located at the end of the transfer param. + handle->Data = transferParam->Buffer + (transferParam->TransferHandleNextIndex * transferParam->Test->BufferSize); + handle->DataMaxLength = transferParam->Test->BufferSize; + + + switch (ENDPOINT_TYPE(transferParam)) + { + case USB_ENDPOINT_TYPE_ISOCHRONOUS: + ret = usb_isochronous_setup_async(transferParam->Test->DeviceHandle, + &handle->Context, + transferParam->Ep.bEndpointAddress, + transferParam->IsoPacketSize ? transferParam->IsoPacketSize : transferParam->Ep.wMaxPacketSize); + break; + case USB_ENDPOINT_TYPE_BULK: + ret = usb_bulk_setup_async(transferParam->Test->DeviceHandle, + &handle->Context, + transferParam->Ep.bEndpointAddress); + break; + case USB_ENDPOINT_TYPE_INTERRUPT: + ret = usb_interrupt_setup_async(transferParam->Test->DeviceHandle, + &handle->Context, + transferParam->Ep.bEndpointAddress); + break; + default: + ret = -1; + break; + } + + if (ret < 0) + { + CONERR("failed creating transfer context ret=%d\n",ret); + goto Done; + } + } + + + // Submit this transfer now. + handle->ReturnCode = ret = usb_submit_async(handle->Context, handle->Data, handle->DataMaxLength); + if (ret < 0) goto Done; + + // Mark this handle has InUse. + handle->InUse = TRUE; + + // When transfers ir successfully submitted, OutstandingTransferCount goes up; when + // they are completed it goes down. + // + transferParam->OutstandingTransferCount++; + + // Move TransferHandleNextIndex to the next available transfer. + INC_ROLL(transferParam->TransferHandleNextIndex, transferParam->Test->BufferCount); + + } + + // If the number of outstanding transfers has reached the limit, wait for the + // oldest outstanding transfer to complete. + // + if (transferParam->OutstandingTransferCount == transferParam->Test->BufferCount) + { + // TransferHandleWaitIndex is the index of the oldest outstanding transfer. + *handleRef = handle = &transferParam->TransferHandles[transferParam->TransferHandleWaitIndex]; + + // Only wait, cancelling & freeing is handled by the caller. + handle->ReturnCode = ret = usb_reap_async_nocancel(handle->Context, transferParam->Test->Timeout); + + if (ret < 0) goto Done; + + // Mark this handle has no longer InUse. + handle->InUse = FALSE; + + // When transfers ir successfully submitted, OutstandingTransferCount goes up; when + // they are completed it goes down. + // + transferParam->OutstandingTransferCount--; + + // Move TransferHandleWaitIndex to the oldest outstanding transfer. + INC_ROLL(transferParam->TransferHandleWaitIndex, transferParam->Test->BufferCount); + } + +Done: + return ret; +} + +DWORD TransferThreadProc(struct BENCHMARK_TRANSFER_PARAM* transferParam) +{ + int ret, i; + struct BENCHMARK_TRANSFER_HANDLE* handle; + char* data; + transferParam->IsRunning = TRUE; + + while (!transferParam->Test->IsCancelled) + { + data = NULL; + handle = NULL; + + if (transferParam->Test->TransferMode == TRANSFER_MODE_SYNC) + { + ret = TransferSync(transferParam); + if (ret >= 0) data = transferParam->Buffer; + } + else if (transferParam->Test->TransferMode == TRANSFER_MODE_ASYNC) + { + ret = TransferAsync(transferParam, &handle); + if ((handle) && ret >= 0) data = handle->Data; + } + else + { + CONERR("invalid transfer mode %d\n",transferParam->Test->TransferMode); + goto Done; + } + if (ret < 0) + { + // The user pressed 'Q'. + if (transferParam->Test->IsUserAborted) break; + + // Transfer timed out + if (ret == TRANSFER_TIMEDOUT) + { + transferParam->TotalTimeoutCount++; + transferParam->RunningTimeoutCount++; + CONWRN("Timeout #%d %s on Ep%02Xh..\n", + transferParam->RunningTimeoutCount, + TRANSFER_DISPLAY(transferParam,"reading","writing"), + transferParam->Ep.bEndpointAddress); + + if (transferParam->RunningTimeoutCount > transferParam->Test->Retry) + break; + } + else + { + // An error (other than a timeout) occured. + + // usb_strerror()is not thread safe and should not be used + // in a multi-threaded app. It's used here because + // this is a test program. + // + + transferParam->TotalErrorCount++; + transferParam->RunningErrorCount++; + CONERR("failed %s! %d of %d ret=%d: %s\n", + TRANSFER_DISPLAY(transferParam,"reading","writing"), + transferParam->RunningErrorCount, + transferParam->Test->Retry+1, + ret, + usb_strerror()); + + usb_resetep(transferParam->Test->DeviceHandle, transferParam->Ep.bEndpointAddress); + + if (transferParam->RunningErrorCount > transferParam->Test->Retry) + break; + + } + ret = 0; + } + else + { + if (ret < transferParam->Test->BufferSize && !transferParam->Test->IsCancelled) + { + if (ret > 0) + { + transferParam->ShortTransferCount++; + CONWRN("Short transfer on Ep%02Xh expected %d got %d.\n", + transferParam->Ep.bEndpointAddress, + transferParam->Test->BufferSize, + ret); + } + else + { + CONWRN("Zero-length transfer on Ep%02Xh expected %d.\n", + transferParam->Ep.bEndpointAddress, + transferParam->Test->BufferSize); + + transferParam->TotalErrorCount++; + transferParam->RunningErrorCount++; + if (transferParam->RunningErrorCount > transferParam->Test->Retry) + break; + usb_resetep(transferParam->Test->DeviceHandle, transferParam->Ep.bEndpointAddress); + } + } + else + { + transferParam->RunningErrorCount = 0; + transferParam->RunningTimeoutCount = 0; + } + + if ((transferParam->Test->Verify) && + (transferParam->Ep.bEndpointAddress & USB_ENDPOINT_DIR_MASK)) + { + VerifyData(transferParam, data, ret); + } + } + + EnterCriticalSection(&DisplayCriticalSection); + + if (!transferParam->StartTick && transferParam->Packets >= 0) + { + transferParam->StartTick = GetTickCount(); + transferParam->LastStartTick = transferParam->StartTick; + transferParam->LastTick = transferParam->StartTick; + + transferParam->LastTransferred = 0; + transferParam->TotalTransferred = 0; + transferParam->Packets = 0; + } + else + { + if (!transferParam->LastStartTick) + { + transferParam->LastStartTick = transferParam->LastTick; + transferParam->LastTransferred = 0; + } + transferParam->LastTick = GetTickCount(); + + transferParam->LastTransferred += ret; + transferParam->TotalTransferred += ret; + transferParam->Packets++; + } + + LeaveCriticalSection(&DisplayCriticalSection); + } + +Done: + + for (i=0; i < transferParam->Test->BufferCount; i++) + { + if (transferParam->TransferHandles[i].Context) + { + if (transferParam->TransferHandles[i].InUse) + { + if ((ret = usb_cancel_async(transferParam->TransferHandles[i].Context)) < 0) + if (!transferParam->Test->IsUserAborted) + CONERR("failed cancelling transfer! ret=%d\n",ret); + + transferParam->TransferHandles[i].InUse=FALSE; + } + usb_free_async(&transferParam->TransferHandles[i].Context); + } + } + + transferParam->IsRunning = FALSE; + return 0; +} + +char* GetParamStrValue(const char* src, const char* paramName) +{ + return (strstr(src,paramName)==src) ? (char*)(src+strlen(paramName)) : NULL; +} + +BOOL GetParamIntValue(const char* src, const char* paramName, INT* returnValue) +{ + char* value = GetParamStrValue(src, paramName); + if (value) + { + *returnValue = strtol(value, NULL, 0); + return TRUE; + } + return FALSE; +} + +int ValidateBenchmarkArgs(struct BENCHMARK_TEST_PARAM* testParam) +{ + if (testParam->BufferCount < 1 || testParam->BufferCount > MAX_OUTSTANDING_TRANSFERS) + { + CONERR("Invalid BufferCount argument %d. BufferCount must be greater than 0 and less than or equal to %d.\n", + testParam->BufferCount, MAX_OUTSTANDING_TRANSFERS); + return -1; + } + + return 0; +} + +int ParseBenchmarkArgs(struct BENCHMARK_TEST_PARAM* testParams, int argc, char **argv) +{ +#define GET_INT_VAL + char arg[128]; + char* value; + int iarg; + + for (iarg=1; iarg < argc; iarg++) + { + if (strcpy_s(arg, _countof(arg), argv[iarg])!=ERROR_SUCCESS) + return -1; + + strlwr(arg); + + if (GetParamIntValue(arg, "vid=", &testParams->Vid)) {} + else if (GetParamIntValue(arg, "pid=", &testParams->Pid)) {} + else if (GetParamIntValue(arg, "retry=", &testParams->Retry)) {} + else if (GetParamIntValue(arg, "buffercount=", &testParams->BufferCount)) + { + if (testParams->BufferCount > 1) + testParams->TransferMode = TRANSFER_MODE_ASYNC; + } + else if (GetParamIntValue(arg, "buffersize=", &testParams->BufferSize)) {} + else if (GetParamIntValue(arg, "size=", &testParams->BufferSize)) {} + else if (GetParamIntValue(arg, "timeout=", &testParams->Timeout)) {} + else if (GetParamIntValue(arg, "intf=", &testParams->Intf)) {} + else if (GetParamIntValue(arg, "altf=", &testParams->Altf)) {} + else if (GetParamIntValue(arg, "ep=", &testParams->Ep)) + { + testParams->Ep &= 0xf; + } + else if (GetParamIntValue(arg, "refresh=", &testParams->Refresh)) {} + else if (GetParamIntValue(arg, "isopacketsize=", &testParams->IsoPacketSize)) {} + else if ((value=GetParamStrValue(arg,"mode="))) + { + if (GetParamStrValue(value,"sync")) + { + testParams->TransferMode = TRANSFER_MODE_SYNC; + } + else if (GetParamStrValue(value,"async")) + { + testParams->TransferMode = TRANSFER_MODE_ASYNC; + } + else + { + // Invalid EndpointType argument. + CONERR("invalid transfer mode argument! %s\n",argv[iarg]); + return -1; + + } + } + else if ((value=GetParamStrValue(arg,"priority="))) + { + if (GetParamStrValue(value,"lowest")) + { + testParams->Priority=THREAD_PRIORITY_LOWEST; + } + else if (GetParamStrValue(value,"belownormal")) + { + testParams->Priority=THREAD_PRIORITY_BELOW_NORMAL; + } + else if (GetParamStrValue(value,"normal")) + { + testParams->Priority=THREAD_PRIORITY_NORMAL; + } + else if (GetParamStrValue(value,"abovenormal")) + { + testParams->Priority=THREAD_PRIORITY_ABOVE_NORMAL; + } + else if (GetParamStrValue(value,"highest")) + { + testParams->Priority=THREAD_PRIORITY_HIGHEST; + } + else + { + CONERR("invalid priority argument! %s\n",argv[iarg]); + return -1; + } + } + else if (!stricmp(arg,"notestselect")) + { + testParams->NoTestSelect = TRUE; + } + else if (!stricmp(arg,"read")) + { + testParams->TestType = TestTypeRead; + } + else if (!stricmp(arg,"write")) + { + testParams->TestType = TestTypeWrite; + } + else if (!stricmp(arg,"loop")) + { + testParams->TestType = TestTypeLoop; + } + else if (!stricmp(arg,"list")) + { + testParams->UseList = TRUE; + } + else if (!stricmp(arg,"verifydetails")) + { + testParams->VerifyDetails = TRUE; + testParams->Verify = TRUE; + } + else if (!stricmp(arg,"verify")) + { + testParams->Verify = TRUE; + } + else + { + CONERR("invalid argument! %s\n",argv[iarg]); + return -1; + } + } + return ValidateBenchmarkArgs(testParams); +} + +INT CreateVerifyBuffer(struct BENCHMARK_TEST_PARAM* testParam, WORD endpointMaxPacketSize) +{ + int i; + BYTE indexC = 0; + testParam->VerifyBuffer = malloc(endpointMaxPacketSize); + if (!testParam->VerifyBuffer) + { + CONERR("memory allocation failure at line %d!\n",__LINE__); + return -1; + } + + testParam->VerifyBufferSize = endpointMaxPacketSize; + + for(i=0; i < endpointMaxPacketSize; i++) + { + testParam->VerifyBuffer[i] = indexC++; + if (indexC == 0) indexC = 1; + } + + return 0; +} + +void FreeTransferParam(struct BENCHMARK_TRANSFER_PARAM** testTransferRef) +{ + struct BENCHMARK_TRANSFER_PARAM* pTransferParam; + + if ((!testTransferRef) || !*testTransferRef) return; + pTransferParam = *testTransferRef; + + if (pTransferParam->ThreadHandle) + { + CloseHandle(pTransferParam->ThreadHandle); + pTransferParam->ThreadHandle = NULL; + } + + free(pTransferParam); + + *testTransferRef = NULL; +} + +struct BENCHMARK_TRANSFER_PARAM* CreateTransferParam(struct BENCHMARK_TEST_PARAM* test, int endpointID) +{ + struct BENCHMARK_TRANSFER_PARAM* transferParam; + struct usb_interface_descriptor* testInterface; + int i; + int allocSize = sizeof(struct BENCHMARK_TRANSFER_PARAM)+(test->BufferSize * test->BufferCount); + + transferParam = (struct BENCHMARK_TRANSFER_PARAM*) malloc(allocSize); + + if (transferParam) + { + memset(transferParam, 0, allocSize); + transferParam->Test = test; + if (!(testInterface = usb_find_interface(&test->Device->config[0], test->Intf, test->Altf, NULL))) + { + CONERR("failed locating interface %02Xh!\n", test->Intf); + FreeTransferParam(&transferParam); + goto Done; + } + + for(i=0; i < testInterface->bNumEndpoints; i++) + { + if (!(endpointID & USB_ENDPOINT_ADDRESS_MASK)) + { + // Use first endpoint that matches the direction + if ((testInterface->endpoint[i].bEndpointAddress & USB_ENDPOINT_DIR_MASK) == endpointID) + { + memcpy(&transferParam->Ep, &testInterface->endpoint[i],sizeof(struct usb_endpoint_descriptor)); + break; + } + } + else + { + if ((int)testInterface->endpoint[i].bEndpointAddress == endpointID) + { + memcpy(&transferParam->Ep, &testInterface->endpoint[i],sizeof(struct usb_endpoint_descriptor)); + break; + } + } + } + if (!transferParam->Ep.bEndpointAddress) + { + CONERR("failed locating EP%02Xh!\n", endpointID); + FreeTransferParam(&transferParam); + goto Done; + } + + if (transferParam->Test->BufferSize % transferParam->Ep.wMaxPacketSize) + { + CONERR("buffer size %d is not an interval of EP%02Xh maximum packet size of %d!\n", + transferParam->Test->BufferSize, + transferParam->Ep.bEndpointAddress, + transferParam->Ep.wMaxPacketSize); + + FreeTransferParam(&transferParam); + goto Done; + } + + if (test->IsoPacketSize) + transferParam->IsoPacketSize = test->IsoPacketSize; + else + transferParam->IsoPacketSize = transferParam->Ep.wMaxPacketSize; + + if (ENDPOINT_TYPE(transferParam) == USB_ENDPOINT_TYPE_ISOCHRONOUS) + transferParam->Test->TransferMode = TRANSFER_MODE_ASYNC; + + ResetRunningStatus(transferParam); + + transferParam->ThreadHandle = CreateThread( + NULL, + 0, + (LPTHREAD_START_ROUTINE)TransferThreadProc, + transferParam, + CREATE_SUSPENDED, + &transferParam->ThreadID); + + if (!transferParam->ThreadHandle) + { + CONERR0("failed creating thread!\n"); + FreeTransferParam(&transferParam); + goto Done; + } + + // If verify mode is on, this is a loop test, and this is a write endpoint, fill + // the buffers with the same test data sent by a benchmark device when running + // a read only test. + if (transferParam->Test->Verify && + transferParam->Test->TestType == TestTypeLoop && + !(transferParam->Ep.bEndpointAddress & USB_ENDPOINT_DIR_MASK)) + { + // Data Format: + // [0][KeyByte] 2 3 4 5 ..to.. wMaxPacketSize (if data byte rolls it is incremented to 1) + // Increment KeyByte and repeat + // + BYTE indexC=0; + INT bufferIndex = 0; + WORD dataIndex; + INT packetIndex; + INT packetCount = ((transferParam->Test->BufferCount*transferParam->Test->BufferSize) / transferParam->Ep.wMaxPacketSize); + for(packetIndex = 0; packetIndex < packetCount; packetIndex++) + { + indexC = 2; + for (dataIndex=0; dataIndex < transferParam->Ep.wMaxPacketSize; dataIndex++) + { + if (dataIndex == 0) // Start + transferParam->Buffer[bufferIndex] = 0; + else if (dataIndex == 1) // Key + transferParam->Buffer[bufferIndex] = packetIndex & 0xFF; + else // Data + transferParam->Buffer[bufferIndex] = indexC++; + + // if wMaxPacketSize is > 255, indexC resets to 1. + if (indexC == 0) indexC = 1; + + bufferIndex++; + } + } + } + } + +Done: + if (!transferParam) + CONERR0("failed creating transfer param!\n"); + + return transferParam; +} + +void GetAverageBytesSec(struct BENCHMARK_TRANSFER_PARAM* transferParam, DOUBLE* bps) +{ + DOUBLE ticksSec; + if ((!transferParam->StartTick) || + (transferParam->StartTick >= transferParam->LastTick) || + transferParam->TotalTransferred==0) + { + *bps=0; + } + else + { + ticksSec = (transferParam->LastTick - transferParam->StartTick) / 1000.0; + *bps = (transferParam->TotalTransferred / ticksSec); + } +} + +void GetCurrentBytesSec(struct BENCHMARK_TRANSFER_PARAM* transferParam, DOUBLE* bps) +{ + DOUBLE ticksSec; + if ((!transferParam->StartTick) || + (!transferParam->LastStartTick) || + (transferParam->LastTick <= transferParam->LastStartTick) || + transferParam->LastTransferred==0) + { + *bps=0; + } + else + { + ticksSec = (transferParam->LastTick - transferParam->LastStartTick) / 1000.0; + *bps = transferParam->LastTransferred / ticksSec; + } +} + +void ShowRunningStatus(struct BENCHMARK_TRANSFER_PARAM* transferParam) +{ + struct BENCHMARK_TRANSFER_PARAM temp; + DOUBLE bpsOverall; + DOUBLE bpsLastTransfer; + + // LOCK the display critical section + EnterCriticalSection(&DisplayCriticalSection); + + memcpy(&temp, transferParam, sizeof(struct BENCHMARK_TRANSFER_PARAM)); + + // UNLOCK the display critical section + LeaveCriticalSection(&DisplayCriticalSection); + + if ((!temp.StartTick) || (temp.StartTick >= temp.LastTick)) + { + CONMSG("Synchronizing %d..\n", abs(transferParam->Packets)); + } + else + { + GetAverageBytesSec(&temp,&bpsOverall); + GetCurrentBytesSec(&temp,&bpsLastTransfer); + transferParam->LastStartTick = 0; + CONMSG("Avg. Bytes/s: %.2f Transfers: %d Bytes/s: %.2f\n", + bpsOverall, temp.Packets, bpsLastTransfer); + } + +} +void ShowTransferInfo(struct BENCHMARK_TRANSFER_PARAM* transferParam) +{ + DOUBLE bpsAverage; + DOUBLE bpsCurrent; + DOUBLE elapsedSeconds; + + if (!transferParam) return; + + CONMSG("%s %s (Ep%02Xh) max packet size: %d\n", + EndpointTypeDisplayString[ENDPOINT_TYPE(transferParam)], + TRANSFER_DISPLAY(transferParam,"Read","Write"), + transferParam->Ep.bEndpointAddress, + transferParam->Ep.wMaxPacketSize); + + if (transferParam->StartTick) + { + GetAverageBytesSec(transferParam,&bpsAverage); + GetCurrentBytesSec(transferParam,&bpsCurrent); + CONMSG("\tTotal Bytes : %I64d\n", transferParam->TotalTransferred); + CONMSG("\tTotal Transfers : %d\n", transferParam->Packets); + + if (transferParam->ShortTransferCount) + { + CONMSG("\tShort Transfers : %d\n", transferParam->ShortTransferCount); + } + if (transferParam->TotalTimeoutCount) + { + CONMSG("\tTimeout Errors : %d\n", transferParam->TotalTimeoutCount); + } + if (transferParam->TotalErrorCount) + { + CONMSG("\tOther Errors : %d\n", transferParam->TotalErrorCount); + } + + CONMSG("\tAvg. Bytes/sec : %.2f\n", bpsAverage); + + if (transferParam->StartTick && transferParam->StartTick < transferParam->LastTick) + { + elapsedSeconds = (transferParam->LastTick - transferParam->StartTick) / 1000.0; + + CONMSG("\tElapsed Time : %.2f seconds\n", elapsedSeconds); + } + + CONMSG0("\n"); + } + +} + +void ShowTestInfo(struct BENCHMARK_TEST_PARAM* testParam) +{ + if (!testParam) return; + + CONMSG("%s Test Information\n",TestDisplayString[testParam->TestType & 3]); + CONMSG("\tVid / Pid : %04Xh / %04Xh\n", testParam->Vid, testParam->Pid); + CONMSG("\tInterface # : %02Xh\n", testParam->Intf); + CONMSG("\tPriority : %d\n", testParam->Priority); + CONMSG("\tBuffer Size : %d\n", testParam->BufferSize); + CONMSG("\tBuffer Count : %d\n", testParam->BufferCount); + CONMSG("\tDisplay Refresh : %d (ms)\n", testParam->Refresh); + CONMSG("\tTransfer Timeout: %d (ms)\n", testParam->Timeout); + CONMSG("\tRetry Count : %d\n", testParam->Retry); + CONMSG("\tVerify Data : %s%s\n", + testParam->Verify ? "On" : "Off", + (testParam->Verify && testParam->VerifyDetails) ? " (Detailed)" : ""); + + CONMSG0("\n"); +} + +void WaitForTestTransfer(struct BENCHMARK_TRANSFER_PARAM* transferParam) +{ + DWORD exitCode; + while (transferParam) + { + if (!transferParam->IsRunning) + { + if (GetExitCodeThread(transferParam->ThreadHandle, &exitCode)) + { + if (exitCode == 0) + { + CONMSG("stopped Ep%02Xh thread.\tExitCode=%d\n", + transferParam->Ep.bEndpointAddress, exitCode); + break; + } + } + else + { + CONERR("failed getting Ep%02Xh thread exit code!\n",transferParam->Ep.bEndpointAddress); + break; + } + } + Sleep(100); + CONMSG("waiting for Ep%02Xh thread..\n", transferParam->Ep.bEndpointAddress); + } +} +void ResetRunningStatus(struct BENCHMARK_TRANSFER_PARAM* transferParam) +{ + if (!transferParam) return; + + transferParam->StartTick=0; + transferParam->TotalTransferred=0; + transferParam->Packets=-2; + transferParam->LastTick=0; + transferParam->RunningTimeoutCount=0; +} + +int GetTestDeviceFromList(struct BENCHMARK_TEST_PARAM* testParam) +{ + const int LINE_MAX_SIZE = 1024; + const int STRING_MAX_SIZE = 256; + const int NUM_STRINGS = 3; + const int ALLOC_SIZE = LINE_MAX_SIZE + (STRING_MAX_SIZE * NUM_STRINGS); + + int userInput; + + char* buffer; + char* line; + char* product; + char* manufacturer; + char* serial; + + struct usb_bus* bus; + struct usb_device* dev; + usb_dev_handle* udev; + struct usb_device* validDevices[256]; + + int deviceIndex=0; + struct usb_interface_descriptor* firstInterface; + + int ret = -1; + + buffer = malloc(ALLOC_SIZE); + if (!buffer) + { + CONERR0("failed allocating memory!\n"); + return ret; + } + + line = buffer; + product = buffer + LINE_MAX_SIZE; + manufacturer = product + STRING_MAX_SIZE; + serial = manufacturer + STRING_MAX_SIZE; + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + + udev = usb_open(dev); + if (udev) + { + memset(buffer, 0, ALLOC_SIZE); + line = buffer; + if (dev->descriptor.iManufacturer) + { + if (usb_get_string_simple(udev, dev->descriptor.iManufacturer, manufacturer, STRING_MAX_SIZE - 1) > 0) + { + strcat(line,"("); + strcat(line,manufacturer); + strcat(line,") "); + } + } + + if (dev->descriptor.iProduct) + { + if (usb_get_string_simple(udev, dev->descriptor.iProduct, product, STRING_MAX_SIZE - 1) > 0) + { + strcat(line,product); + strcat(line," "); + } + } + + if (dev->descriptor.iSerialNumber) + { + if (usb_get_string_simple(udev, dev->descriptor.iSerialNumber, serial, STRING_MAX_SIZE - 1) > 0) + { + strcat(line,"["); + strcat(line,serial); + strcat(line,"] "); + } + } + + if (!deviceIndex) + CONMSG0("\n"); + + validDevices[deviceIndex++] = dev; + + CONMSG("%d. %04X:%04X %s\n", + deviceIndex, dev->descriptor.idVendor, dev->descriptor.idProduct, line); + + usb_close(udev); + } + } + } + + if (!deviceIndex) + { + CONERR0("No devices where found!\n"); + ret = -1; + goto Done; + } + + CONMSG("\nSelect device (1-%d) :",deviceIndex); + ret = _cscanf("%i",&userInput); + if (ret != 1 || userInput < 1) + { + CONMSG0("\n"); + CONMSG0("Aborting..\n"); + ret = -1; + goto Done; + } + CONMSG0("\n"); + userInput--; + if (userInput >= 0 && userInput < deviceIndex) + { + testParam->DeviceHandle = usb_open(validDevices[userInput]); + if (testParam->DeviceHandle) + { + testParam->Device = validDevices[userInput]; + testParam->Vid = testParam->Device->descriptor.idVendor; + testParam->Pid = testParam->Device->descriptor.idProduct; + if (usb_find_interface(&validDevices[userInput]->config[0],testParam->Intf, testParam->Altf, &firstInterface) == NULL) + { + // the specified (or default) interface didn't exist, use the first one. + if (firstInterface != NULL) + { + testParam->Intf = firstInterface->bInterfaceNumber; + } + else + { + CONERR("device %04X:%04X does not have any interfaces!\n", + testParam->Vid, testParam->Pid); + ret = -1; + goto Done; + } + } + ret = 0; + } + } + +Done: + if (buffer) + free(buffer); + + return ret; +} + +int main(int argc, char** argv) +{ + struct BENCHMARK_TEST_PARAM Test; + struct BENCHMARK_TRANSFER_PARAM* ReadTest = NULL; + struct BENCHMARK_TRANSFER_PARAM* WriteTest = NULL; + int key; + + + if (argc == 1) + { + ShowHelp(); + return -1; + } + + ShowCopyright(); + + // NOTE: This is the log level for the benchmark application. + // +#if defined __ERROR_H__ + usb_log_set_level(255); +#endif + + SetTestDefaults(&Test); + + // Load the command line arguments. + if (ParseBenchmarkArgs(&Test, argc, argv) < 0) + return -1; + + // Initialize the critical section used for locking + // the volatile members of the transfer params in order + // to update/modify the running statistics. + // + InitializeCriticalSection(&DisplayCriticalSection); + + // Initialize the library. + usb_init(); + + // Find all busses. + usb_find_busses(); + + // Find all connected devices. + usb_find_devices(); + + if (Test.UseList) + { + if (GetTestDeviceFromList(&Test) < 0) + goto Done; + } + else + { + // Open a benchmark device. see Bench_Open(). + Test.DeviceHandle = Bench_Open(Test.Vid, Test.Pid, Test.Intf, Test.Altf, &Test.Device); + } + if (!Test.DeviceHandle || !Test.Device) + { + CONERR("device %04X:%04X not found!\n",Test.Vid, Test.Pid); + goto Done; + } + + // If "NoTestSelect" appears in the command line then don't send the control + // messages for selecting the test type. + // + if (!Test.NoTestSelect) + { + if (Bench_SetTestType(Test.DeviceHandle, Test.TestType, Test.Intf) != 1) + { + CONERR("setting bechmark test type #%d!\n%s\n", Test.TestType, usb_strerror()); + goto Done; + } + } + + CONMSG("Benchmark device %04X:%04X opened..\n",Test.Vid, Test.Pid); + + // If reading from the device create the read transfer param. This will also create + // a thread in a suspended state. + // + if (Test.TestType & TestTypeRead) + { + ReadTest = CreateTransferParam(&Test, Test.Ep | USB_ENDPOINT_DIR_MASK); + if (!ReadTest) goto Done; + } + + // If writing to the device create the write transfer param. This will also create + // a thread in a suspended state. + // + if (Test.TestType & TestTypeWrite) + { + WriteTest = CreateTransferParam(&Test, Test.Ep); + if (!WriteTest) goto Done; + } + + // Set configuration #1. + if (usb_set_configuration(Test.DeviceHandle, 1) < 0) + { + CONERR("setting configuration #%d!\n%s\n",1,usb_strerror()); + goto Done; + } + + // Claim_interface Test.Intf (Default is #0) + if (usb_claim_interface(Test.DeviceHandle, Test.Intf) < 0) + { + CONERR("claiming interface #%d!\n%s\n", Test.Intf, usb_strerror()); + goto Done; + } + + // Set the alternate setting (Default is #0) + if (usb_set_altinterface(Test.DeviceHandle, Test.Altf) < 0) + { + CONERR("selecting alternate setting #%d on interface #%d!\n%s\n", Test.Altf, Test.Intf, usb_strerror()); + goto Done; + } + else + { + if (Test.Altf > 0) + { + CONDBG("selected alternate setting #%d on interface #%d\n",Test.Altf, Test.Intf); + } + } + + if (Test.Verify) + { + if (ReadTest && WriteTest) + { + if (CreateVerifyBuffer(&Test, WriteTest->Ep.wMaxPacketSize) < 0) + goto Done; + } + else if (ReadTest) + { + if (CreateVerifyBuffer(&Test, ReadTest->Ep.wMaxPacketSize) < 0) + goto Done; + } + } + + ShowTestInfo(&Test); + ShowTransferInfo(ReadTest); + ShowTransferInfo(WriteTest); + + CONMSG0("\nWhile the test is running:\n"); + CONMSG0("Press 'Q' to quit\n"); + CONMSG0("Press 'T' for test details\n"); + CONMSG0("Press 'I' for status information\n"); + CONMSG0("Press 'R' to reset averages\n"); + CONMSG0("\nPress 'Q' to exit, any other key to begin.."); + key = _getch(); + CONMSG0("\n"); + + if (key=='Q' || key=='q') goto Done; + + // Set the thread priority and start it. + if (ReadTest) + { + SetThreadPriority(ReadTest->ThreadHandle, Test.Priority); + ResumeThread(ReadTest->ThreadHandle); + } + + // Set the thread priority and start it. + if (WriteTest) + { + SetThreadPriority(WriteTest->ThreadHandle, Test.Priority); + ResumeThread(WriteTest->ThreadHandle); + } + + while (!Test.IsCancelled) + { + Sleep(Test.Refresh); + + if (_kbhit()) + { + // A key was pressed. + key = _getch(); + switch (key) + { + case 'Q': + case 'q': + Test.IsUserAborted = TRUE; + Test.IsCancelled = TRUE; + break; + case 'T': + case 't': + ShowTestInfo(&Test); + break; + case 'I': + case 'i': + // LOCK the display critical section + EnterCriticalSection(&DisplayCriticalSection); + + // Print benchmark test details. + ShowTransferInfo(ReadTest); + ShowTransferInfo(WriteTest); + + + // UNLOCK the display critical section + LeaveCriticalSection(&DisplayCriticalSection); + break; + + case 'R': + case 'r': + // LOCK the display critical section + EnterCriticalSection(&DisplayCriticalSection); + + // Reset the running status. + ResetRunningStatus(ReadTest); + ResetRunningStatus(WriteTest); + + // UNLOCK the display critical section + LeaveCriticalSection(&DisplayCriticalSection); + break; + } + + // Only one key at a time. + while (_kbhit()) _getch(); + } + + // If the read test should be running and it isn't, cancel the test. + if ((ReadTest) && !ReadTest->IsRunning) + { + Test.IsCancelled = TRUE; + break; + } + + // If the write test should be running and it isn't, cancel the test. + if ((WriteTest) && !WriteTest->IsRunning) + { + Test.IsCancelled = TRUE; + break; + } + + // Print benchmark stats + if (ReadTest) + ShowRunningStatus(ReadTest); + else + ShowRunningStatus(WriteTest); + + } + + // Wait for the transfer threads to complete gracefully if it + // can be done in 10ms. All of the code from this point to + // WaitForTestTransfer() is not required. It is here only to + // improve response time when the test is cancelled. + // + Sleep(10); + + // If the thread is still running, abort and reset the endpoint. + if ((ReadTest) && ReadTest->IsRunning) + usb_resetep(Test.DeviceHandle, ReadTest->Ep.bEndpointAddress); + + // If the thread is still running, abort and reset the endpoint. + if ((WriteTest) && WriteTest->IsRunning) + usb_resetep(Test.DeviceHandle, WriteTest->Ep.bEndpointAddress); + + // Small delay incase usb_resetep() was called. + Sleep(10); + + // WaitForTestTransfer will not return until the thread + // has exited. + WaitForTestTransfer(ReadTest); + WaitForTestTransfer(WriteTest); + + // Print benchmark detailed stats + ShowTestInfo(&Test); + if (ReadTest) ShowTransferInfo(ReadTest); + if (WriteTest) ShowTransferInfo(WriteTest); + + +Done: + if (Test.DeviceHandle) + { + usb_close(Test.DeviceHandle); + Test.DeviceHandle = NULL; + } + if (Test.VerifyBuffer) + { + free(Test.VerifyBuffer); + Test.VerifyBuffer = NULL; + + } + FreeTransferParam(&ReadTest); + FreeTransferParam(&WriteTest); + + DeleteCriticalSection(&DisplayCriticalSection); + + CONMSG0("Press any key to exit.."); + _getch(); + CONMSG0("\n"); + + return 0; +} + +////////////////////////////////////////////////////////////////////////////// +/* END OF PROGRAM */ +////////////////////////////////////////////////////////////////////////////// +void ShowHelp(void) +{ + #define ID_HELP_TEXT 10020 + #define ID_DOS_TEXT 300 + + CONST CHAR* src; + DWORD src_count, charsWritten; + HGLOBAL res_data; + HANDLE handle; + HRSRC hSrc; + + ShowCopyright(); + + hSrc = FindResourceA(NULL, MAKEINTRESOURCEA(ID_HELP_TEXT),MAKEINTRESOURCEA(ID_DOS_TEXT)); + if (!hSrc) return; + + src_count = SizeofResource(NULL, hSrc); + + res_data = LoadResource(NULL, hSrc); + if (!res_data) return; + + src = (char*) LockResource(res_data); + if (!src) return; + + if ((handle=GetStdHandle(STD_ERROR_HANDLE)) != INVALID_HANDLE_VALUE) + WriteConsoleA(handle, src, src_count, &charsWritten, NULL); +} + +void ShowCopyright(void) +{ + CONMSG0("libusb-win32 USB Benchmark v" RC_VERSION_STR "\n"); + CONMSG0("Copyright (c) 2010 Travis Robinson. \n"); + CONMSG0("website: http://sourceforge.net/projects/libusbdotnet\n"); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark_rc.rc new file mode 100644 index 0000000..b7b4273 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/benchmark_rc.rc @@ -0,0 +1,56 @@ + +#ifdef __GNUC__ +#define _WIN32_IE 0x0400 +#endif + +#define RC_VERSION 1,1,0,0 +#define RC_VERSION_STR "1.1.0.0" + +#ifndef _BENCHMARK_VER_ONLY + +#include +#include + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "Benchmark Application" +#define RC_FILE_NAME_STR "Benchmark.exe" + +#define RT_MANIFEST 24 +#define ID_MANIFEST 1 +#define ID_HELP_TEXT 10020 +#define ID_DOS_TEXT 300 + +VS_VERSION_INFO VERSIONINFO +FILEVERSION RC_VERSION +PRODUCTVERSION RC_VERSION +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x0L +FILEOS VOS_NT_WINDOWS32 +FILETYPE RC_FILE_TYPE +FILESUBTYPE RC_FILE_SUB_TYPE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Travis Robinson" + VALUE "FileDescription", RC_PRODUCT_STR + VALUE "FileVersion", RC_VERSION_STR + VALUE "InternalName", RC_FILE_NAME_STR + VALUE "LegalCopyright", "Copyright (C) 2010 Travis Robinson" + VALUE "OriginalFilename",RC_FILE_NAME_STR + VALUE "ProductName", RC_PRODUCT_STR + VALUE "ProductVersion", RC_VERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +ID_HELP_TEXT ID_DOS_TEXT "BenchmarkHelp.txt" + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/bulk.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/bulk.c new file mode 100644 index 0000000..eb71220 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/bulk.c @@ -0,0 +1,240 @@ +#include +#include + +// Enables this example to work with a device running the +// libusb-win32 PIC Benchmark Firmware. +#define BENCHMARK_DEVICE + +////////////////////////////////////////////////////////////////////////////// +// TEST SETUP (User configurable) + +// Issues a Set configuration request +#define TEST_SET_CONFIGURATION + +// Issues a claim interface request +#define TEST_CLAIM_INTERFACE + +// Use the libusb-win32 async transfer functions. see +// transfer_bulk_async() below. +#define TEST_ASYNC + +// Attempts one bulk read. +#define TEST_BULK_READ + +// Attempts one bulk write. +// #define TEST_BULK_WRITE + +////////////////////////////////////////////////////////////////////////////// +// DEVICE SETUP (User configurable) + +// Device vendor and product id. +#define MY_VID 0x0666 +#define MY_PID 0x0001 + +// Device configuration and interface id. +#define MY_CONFIG 1 +#define MY_INTF 0 + +// Device endpoint(s) +#define EP_IN 0x81 +#define EP_OUT 0x01 + +// Device of bytes to transfer. +#define BUF_SIZE 64 + +////////////////////////////////////////////////////////////////////////////// +usb_dev_handle *open_dev(void); + +static int transfer_bulk_async(usb_dev_handle *dev, + int ep, + char *bytes, + int size, + int timeout); + +usb_dev_handle *open_dev(void) +{ + struct usb_bus *bus; + struct usb_device *dev; + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + if (dev->descriptor.idVendor == MY_VID + && dev->descriptor.idProduct == MY_PID) + { + return usb_open(dev); + } + } + } + return NULL; +} + +int main(void) +{ + usb_dev_handle *dev = NULL; /* the device handle */ + char tmp[BUF_SIZE]; + int ret; + void* async_read_context = NULL; + void* async_write_context = NULL; + + usb_init(); /* initialize the library */ + usb_find_busses(); /* find all busses */ + usb_find_devices(); /* find all connected devices */ + + + if (!(dev = open_dev())) + { + printf("error opening device: \n%s\n", usb_strerror()); + return 0; + } + else + { + printf("success: device %04X:%04X opened\n", MY_VID, MY_PID); + } + +#ifdef TEST_SET_CONFIGURATION + if (usb_set_configuration(dev, MY_CONFIG) < 0) + { + printf("error setting config #%d: %s\n", MY_CONFIG, usb_strerror()); + usb_close(dev); + return 0; + } + else + { + printf("success: set configuration #%d\n", MY_CONFIG); + } +#endif + +#ifdef TEST_CLAIM_INTERFACE + if (usb_claim_interface(dev, 0) < 0) + { + printf("error claiming interface #%d:\n%s\n", MY_INTF, usb_strerror()); + usb_close(dev); + return 0; + } + else + { + printf("success: claim_interface #%d\n", MY_INTF); + } +#endif + +#ifdef TEST_BULK_WRITE + +#ifdef BENCHMARK_DEVICE + ret = usb_control_msg(dev, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + 14, /* set/get test */ + 2, /* test type */ + MY_INTF, /* interface id */ + tmp, 1, 1000); +#endif + +#ifdef TEST_ASYNC + // Running an async write test + ret = transfer_bulk_async(dev, EP_OUT, tmp, sizeof(tmp), 5000); +#else + // Running a sync write test + ret = usb_bulk_write(dev, EP_OUT, tmp, sizeof(tmp), 5000); +#endif + if (ret < 0) + { + printf("error writing:\n%s\n", usb_strerror()); + } + else + { + printf("success: bulk write %d bytes\n", ret); + } +#endif + +#ifdef TEST_BULK_READ + +#ifdef BENCHMARK_DEVICE + ret = usb_control_msg(dev, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, + 14, /* set/get test */ + 1, /* test type */ + MY_INTF, /* interface id */ + tmp, 1, 1000); +#endif + +#ifdef TEST_ASYNC + // Running an async read test + ret = transfer_bulk_async(dev, EP_IN, tmp, sizeof(tmp), 5000); +#else + // Running a sync read test + ret = usb_bulk_read(dev, EP_IN, tmp, sizeof(tmp), 5000); +#endif + if (ret < 0) + { + printf("error reading:\n%s\n", usb_strerror()); + } + else + { + printf("success: bulk read %d bytes\n", ret); + } +#endif + +#ifdef TEST_CLAIM_INTERFACE + usb_release_interface(dev, 0); +#endif + + if (dev) + { + usb_close(dev); + } + printf("Done.\n"); + + return 0; +} + +/* +* Read/Write using async transfer functions. +* +* NOTE: This function waits for the transfer to complete essentially making +* it a sync transfer function so it only serves as an example of how one might +* implement async transfers into thier own code. +*/ +static int transfer_bulk_async(usb_dev_handle *dev, + int ep, + char *bytes, + int size, + int timeout) +{ + // Each async transfer requires it's own context. A transfer + // context can be re-used. When no longer needed they must be + // freed with usb_free_async(). + // + void* async_context = NULL; + int ret; + + // Setup the async transfer. This only needs to be done once + // for multiple submit/reaps. (more below) + // + ret = usb_bulk_setup_async(dev, &async_context, ep); + if (ret < 0) + { + printf("error usb_bulk_setup_async:\n%s\n", usb_strerror()); + goto Done; + } + + // Submit this transfer. This function returns immediately and the + // transfer is on it's way to the device. + // + ret = usb_submit_async(async_context, bytes, size); + if (ret < 0) + { + printf("error usb_submit_async:\n%s\n", usb_strerror()); + usb_free_async(&async_context); + goto Done; + } + + // Wait for the transfer to complete. If it doesn't complete in the + // specified time it is cancelled. see also usb_reap_async_nocancel(). + // + ret = usb_reap_async(async_context, timeout); + + // Free the context. + usb_free_async(&async_context); + +Done: + return ret; +} \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/driver_installer_template.iss b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/driver_installer_template.iss new file mode 100644 index 0000000..eb87f92 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/driver_installer_template.iss @@ -0,0 +1,82 @@ +; This examples demonstrates how libusb's drivers +; can be installed automatically along with your application using an installer. +; +; Requirements: Inno Setup (http://www.jrsoftware.org/isdl.php) +; +; To use this script, do the following: +; - generate a setup package using inf-wizard and save the generated files to +; "this folder\driver" +; - in this script replace with the name of your .inf file +; - customize other settings (strings) +; - open this script with Inno Setup +; - compile and run + +[Setup] +AppName = TestDrivers +AppVerName = TestDrivers 0.1.10.2 +AppPublisher = TestDrivers +AppPublisherURL = http://test.url.com/ +AppVersion = 0.1.10.1 +DefaultDirName = {pf}\TestApp +DefaultGroupName = TestDrivers +Compression = lzma +SolidCompression = yes +; Win2000 or higher +MinVersion = 5,5 + +; This installation requires admin priveledges. This is needed to install +; drivers on windows vista and later. +PrivilegesRequired = admin + +; "ArchitecturesInstallIn64BitMode=x64 ia64" requests that the install +; be done in "64-bit mode" on x64 & Itanium, meaning it should use the +; native 64-bit Program Files directory and the 64-bit view of the +; registry. On all other architectures it will install in "32-bit mode". +ArchitecturesInstallIn64BitMode=x64 ia64 + +; Inno pascal functions for determining the processor type. +; you can use these to use (in an inno "check" parameter for example) to +; customize the installation depending on the architecture. +[Code] +function IsX64: Boolean; +begin + Result := Is64BitInstallMode and (ProcessorArchitecture = paX64); +end; + +function IsI64: Boolean; +begin + Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64); +end; + +function IsX86: Boolean; +begin + Result := not IsX64 and not IsI64; +end; + +function Is64: Boolean; +begin + Result := IsX64 or IsI64; +end; + +[Files] +; copy your libusb-win32 setup package to the App folder +Source: "driver\*"; Excludes: "*.exe"; Flags: recursesubdirs; DestDir: "{app}\driver" + +; also copy the native (32bit or 64 bit) libusb0.dll to the +; system folder so that rundll32.exe will find it +Source: "driver\x86\libusb0_x86.dll"; DestName: "libusb0.dll"; DestDir: "{sys}"; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX86; +Source: "driver\amd64\libusb0.dll"; DestDir: "{sys}"; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64; +Source: "driver\ia64\libusb0.dll"; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64; + +[Icons] +Name: "{group}\Uninstall TestDrivers"; Filename: "{uninstallexe}" + +[Run] + +; touch the HID .inf file to break its digital signature +; this is only required if the device is a mouse or a keyboard !! +;Filename: "rundll32"; Parameters: "libusb0.dll,usb_touch_inf_file_np_rundll {win}\inf\input.inf" + +; invoke libusb's DLL to install the .inf file +Filename: "rundll32"; Parameters: "libusb0.dll,usb_install_driver_np_rundll {app}\driver\"; StatusMsg: "Installing driver (this may take a few seconds) ..." + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/testbulk_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/testbulk_rc.rc new file mode 100644 index 0000000..c3e3911 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/examples/testbulk_rc.rc @@ -0,0 +1,25 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2006 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "libusb-win32 - Test Program" +#define RC_FILE_NAME_STR "testbulk.exe" + +#include "libusb-win32_version.rc" diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/installer_license.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/installer_license.txt new file mode 100644 index 0000000..6128be6 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/installer_license.txt @@ -0,0 +1,851 @@ +Copyright (c) 2002-2004 Stephan Meyer, +Copyright (c) 2000-2004 Johannes Erdfelt, +Copyright (c) 2000-2004 Thomas Sailer, +Copyright (c) 2010 Travis Robinson, + +This software is distributed under the following licenses: +Driver: GNU General Public License (GPL) +Library, Test Files, Installer: GNU Lesser General Public License (LGPL) + +*********************************************************************** + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-bin-README.txt.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-bin-README.txt.in new file mode 100644 index 0000000..6c4db87 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-bin-README.txt.in @@ -0,0 +1,27 @@ +@PACKAGE_BIN_NAME@ v@VERSION@ (@_MM_@/@_DD_@/@_YYYY_@) - [Package Information] + +ALL ARCHITECTURES: + x86\libusb0_x86.dll: x86 32-bit library. Must be renamed to libusb0.dll! + On 64 bit, Installs to Windows\syswow64\libusb0.dll. + On 32 bit, Installs to Windows\system32\libusb0.dll. + + x86\inf-wizard.exe: inf-wizard application with embedded libusb-win32 + v@VERSION@ binaries. + +X86 ONLY ARCHITECTURES: + x86\libusb0.sys: x86 32-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + +AMD64-INTEL64 ONLY ARCHITECTURES: + amd64\libusb0.sys: x64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + amd64\libusb0.dll: x64 64-bit library. + Installs to Windows\system32\libusb0.dll + +IA64 ONLY ARCHITECTURES: + ia64\libusb0.sys: IA64 64-bit driver. + Installs to Windows\system32\drivers\libusb0.sys + + ia64\libusb0.dll: IA64 64-bit library. + Installs to Windows\system32\libusb0.dll diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-changelog-1.2.4.0.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-changelog-1.2.4.0.txt new file mode 100644 index 0000000..c2def41 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb-win32-changelog-1.2.4.0.txt @@ -0,0 +1,162 @@ +LibUsb-Win32 Change Log + +V1.2.4.0 (04/11/2011) +======================= +* Removed get configuration request from the core driver + set_configuration function. This caused problems with + some non-compliant usb devices. + +* Added device descriptor dump to test applications. + +V1.2.3.0 (03/16/2011) +======================= +* Fixed bug-id 3117686 reported by Tim Schuerewegen. + +* Added LIBUSB_IOCTL_GET_OBJECT_NAME. This new IOCTL code retrieves object + from the driver. The only valid object name index is 0. Index 0 is + returns the devices plug and play registry key pathname. + +* Removed maximum timeout restriction for vendor class requests. + +V1.2.2.0 (10/02/2010) +======================= +* Added install-filter-win.exe. A gui installer for device filters. + +* Added new libusb0.dll function usb_install_np_rundll(). This function + is designed for rundll32.exe and takes the same parameters as + install-filter.exe. + +* Updated install-filter.exe. This application has several new features. + Type "install-filter --help" for more details. + +* Updated libusb-win32-devel-filter package. This package is once again + available for download as a setup.exe. + +* Updated libusb-win32 "bin" package format. inf-wizard.exe has been moved + up one directory. + +* Updated driver_installer_template.iss example. This is an Inno Setup + Script showing how to create your own setup.exe for installing your + application and driver. + +* Fixed missing byte order marker in inf-wizard.exe .inf files. (libwdi) + +* Fixed auto-configuration issue when there is more than one driver in the + stack. + +* Fixed BSOD when using the filter driver with devices that are auto + suspended by other drivers in the stack. + +* Fixed BSOD for devices with endpoints that have '0' for wMaxPacketSize. + +* Fixed BSOD when cancelling large transfers on high speed devices. + + +V1.2.1.0 (07/28/2010) +======================= +* Updated bulk.c to include async i/o example code. + +* Fixed usb_install_driver_np() issue with inf-wizard generated infs. + +* Fixed inf2cat.exe issue with inf-wizard generated infs. + +* Added 'Install Now' feature to inf-wizard. (libwdi) + +* Added embedded libusb-win32 binaries to inf-wizard. (libwdi) + +* Added libwdi (http://www.libusb.org/wiki/libwdi) to inf-wizard. + +* Added get cached configuration request to usb_open(). This is a new + control code that involves no device i/o and allows + usb_set_configuration() to be omitted if the driver has already + configured it. + +* Fixed set_configuration() failure for devices that do not properly + support get_configuration(). + +V1.2.0.0 (07/07/2010) +======================= +* First signed driver release! The libusb-win32 kernel driver (libusb0.sys) + can now be used on x64 Windows machines that require signed drivers. + +* Fixed 2128187 reported by Tim Green. usb_get_descriptor() can fail + because the given buffer of 8 bytes is too small. + +* Fixed 2928293 reported by Tim Green. Sometimes the call to + usb_fetch_and_parse_descriptors() in usb_find_devices() can fail. This + patch moves the LIST_ADD to after a successful read of the device's + configuration descriptors. + +* Fixed issue causing libusb-win32 to not act as power policy owner + when it should. + +* Fixed issue in which on rare occasion, a libusb-win32 filter device could + run as a "normal" device. + +* Fixed filter driver issue for device using wudfr.sys. + +* Added large transfer splitting to driver (bulk, int, iso). NOTE: + The dll continues to break transfers in the same manner it always has. + + +V1.1.14.3 (06/12/2010) +======================= +* Remove get_configuration() request from usb_open(). This caused claim + interface to fail when used as a filter driver. + +V1.1.14.0 (06/01/2010) +======================= +* Updated logging functions and standardized log message display format. + +* Updated inf-wizard to use the new directory format for the libusb-win32 + binaries. + +* Updated package directories to reflect the winddk BUILDARCH env variable. + (i64 := ia64, x64 := amd64) + +* Added request to get the current configuration in usb_open(). + +* Fixed 2960644 (reported by farthen) crash on shutdown with x64 based + systems while using inf files for each libusb device. + +* Added additional log message only included in debug/chk builds. + +* Updated default log levels to highest verbose level for debug builds. + +* Added test signing support to the libusb-win32 make.cmd. This allows + libusb0.sys and libusb0.dll to be signed with a digital signature. + (see make.cmd for mmore details) + +* Added MSVC 2008 project files + +* Moved version defines to an include file (libusb_version.h) + This file is generated from libusb_version_h.in with "make.cmd makever" + +* Removed all "dist" commands from cyg/mingw makefile. Instead use "make.cmd" + in the "ddk_make" directory. + +* Fixed filter setup not running in 64bit mode + +* Fixed 64bit inf-wizard, testlibusb-win builds + +* Added set initial config value #1 when the driver is not a filter. + optionally, the initial configuration value can be specified in the inf + file: HKR,,"InitialConfigValue",0x00010001, + +* Added support for querying device registry keys + (LIBUSB_IOCTL_GET_CUSTOM_REG_PROPERTY) + +* Added support for querying device properties + (LIBUSB_IOCTL_GET_DEVICE_PROPERTY) + +* Fixed possible race condition in kernel add_device() + +* Updated default ddk build version number to 1.1.14.0 to facilitate + Microsoft WHQL submission. + +* Added DDK build distribution system. Official libusb-win32 releases + (after 0.1.12.2) are built using Microsoft's WinDDK. (see make.cmd) + +* Fixed 2658937 (reported by Tim Roberts) The libusb-win32 driver always + acts as a power policy owner. + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0.def b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0.def new file mode 100644 index 0000000..81e62aa --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0.def @@ -0,0 +1,50 @@ +EXPORTS + usb_open + usb_close + usb_get_string + usb_get_string_simple + usb_get_descriptor_by_endpoint + usb_get_descriptor + usb_bulk_write + usb_bulk_read + usb_interrupt_write + usb_interrupt_read + usb_control_msg + usb_set_configuration + usb_claim_interface + usb_release_interface + usb_set_altinterface + usb_resetep + usb_clear_halt + usb_reset + usb_strerror + usb_init + usb_set_debug + usb_find_busses + usb_find_devices + usb_device + usb_get_busses + usb_install_service_np + usb_install_service_np_rundll + usb_uninstall_service_np + usb_uninstall_service_np_rundll + usb_install_driver_np + usb_install_driver_np_rundll + usb_touch_inf_file_np + usb_touch_inf_file_np_rundll + usb_get_version + usb_isochronous_setup_async + usb_bulk_setup_async + usb_interrupt_setup_async + usb_submit_async + usb_reap_async + usb_reap_async_nocancel + usb_cancel_async + usb_free_async + usb_install_needs_restart_np + usb_install_npW + usb_install_npA + usb_install_np_rundll + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0_drv.def b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0_drv.def new file mode 100644 index 0000000..516b893 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/libusb0_drv.def @@ -0,0 +1,2 @@ +EXPORTS + DriverEntry = DriverEntry@8 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcproj new file mode 100644 index 0000000..522f629 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcproj @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj new file mode 100644 index 0000000..58fb369 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A} + Benchmark + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX64 + + + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + MultiThreadedDLL + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + MultiThreadedDLL + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + + + + + {c52e6fa6-aff5-468d-a82f-e9932e8203d4} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.filters new file mode 100644 index 0000000..39c292f --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.filters @@ -0,0 +1,38 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/UpgradeLog.XML b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/UpgradeLog.XML new file mode 100644 index 0000000..e7fdaf7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/UpgradeLog.XML @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/inf-wizard/ResolveAssemblyReference.cache b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/inf-wizard/ResolveAssemblyReference.cache new file mode 100644 index 0000000..59438b4 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/inf-wizard/ResolveAssemblyReference.cache differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/lib/libwdi/ResolveAssemblyReference.cache b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/lib/libwdi/ResolveAssemblyReference.cache new file mode 100644 index 0000000..41c6e2b Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/lib/libwdi/ResolveAssemblyReference.cache differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache new file mode 100644 index 0000000..1bcfb78 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/Win32/Debug/testlibusb-win/ResolveAssemblyReference.cache differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.css b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.css new file mode 100644 index 0000000..3411f63 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.css @@ -0,0 +1,207 @@ +BODY +{ + BACKGROUND-COLOR: white; + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 100%; + MARGIN-LEFT: 0px; + MARGIN-TOP: 0px +} +P +{ + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 70%; + LINE-HEIGHT: 12pt; + MARGIN-BOTTOM: 0px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 10px +} +.note +{ + BACKGROUND-COLOR: #ffffff; + COLOR: #336699; + FONT-FAMILY: "Verdana", sans-serif; + FONT-SIZE: 100%; + MARGIN-BOTTOM: 0px; + MARGIN-LEFT: 0px; + MARGIN-TOP: 0px; + PADDING-RIGHT: 10px +} +.infotable +{ + BACKGROUND-COLOR: #f0f0e0; + BORDER-BOTTOM: #ffffff 0px solid; + BORDER-COLLAPSE: collapse; + BORDER-LEFT: #ffffff 0px solid; + BORDER-RIGHT: #ffffff 0px solid; + BORDER-TOP: #ffffff 0px solid; + FONT-SIZE: 70%; + MARGIN-LEFT: 10px +} +.issuetable +{ + BACKGROUND-COLOR: #ffffe8; + BORDER-COLLAPSE: collapse; + COLOR: #000000; + FONT-SIZE: 100%; + MARGIN-BOTTOM: 10px; + MARGIN-LEFT: 13px; + MARGIN-TOP: 0px +} +.issuetitle +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px; + COLOR: #003366; + FONT-WEIGHT: normal +} +.header +{ + BACKGROUND-COLOR: #cecf9c; + BORDER-BOTTOM: #ffffff 1px solid; + BORDER-LEFT: #ffffff 1px solid; + BORDER-RIGHT: #ffffff 1px solid; + BORDER-TOP: #ffffff 1px solid; + COLOR: #000000; + FONT-WEIGHT: bold +} +.issuehdr +{ + BACKGROUND-COLOR: #E0EBF5; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px solid; + COLOR: #000000; + FONT-WEIGHT: normal +} +.issuenone +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: 0px; + BORDER-LEFT: 0px; + BORDER-RIGHT: 0px; + BORDER-TOP: 0px; + COLOR: #000000; + FONT-WEIGHT: normal +} +.content +{ + BACKGROUND-COLOR: #e7e7ce; + BORDER-BOTTOM: #ffffff 1px solid; + BORDER-LEFT: #ffffff 1px solid; + BORDER-RIGHT: #ffffff 1px solid; + BORDER-TOP: #ffffff 1px solid; + PADDING-LEFT: 3px +} +.issuecontent +{ + BACKGROUND-COLOR: #ffffff; + BORDER-BOTTOM: #dcdcdc 1px solid; + BORDER-TOP: #dcdcdc 1px solid; + PADDING-LEFT: 3px +} +A:link +{ + COLOR: #cc6633; + TEXT-DECORATION: underline +} +A:visited +{ + COLOR: #cc6633; +} +A:active +{ + COLOR: #cc6633; +} +A:hover +{ + COLOR: #cc3300; + TEXT-DECORATION: underline +} +H1 +{ + BACKGROUND-COLOR: #003366; + BORDER-BOTTOM: #336699 6px solid; + COLOR: #ffffff; + FONT-SIZE: 130%; + FONT-WEIGHT: normal; + MARGIN: 0em 0em 0em -20px; + PADDING-BOTTOM: 8px; + PADDING-LEFT: 30px; + PADDING-TOP: 16px +} +H2 +{ + COLOR: #000000; + FONT-SIZE: 80%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: 3px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 20px; + PADDING-LEFT: 0px +} +H3 +{ + COLOR: #000000; + FONT-SIZE: 80%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: -5px; + MARGIN-LEFT: 10px; + MARGIN-TOP: 20px +} +H4 +{ + COLOR: #000000; + FONT-SIZE: 70%; + FONT-WEIGHT: bold; + MARGIN-BOTTOM: 0px; + MARGIN-TOP: 15px; + PADDING-BOTTOM: 0px +} +UL +{ + COLOR: #000000; + FONT-SIZE: 70%; + LIST-STYLE: square; + MARGIN-BOTTOM: 0pt; + MARGIN-TOP: 0pt +} +OL +{ + COLOR: #000000; + FONT-SIZE: 70%; + LIST-STYLE: square; + MARGIN-BOTTOM: 0pt; + MARGIN-TOP: 0pt +} +LI +{ + LIST-STYLE: square; + MARGIN-LEFT: 0px +} +.expandable +{ + CURSOR: hand +} +.expanded +{ + color: black +} +.collapsed +{ + DISPLAY: none +} +.foot +{ +BACKGROUND-COLOR: #ffffff; +BORDER-BOTTOM: #cecf9c 1px solid; +BORDER-TOP: #cecf9c 2px solid +} +.settings +{ +MARGIN-LEFT: 25PX; +} +.help +{ +TEXT-ALIGN: right; +margin-right: 10px; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.xslt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.xslt new file mode 100644 index 0000000..93ac076 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport.xslt @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ 解决方案: + 项目: + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + src + + + + + + + + + + + + +
文件名状态错误警告
+ javascript:document.images[''].click()src + + + + 已转换 + + + + 已转换 + +
+ + 个文件 + + + 1 个文件 + + + 已转换:
+ 未转换: +
+
+
+ + + + : + + + + + + + + + 转换报告 + <xsl:if test="Properties/Property[@Name='LogNumber']"> + <xsl:value-of select="Properties/Property[@Name='LogNumber']/@Value"/> + </xsl:if> + + + + +

转换报告 -

+ +

+ 转换时间:
+

+ + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + +
+ 转换设置 +

+ + +
+
diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Minus.gif b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Minus.gif new file mode 100644 index 0000000..17751cb Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Minus.gif differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Plus.gif b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Plus.gif new file mode 100644 index 0000000..f6009ca Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/_UpgradeReport_Files/UpgradeReport_Plus.gif differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/AUTHORS b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/AUTHORS new file mode 100644 index 0000000..61d282d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/AUTHORS @@ -0,0 +1,8 @@ +copyright (c) 2010 Pete Batard +copyright (c) 2010 Travis Robinson + +zadic improvements: + copyright (c) 2010 Joseph Marshall + +libconfig authors: + Mark Lindner, Daniel Marjamki, Andrew Tytula, Glenn Herteg \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/COPYING b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/COPYING new file mode 100644 index 0000000..5ab7695 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ChangeLog b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ChangeLog new file mode 100644 index 0000000..5ef97d5 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ChangeLog @@ -0,0 +1 @@ +1.0.0 ALPHA \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/Makefile.am b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/Makefile.am new file mode 100644 index 0000000..a4e5ea6 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/Makefile.am @@ -0,0 +1,27 @@ +AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip +ACLOCAL_AMFLAGS = -I m4 +#DISTCLEANFILES = ChangeLog libusb-1.0.pc +#EXTRA_DIST = TODO PORTING +SUBDIRS = libwdi + +if BUILD_EXAMPLES +SUBDIRS += examples +endif + +#pkgconfigdir=$(libdir)/pkgconfig +#pkgconfig_DATA=libusb-1.0.pc + +#.PHONY: ChangeLog dist-up +#ChangeLog: +# git --git-dir $(top_srcdir)/.git log > ChangeLog || touch ChangeLog + +#dist-hook: ChangeLog + +reldir = .release/$(distdir) +dist-up: dist + rm -rf $(reldir) + mkdir -p $(reldir) + cp $(distdir).tar.bz2 $(reldir) + rsync -rv $(reldir) dsd_,libusb@frs.sourceforge.net:/home/frs/project/l/li/libusb/libusb-1.0/ + rm -rf $(reldir) + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/NEWS b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/README b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/README new file mode 100644 index 0000000..479766f --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/README @@ -0,0 +1,38 @@ +libwdi: Windows Driver Installer library for USB devices + +Features: +- Automated driverless device detection +- Automated inf creation, using the name reported by the USB device +- Automated driver files extraction, for both 32 and 64 bit platforms +- Automated driver installation, including UAC elevation where necessary +- When statically linked, only the final executable needs to be redistributed to + ensure that a driver can be automatically installed on any Windows platform. + +For the reditributale library to work on both 64 and 32 bit, you must use a +compiler that can produce both 32 and 64 bit binaries, and compile the library +as 32 bit. +For gcc, that means that your compiler should support both the -m32 and -m64 +options, and for Visual Studio, that means using a non Express version. +Note that you still have the possibility to use other compilers to produce a 32 +bit (or 64 bit) only library, and automated configuration will be smart enough +to detect this, and compile/embed only the required 32 or 64 bit resources. +If you want to compile a 64 bit only library, make sure you comment OPT_M32 in +config.h, or use the --disable-32bit option when runing configure. + +For gcc, the best solution right now, to have -m32 and -m64 with very little +effort, is to download WPG System 64 from http://www.cadforte.com/system64.html +as the MinGW-32 and cygwin only compile 32 bit binaries by default, and the +official binary packages from MinGW-w64 don't have multilib enabled, so they are +64 bit only. + +Compiling: +Regardless of your development environment, you must either have the Windows DDK +installed, or have the winusb/wdf 32 and 64 bit redistributable DLLs. +On cygwin/mingw, you need to supply the path to your DDK with the --with-ddkdir +option when calling configure (see autogen.sh). +For MSVC, you must edit msvc/config.h and set DDK_PATH path accordingly. + +Dependencies: +The Zadig GUI application uses a slightly modified version of libconfig 1.4.5 +(LGPL v2.1), which is copyright Mark Lindner et al. +See http://www.hyperrealm.com/libconfig/ for details. \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/autogen.sh b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/autogen.sh new file mode 100644 index 0000000..da38562 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/autogen.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# use glibtoolize if it is available (darwin) +(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize || LIBTOOLIZE=libtoolize + +$LIBTOOLIZE --copy --force || exit 1 +# Force ltmain's NLS test to set locale to C always. Prevents an +# issue when compiling shared libs with MinGW on Chinese locale. +type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; } +sed -e s/\\\\\${\$lt_var+set}/set/g ltmain.sh > lttmp.sh +mv lttmp.sh ltmain.sh +# +aclocal || exit 1 +autoheader || exit 1 +autoconf || exit 1 +automake -a -c || exit 1 +./configure --enable-toggable-debug --enable-examples-build --disable-debug --with-ddkdir="E:/WinDDK/7600.16385.0" --with-libusb0="D:/libusb-win32" $* diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/configure.ac b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/configure.ac new file mode 100644 index 0000000..c9f4675 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/configure.ac @@ -0,0 +1,282 @@ +AC_INIT([libwdi], [1.0.0], [libusb-devel@lists.sourceforge.net], [libwdi], [http://libusb.org/wiki/windows_backend]) +AM_INIT_AUTOMAKE +AC_CONFIG_SRCDIR([libwdi/libwdi.c]) +AC_CONFIG_MACRO_DIR([m4]) +AM_CONFIG_HEADER([config.h]) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +AC_PREREQ([2.50]) +AC_PROG_CC +AC_PROG_LIBTOOL +AC_C_INLINE +AM_PROG_CC_C_O +AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions]) +WDF_VER="01009" +AC_DEFINE_UNQUOTED([WDF_VER], ["${WDF_VER}"], [DDK WDF coinstaller version (string)]) + +AC_ARG_WITH(ddkdir, + AS_HELP_STRING([--with-ddkdir], [embed WinUSB driver files from the following DDK location]), + DDK_DIR=$withval, + DDK_DIR="") +if test "x$DDK_DIR" != "x"; then + AC_DEFINE_UNQUOTED([DDK_DIR], ["${DDK_DIR}"], [embed WinUSB driver files from the following DDK location]) +fi + +AC_ARG_WITH(libusb0, + AS_HELP_STRING([--with-libusb0], [embed libusb0 driver files from the following location]), + LIBUSB0_DIR=$withval, + LIBUSB0_DIR="") +if test "x$LIBUSB0_DIR" != "x"; then + AC_DEFINE_UNQUOTED([LIBUSB0_DIR], ["${LIBUSB0_DIR}"], [embed libusb0 driver files from the following location]) +fi + +AC_ARG_WITH(userdir, + AS_HELP_STRING([--with-userdir], [embed user defined driver files from the following location]), + USER_DIR=$withval, + USER_DIR="") +if test "x$USER_DIR" != "x"; then + AC_DEFINE_UNQUOTED([USER_DIR], ["${USER_DIR}"], [embed user defined driver files from the following location]) +fi + +if test "x$USER_DIR" == "x" -a "x$DDK_DIR" == "x" -a "x$LIBUSB0_DIR" == "x"; then + AC_MSG_ERROR([One of --with-ddkdir, --with-libusb0 or --with-userdir options MUST be provided.]) +fi + +AC_MSG_CHECKING([development environment]) +case $host in +*-mingw*) + AC_MSG_RESULT([MinGW]) + AM_CFLAGS="-Wshadow -DWINVER=0x500" + NO_CYGWIN="" + LIBCONFIG_LIBADD="" + LIBCONFIG_CFLAGS="" + ;; +*-cygwin*) + AC_MSG_RESULT([cygwin]) + AM_CFLAGS="-DWINVER=0x500" + save_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} -mno-cygwin" + AC_MSG_CHECKING([if -mno-cygwin is supported]) + AC_TRY_COMPILE(, [;], + has_mno_cygwin=yes, + has_mno_cygwin=no) + if test "x$has_mno_cygwin" == "xyes"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([you must ensure that -mno-cygwin is supported on cygwin]) + fi + CFLAGS="${save_CFLAGS}" + # if you try to redefine CC to "gcc -mno-cygwin", all kind of bad things happen + # => use a variable instead + NO_CYGWIN="-mno-cygwin" + LIBCONFIG_LIBADD="-L/lib/mingw -lcrtdll -lmingwex" + LIBCONFIG_CFLAGS="-static -I/usr/include/mingw -D__MINGW_FEATURES__" + ;; +*) + AC_MSG_ERROR([unsupported development environment]) +esac + +AM_LDFLAGS="-no-undefined -avoid-version" +AC_CHECK_TOOL(RC, windres, no) + +# 32 bit support +save_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -m32" +AC_MSG_CHECKING([whether the compiler can produce 32 bit binaries]) +AC_TRY_COMPILE(, [;], + compiler_has_m32=yes, + compiler_has_m32=no) +if test "x$compiler_has_m32" == "xyes"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +CFLAGS="${save_CFLAGS}" + +# 64 bit support +save_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -m64" +AC_MSG_CHECKING([whether the compiler can produce 64 bit binaries]) +AC_TRY_COMPILE(, [;], + compiler_has_m64=yes, + compiler_has_m64=no) +if test "x$compiler_has_m64" == "xyes"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +CFLAGS="${save_CFLAGS}" + +if test "x$compiler_has_m64" != "xyes" -a "x$compiler_has_m32" != "xyes"; then + AC_MSG_ERROR([neither -m32 nor -m64 is supported by your compiler]) +fi + +# 32 and 64 bit selection +AC_ARG_ENABLE([32bit], [AS_HELP_STRING([--enable-32bit], + [build 32 bit compatible library (default y)])], + [enable_32bit=$enableval], + [enable_32bit='yes']) +AC_ARG_ENABLE([64bit], [AS_HELP_STRING([--enable-64bit], + [build 64 bit compatible library (default y)])], + [enable_64bit='$enableval'], + [enable_64bit='yes']) +AC_ARG_ENABLE([ia64], [AS_HELP_STRING([--enable-ia64], + [embed IA64/Itanium driver files (default n)])], + [enable_ia64='$enableval'], + [enable_ia64='no']) +if test "x$enable_64bit" == "xno" -a "x$enable_32bit" == "xno"; then + AC_MSG_ERROR([you cannot disable both 32 and 64 bit support]) +fi + +# OK, let's make some sense of all this 32/64 bit mess... +if test "x$enable_64bit" != "xno" -a "x$compiler_has_m64" == "xno"; then + if test "x$enable_32bit" == "xno"; then + AC_MSG_ERROR([compiler cannot produce 64 bit binaries, and 32 bit support is disabled]) + fi + AC_MSG_WARN([compiler cannot produce 64 bit binaries - disabling 64 bit support]) + enable_64bit="no" +fi + +if test "x$enable_32bit" != "xno" -a "x$compiler_has_m32" == "xno"; then + if test "x$enable_64bit" == "xno"; then + AC_MSG_ERROR([compiler cannot produce 32 bit binaries, and 64 bit support is disabled]) + fi + AC_MSG_WARN([compiler cannot produce 32 bit binaries - disabling 32 bit support]) + enable_32bit="no" +fi + +# define the automake and config.h variables +if test "x$enable_32bit" != "xno"; then + AC_DEFINE([OPT_M32], [], [32 bit support]) + AC_SUBST(OPT_M32) +fi +AM_CONDITIONAL([OPT_M32], [test "x$enable_32bit" != "xno"]) +if test "x$enable_64bit" != "xno"; then + AC_DEFINE([OPT_M64], [], [64 bit support]) + AC_SUBST(OPT_M64) +fi +AM_CONDITIONAL([OPT_M64], [test "x$enable_64bit" != "xno"]) +if test "x$enable_ia64" != "xno"; then + AC_DEFINE([OPT_IA64], [], [embed IA64 driver files]) + AC_SUBST(OPT_IA64) +fi + +if test "x$enable_64bit" != "xno"; then + # the default is to produce 32 bit, when both 64 and 32 bit support are available + if test "x$enable_32bit" != "xno"; then + AC_MSG_NOTICE([will produce 32 bit library and samples, compatible with 64 bit platforms]) + AC_MSG_NOTICE([if you want to produce 64 bit only library and samples, use --disable-32bit]) + ARCH_CFLAGS="-m32" + ARCH_RCFLAGS="--target=pe-i386" + + else + AC_MSG_WARN([will produce a 64 bit library that is INCOMPATIBLE with 32 bit platforms]) + ARCH_CFLAGS="-m64 -D_WIN64" + ARCH_RCFLAGS="" + fi +else + AC_MSG_WARN([will produce a 32 bit library that is INCOMPATIBLE with 64 bit platforms]) + ARCH_CFLAGS="" + ARCH_RCFLAGS="" + +fi +AC_SUBST([ARCH_CFLAGS]) +AC_SUBST([ARCH_RCFLAGS]) + +if test "x$DDK_DIR" != "x"; then + # check that the required WinUSB DDK files are available + if test "x$enable_64bit" != "xno"; then + # NB: I found the hard way that cygwin doesn't like multiple files to be provided on multiple lines - YOU HAVE BEEN WARNED! + AC_CHECK_FILES([$DDK_DIR/redist/wdf/amd64/WdfCoInstaller${WDF_VER}.dll $DDK_DIR/redist/winusb/amd64/winusbcoinstaller2.dll],, + [AC_MSG_ERROR([the WinUSB amd64 driver files could not be detected (--with-ddkdir)])]) + fi + if test "x$enable_32bit" != "xno"; then + AC_CHECK_FILES([$DDK_DIR/redist/wdf/x86/WdfCoInstaller${WDF_VER}.dll $DDK_DIR/redist/winusb/x86/winusbcoinstaller2.dll],, + [AC_MSG_ERROR([the WinUSB x86 driver files could not be detected (--with-ddkdir)])]) + fi + if test "x$enable_ia64" != "xno"; then + AC_CHECK_FILES([$DDK_DIR/redist/wdf/ia64/WdfCoInstaller${WDF_VER}.dll $DDK_DIR/redist/winusb/ia64/winusbcoinstaller2.dll],, + [AC_MSG_ERROR([the WinUSB ia64 driver files could not be detected (--with-ddkdir)])]) + fi +fi + +if test "x$LIBUSB0_DIR" != "x"; then + # check that the required libusb0 driver files are available + AC_CHECK_FILES([$LIBUSB0_DIR/bin/x86/libusb0.sys $LIBUSB0_DIR/bin/x86/libusb0_x86.dll],, + [AC_MSG_ERROR([the libusb0 x86 driver files could not be detected (--with-libusb0)])]) + if test "x$enable_64bit" != "xno"; then + AC_CHECK_FILES([$LIBUSB0_DIR/bin/amd64/libusb0.sys $LIBUSB0_DIR/bin/amd64/libusb0.dll],, + [AC_MSG_ERROR([the libusb0 amd64 driver files could not be detected (--with-libusb0)])]) + fi + if test "x$enable_ia64" != "xno"; then + AC_CHECK_FILES([$LIBUSB0_DIR/bin/ia64/libusb0.sys $LIBUSB0_DIR/bin/ia64/libusb0.dll],, + [AC_MSG_ERROR([the libusb0 ia64 driver files could not be detected (--with-libusb0)])]) + fi +fi + +if test "x$USER_DIR" != "x"; then + AC_CHECK_FILE([$USER_DIR],,[AC_MSG_ERROR([the custom driver directory could not be detected (--with-userdir)])]) +fi + +# Message logging +AC_ARG_ENABLE([log], [AS_HELP_STRING([--enable-log], [enable logging (default y)])], + [log_enabled=$enableval], + [log_enabled='yes']) +if test "x$log_enabled" != "xno"; then + AC_DEFINE([ENABLE_LOGGING], 1, [Message logging]) +fi + +AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log], + [force debug logging always (default n)])], + [debug_log_enabled=$enableval], + [debug_log_enabled='no']) + +AC_ARG_ENABLE([toggable-debug], [AS_HELP_STRING([--enable-toggable-debug], + [enable switchable debug logging (default n)])], + [toggable_debug=$enableval], + [toggable_debug='no']) + +if test "x$debug_log_enabled" != "xno"; then + AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Debug message logging (forced)]) +else + if test "x$toggable_debug" != "xno"; then + AC_DEFINE([INCLUDE_DEBUG_LOGGING], 1, [Debug message logging (toggable)]) + fi +fi + +# --enable-debug : check whether they want to have debug symbols: +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [include debug symbols for gdb (default y)]), + [debug_enabled=$enableval], + [debug_enabled='yes']) +if test "x$debug_enabled" = "xyes" ; then + CFLAGS="-g -O2" +else + CFLAGS="-O2" +fi + +# Examples build +AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build], + [build example applications (default n)])], + [build_examples=$enableval], + [build_examples='no']) +AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"]) + +# check for -Wno-pointer-sign compiler support (GCC >= 4) +saved_cflags="$CFLAGS" +CFLAGS="$CFLAGS -Wno-pointer-sign" +AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), + nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="") +CFLAGS="$saved_cflags" + +AM_CFLAGS="$AM_CFLAGS -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags" + +AC_SUBST(VISIBILITY_CFLAGS) +AC_SUBST(AM_CFLAGS) +AC_SUBST(AM_LDFLAGS) +AC_SUBST(NO_CYGWIN) +AC_SUBST(LIBCONFIG_CFLAGS) +AC_SUBST(LIBCONFIG_LIBADD) + +AC_CONFIG_FILES([Makefile] [libwdi/Makefile] [examples/libconfig/Makefile] [examples/Makefile]) +AC_OUTPUT diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ddk_build.cmd b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ddk_build.cmd new file mode 100644 index 0000000..faff409 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/ddk_build.cmd @@ -0,0 +1,196 @@ +@rem default builds static library. +@rem you can pass the following arguments (case insensitive): +@rem - "DLL" to build a DLL instead of a static library +@rem - "no_samples" to build the library only +@echo off + +if Test%BUILD_ALT_DIR%==Test goto usage + +rem process commandline parameters +set TARGET=LIBRARY +set BUILD_SAMPLES=YES + +:more_args +if "%1" == "" goto no_more_args +rem /I for case insensitive +if /I Test%1==TestDLL set TARGET=DYNLINK +if /I Test%1==Testno_samples set BUILD_SAMPLES=NO +rem - shift the arguments and examine %1 again +shift +goto more_args +:no_more_args + +set DDK_DIR=%BASEDIR:\=\\% +set ORG_BUILD_ALT_DIR=%BUILD_ALT_DIR% +set ORG_BUILDARCH=%_BUILDARCH% +set ORG_PATH=%PATH% +set ORG_BUILD_DEFAULT_TARGETS=%BUILD_DEFAULT_TARGETS% + +set version=1.0 + +set cpudir=i386 +if %ORG_BUILDARCH%==x86 goto isI386 +set cpudir=amd64 +echo #define BUILD64> libwdi\build64.h +goto main_start +:isI386 +echo #define NO_BUILD64> libwdi\build64.h + +:main_start +cd libwdi +set srcPath=obj%BUILD_ALT_DIR%\%cpudir% + +del Makefile.hide >NUL 2>&1 +if EXIST Makefile ren Makefile Makefile.hide + +set 386=1 +set AMD64= +set BUILD_DEFAULT_TARGETS=-386 +set _AMD64bit= +set _BUILDARCH=x86 +set PATH=%BASEDIR%\bin\x86;%BASEDIR%\bin\x86\x86 + +copy embedder_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\i386\embedder.exe . >NUL 2>&1 + +copy installer_x86_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\i386\installer_x86.exe . >NUL 2>&1 + +set 386= +set AMD64=1 +set BUILD_DEFAULT_TARGETS=-amd64 +set _AMD64bit=true +set _BUILDARCH=AMD64 +set PATH=%BASEDIR%\bin\x86\amd64;%BASEDIR%\bin\x86 + +copy installer_x64_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\amd64\installer_x64.exe . >NUL 2>&1 + +if %ORG_BUILDARCH%==AMD64 goto restorePath +set 386=1 +set AMD64= +set BUILD_DEFAULT_TARGETS=-386 +set _AMD64bit= +set _BUILDARCH=x86 + +:restorePath +set PATH=%ORG_PATH% + +echo. +echo Embedding binary resources +embedder.exe embedded.h + +rem DLL or static lib selection (must use concatenation) +echo TARGETTYPE=%TARGET% > target +copy target+libwdi_sources sources >NUL 2>&1 +del target +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\%cpudir%\libwdi.lib . >NUL 2>&1 +copy obj%BUILD_ALT_DIR%\%cpudir%\libwdi.dll . >NUL 2>&1 + +if EXIST Makefile.hide ren Makefile.hide Makefile +cd .. +if Test%BUILD_SAMPLES%==TestNO goto done +cd examples\getopt + +del Makefile.hide >NUL 2>&1 +if EXIST Makefile ren Makefile Makefile.hide +copy getopt_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\%cpudir%\getopt.lib . >NUL 2>&1 + +if EXIST Makefile.hide ren Makefile.hide Makefile +cd ..\libconfig + +del Makefile.hide >NUL 2>&1 +if EXIST Makefile ren Makefile Makefile.hide +copy libconfig_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\%cpudir%\libconfig.lib . >NUL 2>&1 + +if EXIST Makefile.hide ren Makefile.hide Makefile +cd .. + +del Makefile.hide >NUL 2>&1 +if EXIST Makefile ren Makefile Makefile.hide +copy zadic_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\%cpudir%\zadic.exe . >NUL 2>&1 + +rem Work around MS's VC++ and DDK weird icompatibilities wth regards to rc files +echo #include ^ > afxres.h +echo #ifndef IDC_STATIC >> afxres.h +echo #define IDC_STATIC -1 >> afxres.h +echo #endif >> afxres.h +copy zadig_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +del afxres.h +copy obj%BUILD_ALT_DIR%\%cpudir%\zadig.exe . >NUL 2>&1 + +copy inf_wizard_sources sources >NUL 2>&1 +@echo on +build -cwgZ +@echo off +if errorlevel 1 goto builderror +copy obj%BUILD_ALT_DIR%\%cpudir%\inf-wizard.exe . >NUL 2>&1 + +if EXIST Makefile.hide ren Makefile.hide Makefile +cd .. + +goto done + +:builderror +if EXIST Makefile.hide ren Makefile.hide Makefile +if EXIST afxres.h del afxres.h +cd .. +echo Build failed +goto done + +:usage +echo ddk_build must be run in a Windows Driver Kit build environment +pause +goto done + +:done +set BUILD_ALT_DIR=%ORG_BUILD_ALT_DIR% +set _BUILDARCH=%ORG_BUILDARCH% +set PATH=%ORG_PATH% +set BUILD_DEFAULT_TARGETS=%ORG_BUILD_DEFAULT_TARGETS% + +if Test%DDK_TARGET_OS%==TestWinXP goto nowarn + +echo. +echo. +echo WARNING: You do not seem to use the Windows XP DDK build environment. +echo Be mindful that using the Windows Vista or Windows 7 DDK build environments +echo will result in library and applications that do NOT run on Windows XP. +echo. + +:nowarn diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/Makefile.am b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/Makefile.am new file mode 100644 index 0000000..89f1486 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/Makefile.am @@ -0,0 +1,45 @@ +INCLUDES = -I$(top_srcdir) + +BUILT_SOURCES = embedded.h +noinst_PROGRAMS = embedder +noinst_EXES = embedder.exe +lib_LTLIBRARIES = libwdi.la +LIB_SRC = resource.h logging.h tokenizer.h installer.h libwdi.h logging.c tokenizer.c vid_data.c libwdi_dlg.c libwdi.c + +if OPT_M32 +noinst_PROGRAMS += installer_x86 +noinst_EXES += installer_x86.exe +installer_x86_SOURCES = installer.h installer.c +installer_x86_CFLAGS = -m32 $(NO_CYGWIN) $(AM_CFLAGS) +installer_x86_LDFLAGS = $(NO_CYGWIN) $(AM_LDFLAGS) -static +installer_x86_LDADD = -lsetupapi -lnewdev +endif + +if OPT_M64 +noinst_PROGRAMS += installer_x64 +noinst_EXES += installer_x64.exe +installer_x64_CC = gcc $(NO_CYGWIN) +installer_x64_SOURCES = installer.h installer.c +installer_x64_CFLAGS = -m64 -D_WIN64 $(NO_CYGWIN) $(AM_CFLAGS) +installer_x64_LDFLAGS = $(NO_CYGWIN) $(AM_LDFLAGS) -static +installer_x64_LDADD = -lsetupapi -lnewdev +endif + +embedder_SOURCES = embedder.h embedder_files.h embedder.c +embedder_LDADD = -lversion + +EXTRA_DIST = $(LIB_SRC) + +libwdi_rc.lo: libwdi.rc + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(ARCH_RCFLAGS) -i $< -o $@ + +libwdi_la_CFLAGS = $(ARCH_CFLAGS) $(NO_CYGWIN) $(VISIBILITY_CFLAGS) $(AM_CFLAGS) +libwdi_la_LDLAGS = $(NO_CYGWIN) $(AM_LDFLAGS) +libwdi_la_LIBADD = libwdi_rc.lo -lsetupapi -lole32 +libwdi_la_SOURCES = $(LIB_SRC) + +embedded.h: $(noinst_EXES) + ./embedder.exe embedded.h + +clean-local: + -rm -rf embedded.h diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/build64.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/build64.h new file mode 100644 index 0000000..f4e575a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/build64.h @@ -0,0 +1 @@ +#define NO_BUILD64 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder.c new file mode 100644 index 0000000..c33b776 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder.c @@ -0,0 +1,406 @@ +/* + * embedder : converts binary resources into a .h include + * "If you can think of a better way to get ice, I'd like to hear it." + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * This tool is meant to be call as a pre-built event when compiling the + * installer library, to produce a .h that embeds all the necessary driver + * binary resources. + * + * This is required work around the many limitations of resource files, as + * well as the impossibility to force the MS linker to embed resources always + * with a static library (unless the library is split into .res + .lib) + */ + +#include +#include +#include +#include +#include +#include "embedder.h" +#include "embedder_files.h" + +#define safe_free(p) do {if (p != NULL) {free(p); p = NULL;}} while(0) + +#if defined(__CYGWIN__ ) +#include // for basename() +#define _MAX_FNAME 256 +#define _MAX_EXT 256 +extern int _snprintf(char *buffer, size_t count, const char *format, ...); +// Hack a _splitpath() for cygwin, according to our *very specific* needs +void __inline _splitpath(char *path, char *drive, char *dir, char *fname, char *ext) { + strncpy(fname, basename(path), _MAX_FNAME); + ext[0] = 0; +} +#endif + +const int nb_embeddables_fixed = sizeof(embeddable_fixed)/sizeof(struct emb); +int nb_embeddables; +struct emb* embeddable = embeddable_fixed; +#if defined(USER_DIR) +char initial_dir[] = USER_DIR; +#endif + +void dump_buffer_hex(FILE* fd, unsigned char *buffer, size_t size) +{ + size_t i; + + // Make sure we output something even if the original file is empty + if (size == 0) { + fprintf(fd, "0x00"); + } + + for (i=0; i=nb_embeddables) || (rebuild) ) + break; + file_handle = CreateFileA(embeddable[i].file_name, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, 0, NULL); + if (file_handle != INVALID_HANDLE_VALUE) { + file_time.dwHighDateTime = 0; file_time.dwLowDateTime = 0; + GetFileTime(file_handle, NULL, NULL, &file_time); + if (CompareFileTime(&header_time, &file_time) <= 0) { + rebuild = TRUE; + break; + } + } + } + CloseHandle(header_handle); + } + + if (!rebuild) { + printf(" resources haven't changed - skipping step\n"); + return 0; + } + + size = sizeof(size_t)*nb_embeddables; + file_size = malloc(size); + if (file_size == NULL) { + fprintf(stderr, "Couldn't even allocate a measly %d bytes\n", (int)size); + return 1; + } + + header_fd = fopen(argv[1], "w"); + if (header_fd == NULL) { + fprintf(stderr, "Can't create file '%s'\n", argv[1]); + ret = 1; + goto out1; + } + fprintf(header_fd, "#pragma once\n"); + + for (i=0; i MAX_PATH)) { + fprintf(stderr, "Unable to get full path for %s\n", embeddable[i].file_name); + ret = 1; + goto out2; + } + printf("Embedding '%s' ", fullpath); + fd = fopen(embeddable[i].file_name, "rb"); + if (fd == NULL) { + fprintf(stderr, "Couldn't open file '%s'\n", fullpath); + ret = 1; + goto out2; + } + + // Identify the WinUSB and libusb0 files we'll pick the date & version of + for (j=(int)strlen(embeddable[i].file_name); j>=0; j--) { + if (embeddable[i].file_name[j] == '\\') break; + } + drv_index = -1; + if (strcmp(&embeddable[i].file_name[j+1], "winusbcoinstaller2.dll") == 0) { + drv_index = 0; + } else if (strcmp(&embeddable[i].file_name[j+1], "libusb0.sys") == 0) { + drv_index = 1; + } + + // Read the creation date (once more) + file_data.ftCreationTime.dwHighDateTime = 0; + file_data.ftCreationTime.dwLowDateTime = 0; + if ( (FindFirstFileA(fullpath, &file_data) != INVALID_HANDLE_VALUE) + && (FileTimeToSystemTime(&file_data.ftCreationTime, &file_date)) ) { + printf("(%04d.%02d.%02d", file_date.wYear, file_date.wMonth, file_date.wDay); + } + + // Read the version + version_size = GetFileVersionInfoSizeA(fullpath, NULL); + version_buf = malloc(version_size); + if (version_buf != NULL) { + if ( (GetFileVersionInfoA(fullpath, 0, version_size, version_buf)) + && (VerQueryValueA(version_buf, "\\", (void*)&file_info, &junk)) ) { + printf(", v%d.%d.%d.%d)", (int)file_info->dwFileVersionMS>>16, (int)file_info->dwFileVersionMS&0xFFFF, + (int)file_info->dwFileVersionLS>>16, (int)file_info->dwFileVersionLS&0xFFFF); + if ( (drv_index != -1) && (drv_info[drv_index].dwSignature == 0) ) { + printf("*"); + memcpy(&drv_info[drv_index], file_info, sizeof(VS_FIXEDFILEINFO)); + drv_info[drv_index].dwFileDateLS = file_data.ftCreationTime.dwLowDateTime; + drv_info[drv_index].dwFileDateMS = file_data.ftCreationTime.dwHighDateTime; + } + } else { + printf(")"); + } + free(version_buf); + } + printf("\n"); + + fseek(fd, 0, SEEK_END); + size = (size_t)ftell(fd); + fseek(fd, 0, SEEK_SET); + file_size[i] = size; + + buffer = (unsigned char*) malloc(size); + if (buffer == NULL) { + fprintf(stderr, "Couldn't allocate buffer"); + ret = 1; + goto out3; + } + + if (fread(buffer, 1, size, fd) != size) { + fprintf(stderr, "Read error"); + ret = 1; + goto out4; + } + fclose(fd); + + _snprintf(internal_name, sizeof(internal_name), "file_%03X", (unsigned char)i); + fprintf(header_fd, "const unsigned char %s[] = {", internal_name); + dump_buffer_hex(header_fd, buffer, size); + fprintf(header_fd, "};\n\n"); + safe_free(buffer); + fclose(fd); + } + + fprintf(header_fd, "struct res {\n" \ + "\tchar* subdir;\n" \ + "\tchar* name;\n" \ + "\tsize_t size;\n" \ + "\tconst unsigned char* data;\n" \ + "};\n\n"); + + fprintf(header_fd, "const struct res resource[] = {\n"); + for (i=0; i + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#pragma once + +#if !defined(OPT_M32) && !defined(OPT_M64) +#error both 32 and 64 bit support have been disabled - check your config.h +#endif + +#if !defined(DDK_DIR) && !defined(LIBUSB0_DIR) && !defined(USER_DIR) +#error at least one of DDK_DIR, LIBUSB0_DIR or USER_DIR must be defined - check your config.h +#endif + +// Some adjustment is needed for MSVC +#if defined(_MSC_VER) +// Because the embedder is compiled as 32 bit always, we detect +// 64 bit MS compilations through an additional include +#include "build64.h" +#define __STR2__(x) #x +#define __STR1__(x) __STR2__(x) +#if (defined(_WIN64) || defined(BUILD64)) && defined(OPT_M32) +// a 64 bit application/library CANNOT be used on 32 bit platforms +#pragma message(__FILE__ "(" __STR1__(__LINE__) ") : warning : library is compiled as 64 bit - disabling 32 bit support") +#undef OPT_M32 +#endif +#endif + +/* + * Defines where we should we pick the 32 and 64 bit installer exes to embed + */ +#if defined(_MSC_VER) && !defined(DDKBUILD) +#if !defined(SOLUTIONDIR) +#define SOLUTIONDIR ".." +#endif +#if defined(_DEBUG) +#define INSTALLER_PATH_32 SOLUTIONDIR "\\Win32\\Debug\\helper" +#define INSTALLER_PATH_64 SOLUTIONDIR "\\x64\\Debug\\helper" +#else +#define INSTALLER_PATH_32 SOLUTIONDIR "\\Win32\\Release\\helper" +#define INSTALLER_PATH_64 SOLUTIONDIR "\\x64\\Release\\helper" +#endif +#else +#if !defined(SOLUTIONDIR) +#define SOLUTIONDIR "." +#endif +// If you compile with shared libs, DON'T PICK THE EXE IN "installer", +// as it won't run from ANYWHERE ELSE! Use the one from .libs instead. +#define INSTALLER_PATH_32 SOLUTIONDIR +#define INSTALLER_PATH_64 SOLUTIONDIR +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcproj new file mode 100644 index 0000000..e02b453 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcproj @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj new file mode 100644 index 0000000..fb6eabd --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj @@ -0,0 +1,116 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + embedder + {792D44D5-28A7-4EB3-B84B-8021FE3189F9} + embedder + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\$(ProjectName)\ + true + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\$(ProjectName)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + $(IntDir)$(ProjectName).htm + + + Disabled + ..\msvc;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;USER_DIR="";OPT_M32;OPT_M64;SOLUTIONDIR="..\\..\\..";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + + + Level3 + EditAndContinue + + + version.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + true + $(TargetDir)$(ProjectName).pdb + Console + MachineX86 + + + + + $(IntDir)$(ProjectName).htm + + + MaxSpeed + true + ..\msvc;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;USER_DIR="";OPT_M32;OPT_M64;SOLUTIONDIR="..\\..\\..";%(PreprocessorDefinitions) + MultiThreaded + true + + + Level3 + ProgramDatabase + + + version.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + Console + true + true + MachineX86 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.filters new file mode 100644 index 0000000..308e1e4 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {AF571DD9-AF6B-4F0A-9A9E-D041D12982F7} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {73d653ba-adc0-4b92-812a-573971d03d26} + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_files.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_files.h new file mode 100644 index 0000000..bf67c11 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_files.h @@ -0,0 +1,90 @@ +/* + * embedder : converts binary resources into a .h include + * "If you can think of a better way to get ice, I'd like to hear it." + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#pragma once + +/* + * This include defines the driver files that should be embedded in the library + * If you want to add extra files from a specific directory (eg signed inf and cat) + * you should either define the macro USER_DIR in msvc/config.h (MS compilers) or + * use the --with-userdir option when running configure. + */ + +struct emb { + char* file_name; + char* extraction_subdir; +}; + +/* + * files to embed + */ +struct emb embeddable_fixed[] = { + +// 32 bit driver files +#if defined(OPT_M32) +#if defined(DDK_DIR) + { DDK_DIR "\\redist\\wdf\\x86\\WdfCoInstaller" WDF_VER ".dll", "x86" }, + { DDK_DIR "\\redist\\winusb\\x86\\winusbcoinstaller2.dll", "x86" }, +#endif + { INSTALLER_PATH_32 "\\installer_x86.exe", "." }, +#endif + +// 64 bit driver files +#if defined(OPT_M64) +#if defined(DDK_DIR) + { DDK_DIR "\\redist\\wdf\\amd64\\WdfCoInstaller" WDF_VER ".dll", "amd64" }, + { DDK_DIR "\\redist\\winusb\\amd64\\winusbcoinstaller2.dll", "amd64" }, +#endif +#if defined(LIBUSB0_DIR) + { LIBUSB0_DIR "\\bin\\amd64\\libusb0.dll", "amd64" }, + { LIBUSB0_DIR "\\bin\\amd64\\libusb0.sys", "amd64" }, +#endif + { INSTALLER_PATH_64 "\\installer_x64.exe", "." }, +#endif + +// IA64 (Itanium) driver files +#if defined(OPT_IA64) +#if defined(DDK_DIR) + { DDK_DIR "\\redist\\wdf\\ia64\\WdfCoInstaller" WDF_VER ".dll", "ia64" }, + { DDK_DIR "\\redist\\winusb\\ia64\\winusbcoinstaller2.dll", "ia64" }, +#endif +#if defined(LIBUSB0_DIR) + { LIBUSB0_DIR "\\bin\\ia64\\libusb0.dll", "ia64" }, + { LIBUSB0_DIR "\\bin\\ia64\\libusb0.sys", "ia64" }, +#endif +#endif + +// Common driver files +// On 64 bit, for WOW64, we must include the 32 bit libusb0 files as well +#if defined(LIBUSB0_DIR) + { LIBUSB0_DIR "\\bin\\x86\\libusb0_x86.dll", "x86" }, + { LIBUSB0_DIR "\\bin\\x86\\libusb0.sys", "x86" }, + { LIBUSB0_DIR "\\installer_license.txt", "license\\libusb-win32" }, + { LIBUSB0_DIR "\\bin\\libusb-win32-bin-README.txt", ".\\" }, +#endif +#if defined(DDK_DIR) + { DDK_DIR "\\license.rtf", "license\\WinUSB" }, // WinUSB License file +#endif + +// inf templates for the tokenizer ("" directory means no extraction) + { "winusb.inf.in", "" }, + { "libusb-win32.inf.in", "" }, +}; + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_sources b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_sources new file mode 100644 index 0000000..37d4713 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_sources @@ -0,0 +1,20 @@ +TARGETNAME=embedder +TARGETTYPE=PROGRAM + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +UMTYPE=console +UMBASE=0x01000000 + +INCLUDES=..\msvc;$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\version.lib + +SOURCES=embedder.c diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer.c new file mode 100644 index 0000000..d2949df --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer.c @@ -0,0 +1,681 @@ +/* + * Library for WinUSB/libusb automated driver installation + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +// This standalone installer is a separate exe, as it needs +// - administrative rights, and therefore UAC elevation on platforms that use UAC +// - native 32 or 64 bit execution according to the platform + +#include +#include +#include +#include +#include +#include +#include + +#include "installer.h" +#include "libwdi.h" +#include "msapi_utf8.h" + +// DDK complains about checking a const string against NULL +#if defined(DDKBUILD) +#pragma warning(disable:4130) +#endif + +#define REQUEST_TIMEOUT 5000 + +// UpdateDriverForPlugAndPlayDevices.InstallFlags constants +#define INSTALLFLAG_FORCE 0x00000001 +#define INSTALLFLAG_READONLY 0x00000002 +#define INSTALLFLAG_NONINTERACTIVE 0x00000004 +#define INSTALLFLAG_BITS 0x00000007 + +/* + * Cfgmgr32.dll interface + */ +typedef CHAR *DEVNODEID_A, *DEVINSTID_A; +typedef WCHAR *DEVNODEID_W, *DEVINSTID_W; +#ifdef UNICODE +typedef DEVNODEID_W DEVNODEID; +typedef DEVINSTID_W DEVINSTID; +#else +typedef DEVNODEID_A DEVNODEID; +typedef DEVINSTID_A DEVINSTID; +#endif + +DLL_DECLARE(WINAPI, CONFIGRET, CM_Locate_DevNode, (PDEVINST, DEVINSTID, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Reenumerate_DevNode, (DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_DevNode_Status, (PULONG, PULONG, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, int, __wgetmainargs, (int*, wchar_t***, wchar_t***, int, int*)); + +/* + * Globals + */ +HANDLE pipe_handle = INVALID_HANDLE_VALUE; +HANDLE syslog_ready_event = INVALID_HANDLE_VALUE; +HANDLE syslog_terminate_event = INVALID_HANDLE_VALUE; +PSID user_psid = NULL; + +// Setup the Cfgmgr32 DLLs +static int init_dlls(void) +{ + DLL_LOAD(Cfgmgr32.dll, CM_Locate_DevNode, TRUE); + DLL_LOAD(Cfgmgr32.dll, CM_Reenumerate_DevNode, TRUE); + DLL_LOAD(Cfgmgr32.dll, CM_Get_DevNode_Status, TRUE); + DLL_LOAD(Msvcrt.dll, __wgetmainargs, FALSE); + return 0; +} + +// Log data with parent app through the pipe +void plog_v(const char *format, va_list args) +{ + char buffer[STR_BUFFER_SIZE]; + DWORD junk; + int size; + + if (pipe_handle == INVALID_HANDLE_VALUE) + return; + + buffer[0] = IC_PRINT_MESSAGE; + + size = safe_vsnprintf(buffer+1, STR_BUFFER_SIZE-1, format, args); + if (size < 0) { + buffer[STR_BUFFER_SIZE-1] = 0; + size = STR_BUFFER_SIZE-2; + } + WriteFile(pipe_handle, buffer, (DWORD)size+2, &junk, NULL); +} + +void plog(const char *format, ...) +{ + va_list args; + + va_start (args, format); + plog_v(format, args); + va_end (args); +} + +// Notify the parent app +void send_status(char status) +{ + DWORD junk; + WriteFile(pipe_handle, &status, 1, &junk, NULL); +} + +// Post a WDI status code +void pstat(int status) +{ + char data[2]; + DWORD junk; + + data[0] = IC_SET_STATUS; + data[1] = (char)status; + WriteFile(pipe_handle, data, 2, &junk, NULL); +} + +// Query the parent app for data +int request_data(char req, void *buffer, int size) +{ + OVERLAPPED overlapped; + DWORD rd_count; + DWORD r, count = (DWORD)size; + + if ((buffer == NULL) || (size <= 0)) { + return -1; + } + + // Set the overlapped for messaging + memset(&overlapped, 0, sizeof(OVERLAPPED)); + overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + if (overlapped.hEvent == NULL) { + plog("failed to create overlapped"); + return -1; + } + + if (ReadFile(pipe_handle, buffer, count, &rd_count, &overlapped)) { + // Message was read synchronously + plog("received unexpected data"); + CloseHandle(overlapped.hEvent); + return -1; + } + + if (GetLastError() != ERROR_IO_PENDING) { + plog("failure to initiate read (%d)", (int)GetLastError()); + CloseHandle(overlapped.hEvent); + return -1; + } + + // Now that we're set to receive data, let's send our request + WriteFile(pipe_handle, &req, 1, &r, NULL); + + // Wait for the response + r = WaitForSingleObject(overlapped.hEvent, REQUEST_TIMEOUT); + if ( (r == WAIT_OBJECT_0) && (GetOverlappedResult(pipe_handle, &overlapped, &rd_count, FALSE)) ) { + CloseHandle(overlapped.hEvent); + return (int)rd_count; + } + + if (r == WAIT_TIMEOUT) { + plog("message request: timed out"); + } else { + plog("read error: %d", (int)GetLastError()); + } + CloseHandle(overlapped.hEvent); + return -1; +} + +// Query parent app for device ID +char* req_id(enum installer_code id_code) +{ + int size; + char* id_text[3] = {"device_id", "hardware_id", "user_sid"}; + static char device_id[MAX_PATH_LENGTH]; + static char hardware_id[MAX_PATH_LENGTH]; + static char user_sid[MAX_PATH_LENGTH]; + char* id = NULL; + + switch(id_code) { + case IC_GET_DEVICE_ID: + id = device_id; + break; + case IC_GET_HARDWARE_ID: + id = hardware_id; + break; + case IC_GET_USER_SID: + id = user_sid; + break; + default: + plog("req_id: unknown ID requested"); + return NULL; + } + + memset(id, 0, MAX_PATH_LENGTH); + size = request_data(id_code, (void*)id, MAX_PATH_LENGTH); + if (size > 0) { + plog("got %s: %s", id_text[id_code-IC_GET_DEVICE_ID], id); + return id; + } + + plog("failed to read %s", id_text[id_code-IC_GET_DEVICE_ID]); + return NULL; +} + +/* + * Flag phantom/removed devices for reinstallation. See: + * http://msdn.microsoft.com/en-us/library/aa906206.aspx + */ +void check_removed(char* device_hardware_id) +{ + unsigned i, removed = 0; + DWORD size, reg_type, config_flags; + ULONG status, pbm_number; + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + char hardware_id[STR_BUFFER_SIZE]; + + // List all known USB devices (including non present ones) + dev_info = SetupDiGetClassDevsA(NULL, "USB", NULL, DIGCF_ALLCLASSES); + if (dev_info == INVALID_HANDLE_VALUE) { + return; + } + + // Find the ones that are driverless + for (i = 0; ; i++) + { + dev_info_data.cbSize = sizeof(dev_info_data); + if (!SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data)) { + break; + } + + // Find the hardware ID + if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_HARDWAREID, + ®_type, (BYTE*)hardware_id, STR_BUFFER_SIZE, &size)) { + continue; + } + + // Match? + if (safe_strncmp(hardware_id, device_hardware_id, STR_BUFFER_SIZE) != 0) { + continue; + } + + // Unplugged? + if (CM_Get_DevNode_Status(&status, &pbm_number, dev_info_data.DevInst, 0) != CR_NO_SUCH_DEVNODE) { + continue; + } + + // Flag for reinstall on next plugin + if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_CONFIGFLAGS, + ®_type, (BYTE*)&config_flags, sizeof(DWORD), &size)) { + plog("could not read SPDRP_CONFIGFLAGS for phantom device %s", hardware_id); + continue; + } + config_flags |= CONFIGFLAG_REINSTALL; + if (!SetupDiSetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_CONFIGFLAGS, + (BYTE*)&config_flags, sizeof(DWORD))) { + plog("could not write SPDRP_CONFIGFLAGS for phantom device %s", hardware_id); + continue; + } + removed++; + } + + if (removed) { + plog("flagged %d removed devices for reinstallation", removed); + } +} + +/* + * Converts a default system locate string to UTF-8 + * (allocate returned string with 1 extra leading byte) + * Returns NULL on error + */ +static __inline char* xlocale_to_utf8(const char* str) +{ + int size = 0; + wchar_t* wstr = NULL; + char* ustr = NULL; + + // locale -> unicode + size = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0); + if (size <= 1) + return NULL; + + if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL) + return NULL; + + if (MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, size) != size) { + free(wstr); + return NULL; + } + + // unicode -> UTF-8 + size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + if (size <= 1) { + free(wstr); + return NULL; + } + + // +1 for extra leading byte + if ((ustr = (char*)calloc(size+1, 1)) == NULL) { + free(wstr); + return NULL; + } + + if (wchar_to_utf8_no_alloc(wstr, ustr+1, size) != size) { + free(ustr); + free(wstr); + return NULL; + } + free(wstr); + + return ustr; +} + +/* + * Send individual lines of the syslog section pointed by buffer back to the main application + * xbuffer's payload MUST start at byte 1 to accomodate the SYSLOG_MESSAGE prefix + */ +DWORD process_syslog(char* buffer, DWORD size) +{ + DWORD i, write_size, junk, start = 0; + char* xbuffer; + char* ins_string = ""; + char conversion_error[] = " ERROR: Unable to convert log entry to UTF-8"; + + if (buffer == NULL) return 0; + + // CR/LF breakdown + for (i=0; i" line in any log file, it's game over then + if (safe_strcmp(ins_string, buffer + start) == 0) { + return start; + } + + // The logs are using the system locale. Convert to UTF8 (with extra leading byte) + xbuffer = xlocale_to_utf8(&buffer[start]); + if (xbuffer == NULL) { + xbuffer = conversion_error; + } + + // This is where we use the extra start byte + xbuffer[0] = IC_SYSLOG_MESSAGE; + WriteFile(pipe_handle, xbuffer, (DWORD)safe_strlen(&xbuffer[1])+2, &junk, NULL); + if (xbuffer != conversion_error) { + free(xbuffer); + } + start = i; + } + } + // start does not necessarily equate size, if there are truncated lines at the end + return start; +} + +/* + * Read from the driver installation syslog in real-time + */ +void __cdecl syslog_reader_thread(void* param) +{ +#define NB_SYSLOGS 3 + char* syslog_name[NB_SYSLOGS] = { "\\inf\\setupapi.dev.log", "\\setupapi.log", "\\setupact.log" }; + HANDLE log_handle; + DWORD last_offset, size, read_size, processed_size; + char *buffer = NULL; + char log_path[MAX_PATH_LENGTH]; + DWORD duration = 0; + int i; + + // Try the various driver installation logs + for (i=0; i failed to open inf + // r = 5 ERROR_ACCESS_DENIED if needs admin elevation + // r = 0xD ERROR_INVALID_DATA => inf is missing some data + // r = 0xE0000003 ERROR_GENERAL_SYNTAX the syntax of the inf is invalid or the inf is empty + // r = 0xE0000217 ERROR_BAD_SERVICE_INSTALLSECT happens if referencing a non present sys in svc section + // r = 0xE0000304 ERROR_INVALID_CATALOG_DATA => no cat + // r = 0xE000023F ERROR_NO_AUTHENTICODE_CATALOG => user cancelled on warnings + // r = 0xE0000235 ERROR_IN_WOW64 => trying to run a 32 bit installer on a 64 bit machine + // r = 0xE0000247 ERROR_DRIVER_STORE_ADD_FAILED if user decided not to install on warnings + // r = 0xE0000203 ERROR_NO_DRIVER_SELECTED if the driver provided is not compatible with the target platform + // r = 0x800B0100 ERROR_WRONG_INF_STYLE => missing cat entry in inf + // r = 0xE000022F ERROR_NO_CATALOG_FOR_OEM_INF => "reject unsigned driver" policy is enforced + // r = 0xB7 => missing DRIVER_PACKAGE_REPAIR flag + switch(r) { + case ERROR_NO_MORE_ITEMS: + plog("more recent driver was found (force option required)"); + return WDI_ERROR_EXISTS; + case ERROR_NO_SUCH_DEVINST: + plog("device not detected (copying driver files for next time device is plugged in)"); + return WDI_SUCCESS; + case ERROR_INVALID_PARAMETER: + plog("invalid path or hardware ID"); + return WDI_ERROR_INVALID_PARAM; + case ERROR_FILE_NOT_FOUND: + plog("the system can not find the file specified"); + return WDI_ERROR_NOT_FOUND; + case ERROR_ACCESS_DENIED: + plog("this process needs to be run with administrative privileges"); + return WDI_ERROR_NEEDS_ADMIN; + case ERROR_IN_WOW64: + plog("attempted to use a 32 bit installer on a 64 bit machine"); + return WDI_ERROR_WOW64; + case ERROR_INVALID_DATA: + case ERROR_WRONG_INF_STYLE: + case ERROR_GENERAL_SYNTAX: + plog("the syntax of the inf is invalid"); + return WDI_ERROR_INF_SYNTAX; + case ERROR_BAD_SERVICE_INSTALLSECT: + plog("a section of the inf has a problem"); + return WDI_ERROR_INF_SYNTAX; + case ERROR_INVALID_CATALOG_DATA: + plog("unable to locate cat file"); + return WDI_ERROR_CAT_MISSING; + case ERROR_NO_AUTHENTICODE_CATALOG: + case ERROR_DRIVER_STORE_ADD_FAILED: + plog("operation cancelled by the user"); + return WDI_ERROR_USER_CANCEL; + case ERROR_NO_DRIVER_SELECTED: + plog("the driver is not compatible with this version of Windows"); + return WDI_ERROR_NOT_SUPPORTED; + case ERROR_ALREADY_EXISTS: + plog("driver already exists"); + return WDI_ERROR_EXISTS; + case ERROR_NO_CATALOG_FOR_OEM_INF: + plog("your system policy has been modified from Windows defaults, and"); + plog("is set to reject unsigned drivers. You must revert the driver"); + plog("installation policy to default if you want to install this driver."); + plog("see http://articles.techrepublic.com.com/5100-10878_11-5875443.html"); + return WDI_ERROR_UNSIGNED; + default: + plog("unhandled error %X", r); + return WDI_ERROR_OTHER; + } +} + +// TODO: allow commandline options (v2) +// TODO: remove existing infs for similar devices (v2) +int __cdecl main(int argc_ansi, char** argv_ansi) +{ + DWORD r; + BOOL b; + int i, ret, argc = argc_ansi, si=0; + char** argv = argv_ansi; + wchar_t **wenv, **wargv; + char* hardware_id = NULL; + char* device_id = NULL; + char* user_sid = NULL; + char* inf_name = NULL; + char path[MAX_PATH_LENGTH]; + char destname[MAX_PATH_LENGTH]; + uintptr_t syslog_reader_thid = -1L; + + // Connect to the messaging pipe + pipe_handle = CreateFileA(INSTALLER_PIPE_NAME, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, NULL); + if (pipe_handle == INVALID_HANDLE_VALUE) { + // If we can't connect to the pipe, someone is probably trying to run us standalone + printf("This application can not be run from the command line.\n"); + printf("Please use your initial installer application if you want to install the driver.\n"); + return WDI_ERROR_NOT_SUPPORTED; + } + + if (init_dlls()) { + plog("could not init DLLs"); + ret = WDI_ERROR_RESOURCE; + goto out; + } + + // libwdi provides the arguments as UTF-16 => read them and convert to UTF-8 + if (__wgetmainargs != NULL) { + __wgetmainargs(&argc, &wargv, &wenv, 1, &si); + argv = calloc(argc, sizeof(char*)); + for (i=0; i\n", argv[0]); + plog("missing inf_name parameter"); + } + + inf_name = argv[1]; + plog("got parameter %s", argv[1]); + r = GetFullPathNameU(".", MAX_PATH_LENGTH, path, NULL); + if ((r == 0) || (r > MAX_PATH_LENGTH)) { + plog("could not retrieve absolute path of working directory"); + ret = WDI_ERROR_ACCESS; + goto out; + } + safe_strcat(path, MAX_PATH_LENGTH, "\\"); + safe_strcat(path, MAX_PATH_LENGTH, inf_name); + + device_id = req_id(IC_GET_DEVICE_ID); + hardware_id = req_id(IC_GET_HARDWARE_ID); + // Will be used if we ever need to create a file, as the original user, from this app + user_sid = req_id(IC_GET_USER_SID); + ConvertStringSidToSidA(user_sid, &user_psid); + + // Setup the syslog reader thread + syslog_ready_event = CreateEvent(NULL, TRUE, FALSE, NULL); + syslog_terminate_event = CreateEvent(NULL, TRUE, FALSE, NULL); + syslog_reader_thid = _beginthread(syslog_reader_thread, 0, 0); + if ( (syslog_reader_thid == -1L) + || (WaitForSingleObject(syslog_ready_event, 2000) != WAIT_OBJECT_0) ) { + plog("Unable to create syslog reader thread"); + SetEvent(syslog_terminate_event); + // NB: if you try to close the syslog reader thread handle, you get a + // "more recent driver was found" error from UpdateForPnP. Weird... + } + + // Find if the device is plugged in + send_status(IC_SET_TIMEOUT_INFINITE); + if ((hardware_id != NULL) && (hardware_id[0] != 0)) { + plog("Installing driver for %s - please wait...", hardware_id); + b = UpdateDriverForPlugAndPlayDevicesU(NULL, hardware_id, path, INSTALLFLAG_FORCE, NULL); + send_status(IC_SET_TIMEOUT_DEFAULT); + if (b == true) { + // Success + plog("driver update completed"); + ret = WDI_SUCCESS; + goto out; + } + + ret = process_error(GetLastError(), path); + if (ret != WDI_SUCCESS) { + goto out; + } + } + + // TODO: try URL for OEMSourceMediaLocation (v2) + plog("Copying inf file (for the next time device is plugged) - please wait..."); + send_status(IC_SET_TIMEOUT_INFINITE); + b = SetupCopyOEMInfU(path, NULL, SPOST_PATH, 0, destname, MAX_PATH_LENGTH, NULL, NULL); + send_status(IC_SET_TIMEOUT_DEFAULT); + if (b) { + plog("copied inf to %s", destname); + ret = WDI_SUCCESS; + goto out; + } + + ret = process_error(GetLastError(), path); + if (ret != WDI_SUCCESS) { + goto out; + } + + // If needed, flag removed devices for reinstallation. see: + // http://msdn.microsoft.com/en-us/library/aa906206.aspx + check_removed(hardware_id); + +out: + // Report any error status code and wait for target app to read it + send_status(IC_INSTALLER_COMPLETED); + pstat(ret); + // TODO: have libwi send an ACK? + Sleep(1000); + SetEvent(syslog_terminate_event); + if (argv != argv_ansi) { + for (i=0; i + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#pragma once + +#include +#if !defined(bool) +#define bool BOOL +#endif +#if !defined(true) +#define true TRUE +#endif +#if !defined(false) +#define false FALSE +#endif + +#define MAX_DESC_LENGTH 128 +#define MAX_PATH_LENGTH 128 +#define MAX_KEY_LENGTH 256 +#define STR_BUFFER_SIZE 256 +#define MAX_GUID_STRING_LENGTH 40 + +#define INSTALLER_PIPE_NAME "\\\\.\\pipe\\libwdi-installer" + +#define safe_free(p) do {if (p != NULL) {free((void*)p); p = NULL;}} while(0) +#define safe_min(a, b) min((size_t)(a), (size_t)(b)) +#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \ + ((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0) +#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1) +#define static_strcpy(dst, src) safe_strcpy(dst, sizeof(dst), src) +#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1)) +#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1) +#define static_strcat(dst, src) safe_strcat(dst, sizeof(dst), src) +#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2)) +#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2), count) +#define safe_closehandle(h) do {if (h != INVALID_HANDLE_VALUE) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0) +#define safe_sprintf _snprintf +#define safe_strlen(str) ((((char*)str)==NULL)?0:strlen(str)) +#define static_sprintf(dest, format, ...) safe_sprintf(dest, sizeof(dest), format, __VA_ARGS__) +#define safe_swprintf _snwprintf +#define safe_strdup _strdup + +#if defined(_MSC_VER) +#define safe_vsnprintf(buf, size, format, arg) _vsnprintf_s(buf, size, _TRUNCATE, format, arg) +#else +#define safe_vsnprintf vsnprintf +#endif + +/* + * For communications between installer <-> libwdi + */ +enum installer_code { + IC_PRINT_MESSAGE, + IC_SYSLOG_MESSAGE, + IC_GET_DEVICE_ID, + IC_GET_HARDWARE_ID, + IC_GET_USER_SID, + IC_SET_TIMEOUT_INFINITE, + IC_SET_TIMEOUT_DEFAULT, + IC_SET_STATUS, + IC_INSTALLER_COMPLETED, +}; + +/* + * Windows versions + */ +enum windows_version { + WINDOWS_UNDEFINED, + WINDOWS_UNSUPPORTED, + WINDOWS_2K, + WINDOWS_XP, + WINDOWS_2003_XP64, + WINDOWS_VISTA, + WINDOWS_7 +}; + +/* + * API macros - from libusb-win32 1.x + */ +#define DLL_DECLARE(api, ret, name, args) \ + typedef ret (api * __dll_##name##_t)args; __dll_##name##_t name = NULL + +#define DLL_LOAD(dll, name, ret_on_failure) \ + do { \ + HMODULE h = GetModuleHandle(#dll); \ + if (!h) \ + h = LoadLibrary(#dll); \ + if (!h) { \ + if (ret_on_failure) { return -1; } \ + else { break; } \ + } \ + name = (__dll_##name##_t)GetProcAddress(h, #name); \ + if (name) break; \ + name = (__dll_##name##_t)GetProcAddress(h, #name "A"); \ + if (name) break; \ + name = (__dll_##name##_t)GetProcAddress(h, #name "W"); \ + if (name) break; \ + if(ret_on_failure) \ + return WDI_ERROR_NOT_SUPPORTED; \ + } while(0) + + +/* + * Cfgmgr32.dll interface + */ +typedef DWORD DEVNODE, DEVINST; +typedef DEVNODE *PDEVNODE, *PDEVINST; +typedef DWORD RETURN_TYPE; +typedef RETURN_TYPE CONFIGRET; + +#define CR_SUCCESS 0x00000000 +#define CR_NO_SUCH_DEVNODE 0x0000000D +#define CONFIGFLAG_REINSTALL 0x00000020 + +#define CM_REENUMERATE_NORMAL 0x00000000 +#define CM_REENUMERATE_SYNCHRONOUS 0x00000001 +#define CM_REENUMERATE_RETRY_INSTALLATION 0x00000002 +#define CM_REENUMERATE_ASYNCHRONOUS 0x00000004 +#define CM_REENUMERATE_BITS 0x00000007 + +/* + * DifXApi.dll interface + */ +#define DRIVER_PACKAGE_REPAIR 0x00000001 +#define DRIVER_PACKAGE_FORCE 0x00000004 +#define DRIVER_PACKAGE_LEGACY_MODE 0x00000010 + +#define ERROR_INVALID_CATALOG_DATA 0xE0000304 +#ifndef ERROR_DRIVER_STORE_ADD_FAILED +#define ERROR_DRIVER_STORE_ADD_FAILED 0xE0000247 +#endif +#ifndef ERROR_NO_AUTHENTICODE_CATALOG +#define ERROR_NO_AUTHENTICODE_CATALOG 0xE000023F +#endif +#ifndef ERROR_IN_WOW64 +#define ERROR_IN_WOW64 0xE0000235 +#endif + +typedef enum { + DIFXAPI_SUCCESS, + DIFXAPI_INFO, + DIFXAPI_WARNING, + DIFXAPI_ERROR +} DIFXAPI_LOG; +typedef void (__cdecl* DIFXAPILOGCALLBACK)(DIFXAPI_LOG EventType, DWORD Error, LPCSTR EventDescription, PVOID CallbackContext); + +typedef struct { + LPCSTR pApplicationId; + LPCSTR pDisplayName; + LPCSTR pProductName; + LPCSTR pMfgName; +} INSTALLERINFO, *PINSTALLERINFO; +typedef const PINSTALLERINFO PCINSTALLERINFO; diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcproj new file mode 100644 index 0000000..36403a5 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcproj @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj new file mode 100644 index 0000000..a798f66 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + installer_x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} + installerx64 + Win32Proj + + + + Application + + + Application + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\installer_x64\ + true + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\installer_x64\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + X64 + + + Disabled + %(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS; _WIN64;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + newdev.lib;setupapi.lib;%(AdditionalDependencies) + true + Console + MachineX64 + + + + + X64 + + + MaxSpeed + true + %(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS; _WIN64;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + newdev.lib;setupapi.lib;%(AdditionalDependencies) + false + Console + true + true + MachineX64 + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.filters new file mode 100644 index 0000000..c2c6a01 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_sources b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_sources new file mode 100644 index 0000000..1b85417 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_sources @@ -0,0 +1,23 @@ +TARGETNAME=installer_x64 +TARGETTYPE=PROGRAM + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +UMTYPE=console +UMBASE=0x01000000 + +INCLUDES=..\msvc;$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\newdev.lib \ + $(SDK_LIB_PATH)\setupapi.lib + +SOURCES=installer.c diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcproj new file mode 100644 index 0000000..a8d8e91 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcproj @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj new file mode 100644 index 0000000..08b8fe7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj @@ -0,0 +1,105 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + installer_x86 + {9B1C561E-F95B-4849-A7AA-A4350E227C20} + installerx86 + Win32Proj + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\installer_x86\ + true + $(SolutionDir)$(Platform)\$(Configuration)\helper\ + $(SolutionDir)$(Platform)\$(Configuration)\helper\installer_x86\ + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + %(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + EditAndContinue + + + newdev.lib;setupapi.lib;%(AdditionalDependencies) + true + Console + MachineX86 + + + + + MaxSpeed + true + %(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + newdev.lib;setupapi.lib;%(AdditionalDependencies) + false + Console + true + true + MachineX86 + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.filters new file mode 100644 index 0000000..c2c6a01 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.filters @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_sources b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_sources new file mode 100644 index 0000000..a1c9669 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_sources @@ -0,0 +1,23 @@ +TARGETNAME=installer_x86 +TARGETTYPE=PROGRAM + +_NT_TARGET_VERSION= $(_NT_TARGET_VERSION_WINXP) + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +UMTYPE=console +UMBASE=0x01000000 + +INCLUDES=..\msvc;$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\newdev.lib \ + $(SDK_LIB_PATH)\setupapi.lib + +SOURCES=installer.c diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libusb-win32.inf.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libusb-win32.inf.in new file mode 100644 index 0000000..299b654 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libusb-win32.inf.in @@ -0,0 +1,144 @@ +; #INF_FILENAME# +; Copyright (c) 2010 libusb-win32 (GNU LGPL) +[Strings] +DeviceName = "#DEVICE_DESCRIPTION#" +VendorName = "#DEVICE_MANUFACTURER#" +SourceName = "#DEVICE_DESCRIPTION# Install Disk" +DeviceID = "#DEVICE_HARDWARE_ID#" +DeviceGUID = "#DEVICE_INTERFACE_GUID#" + +[Version] +Signature = "$Windows NT$" +Class = "libusb-win32 devices" +ClassGuid = {EB781AAF-9C70-4523-A5DF-642A87ECA567} +Provider = "libusb-win32" +CatalogFile = #CAT_FILENAME# +DriverVer = #DRIVER_DATE#, #DRIVER_VERSION# + +[ClassInstall32] +Addreg = libusb_class_install_add_reg + +[libusb_class_install_add_reg] +HKR,,,0,"libusb-win32 devices" +HKR,,Icon,,-20 + +[Manufacturer] +%VendorName% = Devices, NT, NTAMD64, NTIA64 + +;-------------------------------------------------------------------------- +; libusb-win32 files +;-------------------------------------------------------------------------- + +[SourceDisksNames] +1 = %SourceName% + +[SourceDisksFiles.x86] +libusb0.sys = 1,x86 +libusb0_x86.dll = 1,x86 + +[SourceDisksFiles.amd64] +libusb0.sys = 1,amd64 +libusb0.dll = 1,amd64 +libusb0_x86.dll = 1,x86 + +[SourceDisksFiles.ia64] +libusb0.sys = 1,ia64 +libusb0.dll = 1,ia64 +libusb0_x86.dll = 1,x86 + +[DestinationDirs] +libusb_files_sys = 10,system32\drivers +libusb_files_dll = 10,system32 +libusb_files_dll_wow64 = 10,syswow64 +libusb_files_dll_x86 = 10,system32 + +[libusb_files_sys] +libusb0.sys + +[libusb_files_dll] +libusb0.dll + +[libusb_files_dll_x86] +libusb0.dll, libusb0_x86.dll + +[libusb_files_dll_wow64] +libusb0.dll, libusb0_x86.dll + +;-------------------------------------------------------------------------- +; libusb-win32 device driver +;-------------------------------------------------------------------------- + +[LIBUSB_WIN32_DEV.NT] +CopyFiles = libusb_files_sys, libusb_files_dll_x86 + +[LIBUSB_WIN32_DEV.NTAMD64] +CopyFiles = libusb_files_sys, libusb_files_dll, libusb_files_dll_wow64 + +[LIBUSB_WIN32_DEV.NTIA64] +CopyFiles = libusb_files_sys, libusb_files_dll, libusb_files_dll_wow64 + +[LIBUSB_WIN32_DEV.NT.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_WIN32_DEV.NTAMD64.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_WIN32_DEV.NTIA64.HW] +DelReg = libusb_del_reg_hw +AddReg = libusb_add_reg_hw + +[LIBUSB_WIN32_DEV.NT.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[LIBUSB_WIN32_DEV.NTAMD64.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +[LIBUSB_WIN32_DEV.NTIA64.Services] +AddService = libusb0, 0x00000002, libusb_add_service + +; Older versions of this .inf file installed filter drivers. They are not +; needed any more and must be removed +[libusb_del_reg_hw] +HKR,,LowerFilters +HKR,,UpperFilters + +; libusb-win32 device properties +[libusb_add_reg_hw] +HKR,,SurpriseRemovalOK,0x00010001,1 + +; (Optional) the usb configuration value to select when this device +; is started. If this key does not exist the first config is selected. +;HKR,,InitialConfigValue,0x00010001, + +;-------------------------------------------------------------------------- +; libusb-win32 service +;-------------------------------------------------------------------------- + +[libusb_add_service] +DisplayName = "libusb-win32 - Kernel Driver #DRIVER_DATE# #DRIVER_VERSION#" +ServiceType = 1 +StartType = 3 +ErrorControl = 0 +ServiceBinary = %12%\libusb0.sys + +;-------------------------------------------------------------------------- +; libusb-win32 devices +;-------------------------------------------------------------------------- + +; Hardware IDs in a 'Devices' section can be installed by libusb-win32 +; using usb_install_driver_np(), usb_install_driver_np_rundll(), or the +; inf-wizard utility. +; +[Devices] +%DeviceName% = LIBUSB_WIN32_DEV, USB\%DeviceID% + +[Devices.NT] +%DeviceName% = LIBUSB_WIN32_DEV.NT, USB\%DeviceID% + +[Devices.NTAMD64] +%DeviceName% = LIBUSB_WIN32_DEV.NTAMD64, USB\%DeviceID% + +[Devices.NTIA64] +%DeviceName% = LIBUSB_WIN32_DEV.NTIA64, USB\%DeviceID% diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.c new file mode 100644 index 0000000..0506255 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.c @@ -0,0 +1,1375 @@ +/* + * Library for USB automated driver installation + * Copyright (c) 2010 Pete Batard + * Parts of the code from libusb by Daniel Drake, Johannes Erdfelt et al. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "installer.h" +#include "libwdi.h" +#include "logging.h" +#include "tokenizer.h" +#include "embedded.h" // auto-generated during compilation +#include "msapi_utf8.h" + +// Initial timeout delay to wait for the installer to run +#define DEFAULT_TIMEOUT 10000 +// Check if we unexpectedly lose communication with the installer process +#define CHECK_COMPLETION (installer_completed?WDI_SUCCESS:WDI_ERROR_TIMEOUT) + +// These warnings are taken care of in configure for other platforms +#if defined(_MSC_VER) + +#define __STR2__(x) #x +#define __STR1__(x) __STR2__(x) +#if defined(_WIN64) && defined(OPT_M32) +// a 64 bit application/library CANNOT be used on 32 bit platforms +#pragma message(__FILE__ "(" __STR1__(__LINE__) ") : warning : library is compiled as 64 bit - disabling 32 bit support") +#undef OPT_M32 +#endif + +#if !defined(OPT_M32) && !defined(OPT_M64) +#error both 32 and 64 bit support have been disabled - check your config.h +#endif +#if defined(OPT_M64) && !defined(OPT_M32) +#pragma message(__FILE__ "(" __STR1__(__LINE__) ") : warning : this library will be INCOMPATIBLE with 32 bit platforms") +#endif +#if defined(OPT_M32) && !defined(OPT_M64) +#pragma message(__FILE__ "(" __STR1__(__LINE__) ") : warning : this library will be INCOMPATIBLE with 64 bit platforms") +#endif + +#endif /* _MSC_VER */ + +// These functions are defined in libwdi_dlg +extern HWND find_security_prompt(void); +extern int run_with_progress_bar(HWND hWnd, int(*function)(void*), void* arglist); + +/* + * Structure used for the threaded call to install_driver_internal() + */ +struct install_driver_params { + struct wdi_device_info* device_info; + char* path; + char* inf_name; + struct wdi_options_install_driver* options; +}; + +/* + * Tokenizer data + */ +enum INF_TAGS +{ + INF_FILENAME, + CAT_FILENAME, + DEVICE_DESCRIPTION, + DEVICE_HARDWARE_ID, + DEVICE_INTERFACE_GUID, + DEVICE_MANUFACTURER, + DRIVER_DATE, + DRIVER_VERSION, +}; + +token_entity_t inf_entities[]= +{ + {"INF_FILENAME",""}, + {"CAT_FILENAME",""}, + {"DEVICE_DESCRIPTION",""}, + {"DEVICE_HARDWARE_ID",""}, + {"DEVICE_INTERFACE_GUID",""}, + {"DEVICE_MANUFACTURER",""}, + {"DRIVER_DATE",""}, + {"DRIVER_VERSION",""}, + {NULL, ""} // DO NOT REMOVE! +}; + +/* + * Global variables + */ +struct wdi_device_info *current_device = NULL; +bool dlls_available = false; +bool installer_completed = false; +DWORD timeout = DEFAULT_TIMEOUT; +HANDLE pipe_handle = INVALID_HANDLE_VALUE; +// for 64 bit platforms detection +static BOOL (__stdcall *pIsWow64Process)(HANDLE, PBOOL) = NULL; +enum windows_version windows_version = WINDOWS_UNDEFINED; + +/* + * For the retrieval of the device description on Windows 7 + */ +#ifndef DEVPROPKEY_DEFINED +typedef struct { + GUID fmtid; + ULONG pid; +} DEVPROPKEY; +#endif + +const DEVPROPKEY DEVPKEY_Device_BusReportedDeviceDesc = { + { 0x540b947e, 0x8b40, 0x45bc, {0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2} }, 4 }; + +// The following is only available on Vista and later +static BOOL (WINAPI *pIsUserAnAdmin)(void) = NULL; +#define INIT_VISTA_SHELL32 if (pIsUserAnAdmin == NULL) { \ + pIsUserAnAdmin = (BOOL (WINAPI *)(void)) \ + GetProcAddress(GetModuleHandle("SHELL32"), "IsUserAnAdmin"); \ + } +#define IS_VISTA_SHELL32_AVAILABLE (pIsUserAnAdmin != NULL) + + +/* + * Cfgmgr32.dll, SetupAPI.dll interface + */ +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Parent, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Child, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Sibling, (PDEVINST, DEVINST, ULONG)); +DLL_DECLARE(WINAPI, CONFIGRET, CM_Get_Device_IDA, (DEVINST, PCHAR, ULONG, ULONG)); +// This call is only available on XP and later +DLL_DECLARE(WINAPI, DWORD, CMP_WaitNoPendingInstallEvents, (DWORD)); +// This call is only available on Vista and later +DLL_DECLARE(WINAPI, BOOL, SetupDiGetDeviceProperty, (HDEVINFO, PSP_DEVINFO_DATA, const DEVPROPKEY*, ULONG*, PBYTE, DWORD, PDWORD, DWORD)); + +// Detect Windows version +#define GET_WINDOWS_VERSION do{ if (windows_version == WINDOWS_UNDEFINED) detect_version(); } while(0) +static void detect_version(void) +{ + OSVERSIONINFO os_version; + + memset(&os_version, 0, sizeof(OSVERSIONINFO)); + os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + windows_version = WINDOWS_UNSUPPORTED; + if ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) { + if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 0)) { + windows_version = WINDOWS_2K; + wdi_info("Windows 2000"); + } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) { + windows_version = WINDOWS_XP; + wdi_info("Windows XP"); + } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) { + windows_version = WINDOWS_2003_XP64; + wdi_info("Windows 2003 or Windows XP 64 bit"); + } else if (os_version.dwMajorVersion >= 6) { + if (os_version.dwBuildNumber < 7000) { + windows_version = WINDOWS_VISTA; + wdi_info("Windows Vista"); + } else { + windows_version = WINDOWS_7; + wdi_info("Windows 7"); + } + } + } +} + +/* + * Converts a windows error to human readable string + * uses retval as errorcode, or, if 0, use GetLastError() + */ +char *windows_error_str(uint32_t retval) +{ +static char err_string[STR_BUFFER_SIZE]; + + DWORD size; + size_t i; + uint32_t error_code, format_error; + + error_code = retval?retval:GetLastError(); + + safe_sprintf(err_string, STR_BUFFER_SIZE, "[%d] ", error_code); + + size = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &err_string[safe_strlen(err_string)], + STR_BUFFER_SIZE - (DWORD)safe_strlen(err_string), NULL); + if (size == 0) { + format_error = GetLastError(); + if (format_error) + safe_sprintf(err_string, STR_BUFFER_SIZE, + "Windows error code %u (FormatMessage error code %u)", error_code, format_error); + else + safe_sprintf(err_string, STR_BUFFER_SIZE, "Unknown error code %u", error_code); + } else { + // Remove CR/LF terminators + for (i=safe_strlen(err_string)-1; ((err_string[i]==0x0A) || (err_string[i]==0x0D)); i--) { + err_string[i] = 0; + } + } + return err_string; +} + +/* + * Retrieve the SID of the current user. The returned PSID must be freed by the caller using LocalFree() + */ +static PSID get_sid(void) { + TOKEN_USER* tu = NULL; + DWORD len; + HANDLE token; + PSID ret = NULL; + char* psid_string = NULL; + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) { + wdi_err("OpenProcessToken failed: %s", windows_error_str(0)); + return NULL; + } + + if (!GetTokenInformation(token, TokenUser, tu, 0, &len)) { + if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) { + wdi_err("GetTokenInformation (pre) failed: %s", windows_error_str(0)); + return NULL; + } + tu = (TOKEN_USER*)calloc(1, len); + if (tu == NULL) { + return NULL; + } + } + + if (GetTokenInformation(token, TokenUser, tu, len, &len)) { + /* + * now of course, the interesting thing is that if you return tu->User.Sid + * but free tu, the PSID pointer becomes invalid after a while. + * The workaround? Convert to string then back to PSID + */ + if (!ConvertSidToStringSidA(tu->User.Sid, &psid_string)) { + wdi_err("unable to convert SID to string: %s", windows_error_str(0)); + ret = NULL; + } else { + if (!ConvertStringSidToSidA(psid_string, &ret)) { + wdi_err("unable to convert string back to SID: %s", windows_error_str(0)); + ret = NULL; + } + // MUST use LocalFree() + LocalFree(psid_string); + } + } else { + ret = NULL; + wdi_err("GetTokenInformation (real) failed: %s", windows_error_str(0)); + } + free(tu); + return ret; +} + +/* + * Check whether the path is a directory with write access + * if create is true, create directory if it doesn't exist + */ +static int check_dir(char* path, bool create) +{ + int r; + DWORD file_attributes; + PSID sid = NULL; + SECURITY_ATTRIBUTES s_attr, *ps = NULL; + SECURITY_DESCRIPTOR s_desc; + + file_attributes = GetFileAttributesU(path); + if (file_attributes == INVALID_FILE_ATTRIBUTES) { + switch (GetLastError()) { + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + break; + default: + wdi_err("unable to read file attributes %s", windows_error_str(0)); + return WDI_ERROR_ACCESS; + } + } else { + if (file_attributes & FILE_ATTRIBUTE_DIRECTORY) { + // Directory exists + return WDI_SUCCESS; + } else { + // File with the same name as the dir we want to create + wdi_err("%s is a file, not a directory", path); + return WDI_ERROR_ACCESS; + } + } + + if (!create) { + wdi_err("%s doesn't exist", path); + return WDI_ERROR_ACCESS; + } + + // Change the owner from admin to regular user + sid = get_sid(); + if ( (sid != NULL) + && InitializeSecurityDescriptor(&s_desc, SECURITY_DESCRIPTOR_REVISION) + && SetSecurityDescriptorOwner(&s_desc, sid, FALSE) ) { + s_attr.nLength = sizeof(SECURITY_ATTRIBUTES); + s_attr.bInheritHandle = FALSE; + s_attr.lpSecurityDescriptor = &s_desc; + ps = &s_attr; + } else { + wdi_err("could not set security descriptor: %s", windows_error_str(0)); + } + + // SHCreateDirectoryEx creates subdirectories as required + r = SHCreateDirectoryExU(NULL, path, ps); + if (sid != NULL) LocalFree(sid); + + switch(r) { + case ERROR_SUCCESS: + return WDI_SUCCESS; + case ERROR_BAD_PATHNAME: + wdi_err("directory path is invalid %s", path); + return WDI_ERROR_INVALID_PARAM; + case ERROR_FILENAME_EXCED_RANGE: + wdi_err("directory name is too long %s", path); + return WDI_ERROR_INVALID_PARAM; + default: + wdi_err("unable to create directory %s (%s)", path, windows_error_str(0)); + return WDI_ERROR_ACCESS; + } + + return WDI_SUCCESS; +} + +/* + * fopen equivalent, that uses CreateFile with security attributes + * to create file as the user of the application + */ +static FILE *fcreate(const char *filename, const char *mode) +{ + HANDLE handle; + size_t i; + DWORD access_mode = 0; + SECURITY_ATTRIBUTES *ps = NULL; + int lowlevel_fd; + PSID sid = NULL; + SECURITY_ATTRIBUTES s_attr; + SECURITY_DESCRIPTOR s_desc; + + if ((filename == NULL) || (mode == NULL)) { + return NULL; + } + + // Simple mode handling. + for (i=0; idevice_id); + safe_free(di->hardware_id); + safe_free(di->desc); + safe_free(di->driver); + free(di); +} + +// Setup the Cfgmgr32 and SetupApi DLLs +static int init_dlls(void) +{ + DLL_LOAD(Cfgmgr32.dll, CM_Get_Parent, TRUE); + DLL_LOAD(Cfgmgr32.dll, CM_Get_Child, TRUE); + DLL_LOAD(Cfgmgr32.dll, CM_Get_Sibling, TRUE); + DLL_LOAD(Cfgmgr32.dll, CM_Get_Device_IDA, TRUE); + DLL_LOAD(Setupapi.dll, CMP_WaitNoPendingInstallEvents, FALSE); + DLL_LOAD(Setupapi.dll, SetupDiGetDeviceProperty, FALSE); + return WDI_SUCCESS; +} + +// List USB devices +int LIBWDI_API wdi_create_list(struct wdi_device_info** list, + struct wdi_options_create_list* options) +{ + unsigned i, j, tmp; + unsigned unknown_count = 1; + DWORD size, reg_type; + ULONG devprop_type; + CONFIGRET r; + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + char *prefix[3] = {"VID_", "PID_", "MI_"}; + char *token, *end; + char strbuf[STR_BUFFER_SIZE]; + wchar_t desc[MAX_DESC_LENGTH]; + struct wdi_device_info *start = NULL, *cur = NULL, *device_info = NULL; + const char usbhub_name[] = "usbhub"; + const char usbccgp_name[] = "usbccgp"; + bool is_hub, is_composite_parent, has_vid; + + MUTEX_START; + + if (!dlls_available) { + init_dlls(); + } + + // List all connected USB devices + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, DIGCF_PRESENT|DIGCF_ALLCLASSES); + if (dev_info == INVALID_HANDLE_VALUE) { + *list = NULL; + MUTEX_RETURN WDI_ERROR_NO_DEVICE; + } + + // Find the ones that are driverless + for (i = 0; ; i++) + { + // Free any invalid previously allocated struct + free_di(device_info); + + dev_info_data.cbSize = sizeof(dev_info_data); + if (!SetupDiEnumDeviceInfo(dev_info, i, &dev_info_data)) { + break; + } + + // Allocate a driver_info struct to store our data + device_info = calloc(1, sizeof(struct wdi_device_info)); + if (device_info == NULL) { + wdi_destroy_list(start); + *list = NULL; + MUTEX_RETURN WDI_ERROR_RESOURCE; + } + + // SPDRP_DRIVER seems to do a better job at detecting driverless devices than + // SPDRP_INSTALL_STATE + if (SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_DRIVER, + ®_type, (BYTE*)strbuf, STR_BUFFER_SIZE, &size)) { + if ((options == NULL) || (!options->list_all)) { + continue; + } + } + + // Eliminate USB hubs by checking the driver string + strbuf[0] = 0; + if (!SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_SERVICE, + ®_type, (BYTE*)strbuf, STR_BUFFER_SIZE, &size)) { + device_info->driver = NULL; + } else { + device_info->driver = safe_strdup(strbuf); + } + is_hub = false; + if (safe_strcmp(strbuf, usbhub_name) == 0) { + if (!options->list_hubs) { + continue; + } + is_hub = true; + } + // Also eliminate composite devices parent drivers, as replacing these drivers + // is a bad idea + is_composite_parent = false; + if (safe_strcmp(strbuf, usbccgp_name) == 0) { + if (!options->list_hubs) { + continue; + } + is_composite_parent = true; + } + + // Retrieve the hardware ID + if (SetupDiGetDeviceRegistryPropertyA(dev_info, &dev_info_data, SPDRP_HARDWAREID, + ®_type, (BYTE*)strbuf, STR_BUFFER_SIZE, &size)) { + wdi_dbg("got hardware ID: %s", strbuf); + } else { + wdi_err("could not get hardware ID"); + strbuf[0] = 0; + } + device_info->hardware_id = safe_strdup(strbuf); + + // Retrieve device ID. This is needed to re-enumerate our device and force + // the final driver installation + r = CM_Get_Device_IDA(dev_info_data.DevInst, strbuf, STR_BUFFER_SIZE, 0); + if (r != CR_SUCCESS) { + wdi_err("could not retrieve simple path for device %d: CR error %d", i, r); + continue; + } else { + wdi_dbg("%s USB device (%d): %s", + device_info->driver?device_info->driver:"Driverless", i, strbuf); + } + device_info->device_id = safe_strdup(strbuf); + + GET_WINDOWS_VERSION; + if (windows_version < WINDOWS_7) { + // On Vista and earlier, we can use SPDRP_DEVICEDESC + if (!SetupDiGetDeviceRegistryPropertyW(dev_info, &dev_info_data, SPDRP_DEVICEDESC, + ®_type, (BYTE*)desc, 2*MAX_DESC_LENGTH, &size)) { + wdi_warn("could not read device description for %d: %s", + i, windows_error_str(0)); + safe_swprintf(desc, MAX_DESC_LENGTH, L"Unknown Device #%d", unknown_count++); + } + } else { + // On Windows 7, the information we want ("Bus reported device description") is + // accessed through DEVPKEY_Device_BusReportedDeviceDesc + if (SetupDiGetDeviceProperty == NULL) { + wdi_warn("failed to locate SetupDiGetDeviceProperty() is Setupapi.dll"); + desc[0] = 0; + } else if (!SetupDiGetDeviceProperty(dev_info, &dev_info_data, &DEVPKEY_Device_BusReportedDeviceDesc, + &devprop_type, (BYTE*)desc, 2*MAX_DESC_LENGTH, &size, 0)) { + // fallback to SPDRP_DEVICEDESC (USB husb still use it) + if (!SetupDiGetDeviceRegistryPropertyW(dev_info, &dev_info_data, SPDRP_DEVICEDESC, + ®_type, (BYTE*)desc, 2*MAX_DESC_LENGTH, &size)) { + wdi_dbg("could not read device description for %d: %s", + i, windows_error_str(0)); + safe_swprintf(desc, MAX_DESC_LENGTH, L"Unknown Device #%d", unknown_count++); + } + } + } + + device_info->is_composite = false; // non composite by default + device_info->mi = 0; + token = strtok (strbuf, "\\#&"); + has_vid = false; + while(token != NULL) { + for (j = 0; j < 3; j++) { + if (safe_strncmp(token, prefix[j], safe_strlen(prefix[j])) == 0) { + switch(j) { + case 0: + if (sscanf(token, "VID_%04X", &tmp) != 1) { + wdi_err("could not convert VID string"); + } else { + device_info->vid = (unsigned short)tmp; + } + has_vid = true; + break; + case 1: + if (sscanf(token, "PID_%04X", &tmp) != 1) { + wdi_err("could not convert PID string"); + } else { + device_info->pid = (unsigned short)tmp; + } + break; + case 2: + if (sscanf(token, "MI_%02X", &tmp) != 1) { + wdi_err("could not convert MI string"); + } else { + device_info->is_composite = true; + device_info->mi = (unsigned char)tmp; + if ((wcslen(desc) + sizeof(" (Interface ###)")) < MAX_DESC_LENGTH) { + _snwprintf(&desc[wcslen(desc)], sizeof(" (Interface ###)"), + L" (Interface %d)", device_info->mi); + } + } + break; + default: + wdi_err("unexpected case"); + break; + } + } + } + token = strtok (NULL, "\\#&"); + } + + // Eliminate root hubs (no VID/PID => 0 from calloc) + if ( (is_hub) && (!has_vid) ) { + continue; + } + + // Add a suffix for composite parents + if ( (is_composite_parent) + && ((wcslen(desc) + sizeof(" (Composite Parent)")) < MAX_DESC_LENGTH) ) { + _snwprintf(&desc[wcslen(desc)], sizeof(" (Composite Parent)"), + L" (Composite Parent)"); + } + + device_info->desc = wchar_to_utf8(desc); + + // Remove trailing whitespaces + if ((options != NULL) && (options->trim_whitespaces)) { + end = device_info->desc + safe_strlen(device_info->desc); + while ((end != device_info->desc) && isspace(*(end-1))) { + --end; + } + *end = 0; + } + + wdi_dbg("Device description: '%s'", device_info->desc); + + // Only at this stage do we know we have a valid current element + if (cur == NULL) { + start = device_info; + } else { + cur->next = device_info; + } + cur = device_info; + // Ensure that we don't free a valid structure + device_info = NULL; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + *list = start; + MUTEX_RETURN (*list==NULL)?WDI_ERROR_NO_DEVICE:WDI_SUCCESS; +} + +int LIBWDI_API wdi_destroy_list(struct wdi_device_info* list) +{ + struct wdi_device_info *tmp; + + MUTEX_START; + + while(list != NULL) { + tmp = list; + list = list->next; + free_di(tmp); + } + MUTEX_RETURN WDI_SUCCESS; +} + +// extract the embedded binary resources +static int extract_binaries(char* path) +{ + FILE *fd; + char filename[MAX_PATH_LENGTH]; + int i, r; + + for (i=0; idriver_type; + } + + // For custom drivers, as we cannot autogenerate the inf, simply extract binaries + if (driver_type == WDI_USER) { + wdi_warn("Custom driver - extracting binaries only (no inf/cat creation)"); + MUTEX_RETURN extract_binaries(path); + } + + if ( (driver_type != WDI_LIBUSB) && (driver_type != WDI_WINUSB) ) { + wdi_err("unknown type"); + MUTEX_RETURN WDI_ERROR_INVALID_PARAM; + } + + if (device_info->desc == NULL) { + wdi_err("no description was given for the device - aborting"); + MUTEX_RETURN WDI_ERROR_NOT_FOUND; + } + + r = extract_binaries(path); + if (r != WDI_SUCCESS) { + MUTEX_RETURN r; + } + + // Set the inf filename + safe_strcpy(filename, MAX_PATH_LENGTH, path); + safe_strcat(filename, MAX_PATH_LENGTH, "\\"); + safe_strcat(filename, MAX_PATH_LENGTH, inf_name); + + // Populate the inf and cat names + static_strcpy(inf_entities[INF_FILENAME].replace, inf_name); + cat_name = safe_strdup(inf_name); + if (cat_name == NULL) { + MUTEX_RETURN WDI_ERROR_RESOURCE; + } + cat_name[safe_strlen(inf_name)-3] = 'c'; + cat_name[safe_strlen(inf_name)-2] = 'a'; + cat_name[safe_strlen(inf_name)-1] = 't'; + static_strcpy(inf_entities[CAT_FILENAME].replace, cat_name); + safe_free(cat_name); + + // Populate the Device Description and Hardware ID + static_strcpy(inf_entities[DEVICE_DESCRIPTION].replace, device_info->desc); + if (device_info->is_composite) { + static_sprintf(inf_entities[DEVICE_HARDWARE_ID].replace, "VID_%04X&PID_%04X&MI_%02X", + device_info->vid, device_info->pid, device_info->mi); + } else { + static_sprintf(inf_entities[DEVICE_HARDWARE_ID].replace, "VID_%04X&PID_%04X", + device_info->vid, device_info->pid); + } + + // Populate the Device Interface GUID + CoCreateGuid(&guid); + static_sprintf(inf_entities[DEVICE_INTERFACE_GUID].replace, "%s", guid_to_string(guid)); + + // Resolve the Manufacturer (Vendor Name) + if ((options != NULL) && (options->vendor_name != NULL)) { + static_strcpy(inf_entities[DEVICE_MANUFACTURER].replace, options->vendor_name); + } else { + vendor_name = wdi_get_vendor_name(device_info->vid); + if (vendor_name == NULL) { + vendor_name = "(Unknown Vendor)"; + } + static_strcpy(inf_entities[DEVICE_MANUFACTURER].replace, vendor_name); + } + + // Extra check, in case somebody modifies our code + if ((driver_type < 0) && (driver_type > sizeof(driver_version)/sizeof(driver_version[0]))) { + wdi_err("program assertion failed - driver_version[] index out of range"); + MUTEX_RETURN WDI_ERROR_OTHER; + } + + // Write the date and version data + file_time.dwHighDateTime = driver_version[driver_type].dwFileDateMS; + file_time.dwLowDateTime = driver_version[driver_type].dwFileDateLS; + if ( ((file_time.dwHighDateTime == 0) && (file_time.dwLowDateTime == 0)) + || (!FileTimeToSystemTime(&file_time, &system_time)) ) { + GetLocalTime(&system_time); + } + static_sprintf(inf_entities[DRIVER_DATE].replace, + "%02d/%02d/%04d", system_time.wMonth, system_time.wDay, system_time.wYear); + static_sprintf(inf_entities[DRIVER_VERSION].replace, "%d.%d.%d.%d", + (int)driver_version[driver_type].dwFileVersionMS>>16, (int)driver_version[driver_type].dwFileVersionMS&0xFFFF, + (int)driver_version[driver_type].dwFileVersionLS>>16, (int)driver_version[driver_type].dwFileVersionLS&0xFFFF); + + // Tokenize the file + if ((inf_file_size = tokenize_internal((driver_type == WDI_WINUSB)?"winusb.inf.in":"libusb-win32.inf.in", + &dst, inf_entities, "#", "#" ,0)) > 0) { + fd = fcreate(filename, "w"); + if (fd == NULL) { + wdi_err("failed to create file: %s", filename); + MUTEX_RETURN WDI_ERROR_ACCESS; + } + // Converting to UTF-16 is the only way to get devices using a + // non-english locale to display properly in device manager. UTF-8 will not do. + wdst = utf8_to_wchar(dst); + fwrite(&bom, 2, 1, fd); // Write the BOM + fwrite(wdst, 2, wcslen(wdst), fd); + fclose(fd); + safe_free(wdst); + safe_free(dst); + } else { + wdi_err("could not tokenize inf file (%d)", inf_file_size); + MUTEX_RETURN WDI_ERROR_ACCESS; + } + + // Create a blank cat file + filename[safe_strlen(filename)-3] = 'c'; + filename[safe_strlen(filename)-2] = 'a'; + filename[safe_strlen(filename)-1] = 't'; + fd = fcreate(filename, "w"); + if (fd == NULL) { + wdi_err("failed to create file: %s", filename); + MUTEX_RETURN WDI_ERROR_ACCESS; + } + fprintf(fd, "This file will contain the digital signature of the files to be installed\n" + "on the system.\nThis file will be provided by Microsoft upon certification of your drivers."); + fclose(fd); + + // Restore extension for debug output + filename[safe_strlen(filename)-3] = 'i'; + filename[safe_strlen(filename)-2] = 'n'; + filename[safe_strlen(filename)-1] = 'f'; + wdi_info("succesfully created %s", filename); + MUTEX_RETURN WDI_SUCCESS; +} + +// Handle messages received from the elevated installer through the pipe +static int process_message(char* buffer, DWORD size) +{ + DWORD tmp; + char* sid_str; + + if (size <= 0) + return WDI_ERROR_INVALID_PARAM; + + if (current_device == NULL) { + wdi_err("program assertion failed - no current device"); + return WDI_ERROR_NOT_FOUND; + } + + // Note: this is a message pipe, so we don't need to care about + // multiple messages coexisting in our buffer. + switch(buffer[0]) + { + case IC_GET_DEVICE_ID: + wdi_dbg("got request for device_id"); + if (current_device->device_id != NULL) { + WriteFile(pipe_handle, current_device->device_id, (DWORD)safe_strlen(current_device->device_id), &tmp, NULL); + } else { + wdi_warn("no device_id - sending empty string"); + WriteFile(pipe_handle, "\0", 1, &tmp, NULL); + } + break; + case IC_GET_HARDWARE_ID: + wdi_dbg("got request for hardware_id"); + if (current_device->hardware_id != NULL) { + WriteFile(pipe_handle, current_device->hardware_id, (DWORD)safe_strlen(current_device->hardware_id), &tmp, NULL); + } else { + wdi_warn("no hardware_id - sending empty string"); + WriteFile(pipe_handle, "\0", 1, &tmp, NULL); + } + break; + case IC_PRINT_MESSAGE: + if (size < 2) { + wdi_err("print_message: no data"); + return WDI_ERROR_NOT_FOUND; + } + wdi_log(WDI_LOG_LEVEL_DEBUG, "installer process", "%s", buffer+1); + break; + case IC_SYSLOG_MESSAGE: + if (size < 2) { + wdi_err("syslog_message: no data"); + return WDI_ERROR_NOT_FOUND; + } + wdi_log(WDI_LOG_LEVEL_DEBUG, "syslog", "%s", buffer+1); + break; + case IC_SET_STATUS: + if (size < 2) { + wdi_err("set status: no data"); + return WDI_ERROR_NOT_FOUND; + } + return (int)buffer[1]; + break; + case IC_SET_TIMEOUT_INFINITE: + wdi_dbg("switching timeout to infinite"); + timeout = INFINITE; + break; + case IC_SET_TIMEOUT_DEFAULT: + wdi_dbg("switching timeout back to finite"); + timeout = DEFAULT_TIMEOUT; + break; + case IC_INSTALLER_COMPLETED: + wdi_dbg("installer process completed"); + installer_completed = true; + break; + case IC_GET_USER_SID: + if (ConvertSidToStringSidA(get_sid(), &sid_str)) { + WriteFile(pipe_handle, sid_str, (DWORD)safe_strlen(sid_str), &tmp, NULL); + LocalFree(sid_str); + } else { + wdi_warn("no user_sid - sending empty string"); + WriteFile(pipe_handle, "\0", 1, &tmp, NULL); + } + break; + default: + wdi_err("unrecognized installer message"); + return WDI_ERROR_NOT_FOUND; + } + return WDI_SUCCESS; +} + +// Run the elevated installer +static int install_driver_internal(void* arglist) +{ + struct install_driver_params* params = (struct install_driver_params*)arglist; + struct wdi_device_info* device_info = params->device_info; + char* path = params->path; + char* inf_name = params->inf_name; + + SHELLEXECUTEINFOA shExecInfo; + STARTUPINFOA si; + PROCESS_INFORMATION pi; + char exename[STR_BUFFER_SIZE]; + HANDLE handle[2] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE}; + OVERLAPPED overlapped; + int r; + DWORD err, rd_count, to_read, offset, bufsize = LOGBUF_SIZE; + BOOL is_x64 = false; + char *buffer = NULL, *new_buffer; + + MUTEX_START; + + if (!dlls_available) { + init_dlls(); + } + + current_device = device_info; + + // Try to use the user's temp dir if no path is provided + if ((path == NULL) || (path[0] == 0)) { + path = getenv("TEMP"); + if (path == NULL) { + wdi_err("no path provided and unable to use TEMP"); + MUTEX_RETURN WDI_ERROR_INVALID_PARAM; + } else { + wdi_info("no path provided - installing from '%s'", path); + } + } + + if ((device_info == NULL) || (inf_name == NULL)) { + wdi_err("one of the required parameter is NULL"); + MUTEX_RETURN WDI_ERROR_INVALID_PARAM; + } + + // Detect if another installation is in process + if (CMP_WaitNoPendingInstallEvents != NULL) { + if (CMP_WaitNoPendingInstallEvents(0) == WAIT_TIMEOUT) { + wdi_warn("detected another pending installation - aborting"); + MUTEX_RETURN WDI_ERROR_PENDING_INSTALLATION; + } + } else { + wdi_dbg("CMP_WaitNoPendingInstallEvents not available"); + } + + // Detect whether if we should run the 64 bit installer, without + // relying on external libs + if (sizeof(uintptr_t) < 8) { + // This application is not 64 bit, but it might be 32 bit + // running in WOW64 + pIsWow64Process = (BOOL (__stdcall *)(HANDLE, PBOOL)) + GetProcAddress(GetModuleHandle("KERNEL32"), "IsWow64Process"); + if (pIsWow64Process != NULL) { + (*pIsWow64Process)(GetCurrentProcess(), &is_x64); + } + } else { + is_x64 = true; + } + + // Use a pipe to communicate with our installer + pipe_handle = CreateNamedPipe(INSTALLER_PIPE_NAME, PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED, + PIPE_TYPE_MESSAGE|PIPE_READMODE_MESSAGE, 1, 4096, 4096, 0, NULL); + if (pipe_handle == INVALID_HANDLE_VALUE) { + wdi_err("could not create read pipe: %s", windows_error_str(0)); + r = WDI_ERROR_RESOURCE; goto out; + } + + // Set the overlapped for messaging + memset(&overlapped, 0, sizeof(OVERLAPPED)); + handle[0] = CreateEvent(NULL, TRUE, FALSE, NULL); + if(handle[0] == NULL) { + r = WDI_ERROR_RESOURCE; goto out; + } + overlapped.hEvent = handle[0]; + + safe_strcpy(exename, STR_BUFFER_SIZE, path); + // Why do we need two installers? Glad you asked. If you try to run the x86 installer on an x64 + // system, you will get a "System does not work under WOW64 and requires 64-bit version" message. + if (is_x64) { + safe_strcat(exename, STR_BUFFER_SIZE, "\\installer_x64.exe"); + } else { + safe_strcat(exename, STR_BUFFER_SIZE, "\\installer_x86.exe"); + } + // At this stage, if either the 32 or 64 bit installer version is missing, + // it is the application developer's fault... + if (GetFileAttributesU(exename) == INVALID_FILE_ATTRIBUTES) { + wdi_err("this application does not contain the required %s bit installer", is_x64?"64":"32"); + wdi_err("please contact the application provider for a %s bit compatible version", is_x64?"64":"32"); + r = WDI_ERROR_NOT_FOUND; goto out; + } + + installer_completed = false; + GET_WINDOWS_VERSION; + INIT_VISTA_SHELL32; + if ( (windows_version >= WINDOWS_VISTA) && IS_VISTA_SHELL32_AVAILABLE && (!pIsUserAnAdmin()) ) { + // On Vista and later, we must take care of UAC with ShellExecuteEx + runas + shExecInfo.cbSize = sizeof(SHELLEXECUTEINFOA); + shExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS; + shExecInfo.hwnd = NULL; + shExecInfo.lpVerb = "runas"; + shExecInfo.lpFile = exename; + shExecInfo.lpParameters = inf_name; + shExecInfo.lpDirectory = path; + shExecInfo.lpClass = NULL; + shExecInfo.nShow = SW_HIDE; + shExecInfo.hInstApp = NULL; + + err = 0; + if (!ShellExecuteExU(&shExecInfo)) { + err = GetLastError(); + } + + if ((err == ERROR_CANCELLED) || (shExecInfo.hProcess == NULL)) { + wdi_info("operation cancelled by the user"); + r = WDI_ERROR_USER_CANCEL; goto out; + } + else if (err) { + wdi_err("ShellExecuteEx failed: %s", windows_error_str(err)); + r = WDI_ERROR_NEEDS_ADMIN; goto out; + } + + handle[1] = shExecInfo.hProcess; + } else { + // On XP and earlier, or if app is already elevated, simply use CreateProcess + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + memset(&pi, 0, sizeof(pi)); + + safe_strcat(exename, STR_BUFFER_SIZE, " "); + safe_strcat(exename, STR_BUFFER_SIZE, inf_name); + if (!CreateProcessU(NULL, exename, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, path, &si, &pi)) { + wdi_err("CreateProcess failed: %s", windows_error_str(0)); + r = WDI_ERROR_NEEDS_ADMIN; goto out; + } + handle[1] = pi.hProcess; + } + + r = WDI_SUCCESS; + offset = 0; + buffer = malloc(bufsize); + if (buffer == NULL) { + wdi_err("unable to alloc buffer: aborting"); + r = WDI_ERROR_RESOURCE; goto out; + } + + while (r == WDI_SUCCESS) { + to_read = bufsize-offset; // rd_count is useless on sync (reset to 0) + if (ReadFile(pipe_handle, &buffer[offset], to_read, &rd_count, &overlapped)) { + offset = 0; + // Message was read synchronously + r = process_message(buffer, rd_count); + } else { + switch(GetLastError()) { + case ERROR_BROKEN_PIPE: + // The pipe has been ended - wait for installer to finish + if ((WaitForSingleObject(handle[1], timeout) == WAIT_TIMEOUT)) { + TerminateProcess(handle[1], 0); + } + r = CHECK_COMPLETION; goto out; + case ERROR_PIPE_LISTENING: + // Wait for installer to open the pipe + Sleep(100); + continue; + case ERROR_IO_PENDING: + switch(WaitForMultipleObjects(2, handle, FALSE, timeout)) { + case WAIT_OBJECT_0: // Pipe event + if (GetOverlappedResult(pipe_handle, &overlapped, &rd_count, FALSE)) { + // Message was read asynchronously + r = process_message(buffer, rd_count); + offset = 0; + } else { + switch(GetLastError()) { + case ERROR_BROKEN_PIPE: + // The pipe has been ended - wait for installer to finish + if ((WaitForSingleObject(handle[1], timeout) == WAIT_TIMEOUT)) { + TerminateProcess(handle[1], 0); + } + r = CHECK_COMPLETION; goto out; + case ERROR_MORE_DATA: + bufsize *= 2; + wdi_dbg("message overflow (async) - increasing buffer size to %d bytes", bufsize); + new_buffer = realloc(buffer, bufsize); + if (new_buffer == NULL) { + wdi_err("unable to realloc buffer: aborting"); + r = WDI_ERROR_RESOURCE; + } else { + buffer = new_buffer; + offset += to_read; + } + break; + default: + wdi_err("could not read from pipe (async): %s", windows_error_str(0)); + break; + } + } + break; + case WAIT_TIMEOUT: + // Lost contact + wdi_err("installer failed to respond - aborting"); + TerminateProcess(handle[1], 0); + r = WDI_ERROR_TIMEOUT; goto out; + case WAIT_OBJECT_0+1: + // installer process terminated + r = CHECK_COMPLETION; goto out; + default: + wdi_err("could not read from pipe (wait): %s", windows_error_str(0)); + break; + } + break; + case ERROR_MORE_DATA: + bufsize *= 2; + wdi_dbg("message overflow (sync) - increasing buffer size to %d bytes", bufsize); + new_buffer = realloc(buffer, bufsize); + if (new_buffer == NULL) { + wdi_err("unable to realloc buffer: aborting"); + r = WDI_ERROR_RESOURCE; + } else { + buffer = new_buffer; + offset += to_read; + } + break; + default: + wdi_err("could not read from pipe (sync): %s", windows_error_str(0)); + break; + } + } + } +out: + // If the security prompt is still active, attempt to destroy it + DestroyWindow(find_security_prompt()); + current_device = NULL; + safe_free(buffer); + safe_closehandle(handle[0]); + safe_closehandle(handle[1]); + safe_closehandle(pipe_handle); + MUTEX_RETURN r; +} + +int LIBWDI_API wdi_install_driver(struct wdi_device_info* device_info, char* path, + char* inf_name, struct wdi_options_install_driver* options) +{ + struct install_driver_params params; + params.device_info = device_info; + params.inf_name = inf_name; + params.options = options; + params.path = path; + + if ((options == NULL) || (options->hWnd == NULL)) { + wdi_dbg("using standard mode"); + return install_driver_internal((void*)¶ms); + } + wdi_dbg("using progress bar mode"); + return run_with_progress_bar(options->hWnd, install_driver_internal, (void*)¶ms); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.h new file mode 100644 index 0000000..3ccc166 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.h @@ -0,0 +1,257 @@ +/* + * Library for WinUSB/libusb automated driver installation + * Copyright (c) 2010 Pete Batard + * Parts of the code from libusb by Daniel Drake, Johannes Erdfelt et al. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#pragma once +#include + +#if !defined(bool) +#define bool BOOL +#endif +#if !defined(true) +#define true TRUE +#endif +#if !defined(false) +#define false FALSE +#endif + +#if defined(DLL_EXPORT) +#define LIBWDI_EXP __declspec(dllexport) +#else +#define LIBWDI_EXP +#endif + +/* + * Set the default calling convention to WINAPI (__stdcall) + */ +#if !defined(LIBWDI_API) +#define LIBWDI_API WINAPI +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Type of driver to install + */ +enum wdi_driver_type { + WDI_WINUSB, + WDI_LIBUSB, + WDI_USER, + WDI_NB_DRIVERS // Total number of drivers in the enum +}; + +/* + * Log level + */ +enum wdi_log_level { + WDI_LOG_LEVEL_DEBUG, + WDI_LOG_LEVEL_INFO, + WDI_LOG_LEVEL_WARNING, + WDI_LOG_LEVEL_ERROR +}; + +/* + * Error codes. Most libwdi functions return 0 on success or one of these + * codes on failure. + * You can use wdi_strerror() to retrieve a short string description of + * a wdi_error enumeration value. + */ +enum wdi_error { + /** Success (no error) */ + WDI_SUCCESS = 0, + + /** Input/output error */ + WDI_ERROR_IO = -1, + + /** Invalid parameter */ + WDI_ERROR_INVALID_PARAM = -2, + + /** Access denied (insufficient permissions) */ + WDI_ERROR_ACCESS = -3, + + /** No such device (it may have been disconnected) */ + WDI_ERROR_NO_DEVICE = -4, + + /** Entity not found */ + WDI_ERROR_NOT_FOUND = -5, + + /** Resource busy, or API call already running */ + WDI_ERROR_BUSY = -6, + + /** Operation timed out */ + WDI_ERROR_TIMEOUT = -7, + + /** Overflow */ + WDI_ERROR_OVERFLOW = -8, + + /** Another installation is pending */ + WDI_ERROR_PENDING_INSTALLATION = -9, + + /** System call interrupted (perhaps due to signal) */ + WDI_ERROR_INTERRUPTED = -10, + + /** Could not acquire resource (Insufficient memory, etc) */ + WDI_ERROR_RESOURCE = -11, + + /** Operation not supported or unimplemented on this platform */ + WDI_ERROR_NOT_SUPPORTED = -12, + + /** Entity already exists */ + WDI_ERROR_EXISTS = -13, + + /** Cancelled by user */ + WDI_ERROR_USER_CANCEL = -14, + + /** Couldn't run installer with required privileges */ + WDI_ERROR_NEEDS_ADMIN = -15, + + /** Attempted to run the 32 bit installer on 64 bit */ + WDI_ERROR_WOW64 = -16, + + /** Bad inf syntax */ + WDI_ERROR_INF_SYNTAX = -17, + + /** Missing cat file */ + WDI_ERROR_CAT_MISSING = -18, + + /** System policy prevents the installation of unsigned drivers */ + WDI_ERROR_UNSIGNED = -19, + + /** Other error */ + WDI_ERROR_OTHER = -99 + + /** IMPORTANT: when adding new values to this enum, remember to + update the wdi_strerror() function implementation! */ +}; + + +/* + * Device information structure, used by libwdi functions + */ +struct wdi_device_info { + /** (Optional) Pointer to the next element in the chained list. NULL if unused */ + struct wdi_device_info *next; + /** USB VID */ + unsigned short vid; + /** USB PID */ + unsigned short pid; + /** Whether the USB device is composite */ + bool is_composite; + /** (Optional) Composite USB interface number */ + unsigned char mi; + /** USB Device description, usually provided by the device irself */ + char* desc; + /** Windows' driver (service) name */ + char* driver; + /** (Optional) Microsoft's device URI string. NULL if unused */ + char* device_id; + /** (Optional) Microsoft's hardware ID string. NULL if unused */ + char* hardware_id; +}; + +/* + * Optional settings, used by libwdi functions + */ + +// wdi_create_list options +struct wdi_options_create_list { + /** list all devices, instead of just the ones that are driverless */ + bool list_all; + /** also list generic hubs and composite parent devices */ + bool list_hubs; + /** trim trailing whitespaces from the description string */ + bool trim_whitespaces; +}; + +// wdi_prepare_driver options: +struct wdi_options_prepare_driver { + /** type of driver to use. Should be either WDI_WINUSB, WDI_LIBUSB or WDI_USER */ + int driver_type; + /** Vendor name that should be used for the Manufacturer in the inf */ + char* vendor_name; +}; + +// wdi_install_driver options: +struct wdi_options_install_driver { + /** Handle to a Window application that should receive a modal progress dialog */ + HWND hWnd; +}; + +/* + * Convert a libwdi error to a human readable error message + */ +LIBWDI_EXP const char* LIBWDI_API wdi_strerror(int errcode); + +/* + * Check if a specific driver is supported (embedded) in the current version of libwdi + */ +LIBWDI_EXP bool LIBWDI_API wdi_is_driver_supported(int driver_type, VS_FIXEDFILEINFO* driver_info); + +/* + * Retrieve the full Vendor name from a Vendor ID (VID) + */ +LIBWDI_EXP const char* LIBWDI_API wdi_get_vendor_name(unsigned short vid); + +/* + * Return a wdi_device_info list of USB devices + * parameter: driverless_only - boolean + */ +LIBWDI_EXP int LIBWDI_API wdi_create_list(struct wdi_device_info** list, + struct wdi_options_create_list* options); + +/* + * Release a wdi_device_info list allocated by the previous call + */ +LIBWDI_EXP int LIBWDI_API wdi_destroy_list(struct wdi_device_info* list); + +/* + * Create an inf file for a specific device + */ +LIBWDI_EXP int LIBWDI_API wdi_prepare_driver(struct wdi_device_info* device_info, char* path, + char* inf_name, struct wdi_options_prepare_driver* options); + +/* + * Install a driver for a specific device + */ +LIBWDI_EXP int LIBWDI_API wdi_install_driver(struct wdi_device_info* device_info, char* path, + char* inf_name, struct wdi_options_install_driver* options); +/* + * Set the log verbosity + */ +LIBWDI_EXP int LIBWDI_API wdi_set_log_level(int level); + +/* + * Set the Windows callback message for log notification + */ +LIBWDI_EXP int LIBWDI_API wdi_register_logger(HWND hWnd, UINT message, DWORD buffsize); + +/* + * Unset the Windows callback message for log notification + */ +LIBWDI_EXP int LIBWDI_API wdi_unregister_logger(HWND hWnd); + +/* + * Read a log message after a log notification + */ +LIBWDI_EXP int LIBWDI_API wdi_read_logger(char* buffer, DWORD buffer_size, DWORD* message_size); + +#ifdef __cplusplus +} +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.rc new file mode 100644 index 0000000..ca4a4d5 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi.rc @@ -0,0 +1,92 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winresrc.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (Neutral) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winresrc.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,1,117 + PRODUCTVERSION 1,0,1,117 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000904b0" + BEGIN + VALUE "Comments", "http://libusb.org/wiki/libwdi" + VALUE "CompanyName", "libusb.org" + VALUE "FileDescription", "libwdi" + VALUE "FileVersion", "1, 0, 1, 117" + VALUE "InternalName", "libwdi" + VALUE "LegalCopyright", "See individual source files, GNU LGPL v2.1 or later." + VALUE "LegalTrademarks", "http://www.gnu.org/licenses/lgpl-2.1.html" + VALUE "OriginalFilename", "libwdi" + VALUE "ProductName", "libwdi" + VALUE "ProductVersion", "1, 0, 1, 117" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x9, 1200 + END +END + +#endif // English (Neutral) resources +///////////////////////////////////////////////////////////////////////////// + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dlg.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dlg.c new file mode 100644 index 0000000..796320b --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dlg.c @@ -0,0 +1,395 @@ +/* + * Library for USB automated driver installation + * Copyright (c) 2010 Pete Batard + * Parts of the code from libusb by Daniel Drake, Johannes Erdfelt et al. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "installer.h" +#include "libwdi.h" +#include "logging.h" +#include "resource.h" + +// WM_APP is not sent on focus, unlike WM_USER +enum stdlg_user_message_type { + UM_PROGRESS_START = WM_APP, + UM_PROGRESS_STOP, +}; + +// Messages that appear in our progress bar as time passes +const char* progress_message[] = { + "Installation can take some time...", + "The installation process can take up to 5 minutes...", + "The reason it can be so long...", + "...is because a System Restore point is created.", // 1 min + "If it's the first time a restore point is created...", + "...an extended delay is to expected.", + "Microsoft offers no means of checking progress...", + "...so we can't say how long it'll take...", // 2 mins + "Please continue to be patient...", + "There's a 5 minutes timeout enventually...", + "...so if there's a problem, the process will abort.", + "I've really seen an installation take 5 minutes...", // 3 mins + "...on a Vista 64 machine with a very large disk.", + "So how was your day...", + "...before it got ruined by this endless installation?", + "Seriously, what is taking this process so long?!", // 4 mins + "Aborting in 45 seconds...", + "Aborting in 30 seconds...", + "Aborting in 15 seconds...", +}; + +#ifndef PBS_MARQUEE +#define PBS_MARQUEE 0x08 +#endif +#ifndef PBM_SETMARQUEE +#define PBM_SETMARQUEE (WM_USER+10) +#endif + +/* + * Globals + */ +static uintptr_t progress_thid = -1L; +static HWND hProgress = INVALID_HANDLE_VALUE; +static HWND hProgressBar = INVALID_HANDLE_VALUE; +static HWND hProgressText = INVALID_HANDLE_VALUE; +static HINSTANCE app_instance = NULL; +static int (*progress_function)(void*); +static void* progress_arglist; +static HANDLE progress_mutex = INVALID_HANDLE_VALUE; + +// Work around for CreateFont on DDK (would require end user apps linking with Gdi32 othwerwise) +static HFONT (WINAPI *pCreateFontA)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCSTR) = NULL; +#define INIT_CREATEFONT if (pCreateFontA== NULL) { \ + pCreateFontA = (HFONT (WINAPI *)(int, int, int, int, int, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPCSTR)) \ + GetProcAddress(GetModuleHandleA("Gdi32"), "CreateFontA"); \ + } +#define IS_CREATEFONT_AVAILABLE (pCreateFontA != NULL) + +extern char *windows_error_str(uint32_t retval); + + +/* + * Detect if a Windows Security prompt is active, by enumerating the + * whole Windows tree and looking for a security popup + */ +BOOL CALLBACK security_prompt_callback(HWND hWnd, LPARAM lParam) +{ + char str_buf[STR_BUFFER_SIZE]; + HWND *hFound = (HWND*)lParam; + const char* security_string = "Windows Security"; + + // The security prompt has the popup window style + if (GetWindowLong(hWnd, GWL_STYLE) & WS_POPUPWINDOW) { + str_buf[0] = 0; + GetWindowTextA(hWnd, str_buf, STR_BUFFER_SIZE); + str_buf[STR_BUFFER_SIZE-1] = 0; + if (safe_strcmp(str_buf, security_string) == 0) { + *hFound = hWnd; + } + } + return TRUE; +} + +HWND find_security_prompt(void) { + HWND hSecurityPrompt = NULL; + EnumChildWindows(GetDesktopWindow(), security_prompt_callback, (LPARAM)&hSecurityPrompt); + return hSecurityPrompt; +} + +/* + * Thread executed by the run_with_progress_bar() function + */ +void __cdecl progress_thread(void* param) +{ + int r; + + // Call the user provided function + r = (*progress_function)(progress_arglist); + progress_thid = -1L; + PostMessage(hProgress, UM_PROGRESS_STOP, (WPARAM)r, 0); + _endthread(); +} + +/* + * Center a dialog with regards to the main application Window + */ +static void center_dialog(HWND dialog) +{ + HWND hParent; + POINT Point; + RECT DialogRect; + RECT ParentRect; + int nWidth; + int nHeight; + + hParent = GetParent(dialog); + if (hParent == NULL) return; + + // Get the size of the dialog box. + GetWindowRect(dialog, &DialogRect); + GetClientRect(hParent, &ParentRect); + + // Calculate the height and width of the current dialog + nWidth = DialogRect.right - DialogRect.left; + nHeight = DialogRect.bottom - DialogRect.top; + + // Find the center point and convert to screen coordinates. + Point.x = (ParentRect.right - ParentRect.left) / 2; + Point.y = (ParentRect.bottom - ParentRect.top) / 2; + ClientToScreen(hParent, &Point); + + // Calculate the new x, y starting point. + Point.x -= nWidth / 2; + Point.y -= nHeight / 2 + 35; + + // Move the window. + MoveWindow(dialog, Point.x, Point.y, nWidth, nHeight, FALSE); +} + +/* + * Dialog sub-elements + */ +static void init_children(HWND hDlg) { + + HFONT hFont; + // Progress Bar + hProgressBar = CreateWindowExA(WS_EX_NOPARENTNOTIFY, PROGRESS_CLASS, + NULL, + WS_CHILDWINDOW | WS_VISIBLE | PBS_MARQUEE, + 10,35,250,12, + hDlg, + NULL, + app_instance, + NULL); + if (hProgressBar == NULL) { + wdi_err("Unable to create progress bar: %s", windows_error_str(0)); + } + + // Start progress animation + PostMessage(hProgressBar, PBM_SETMARQUEE, TRUE, 0); + + // Progress Text + hProgressText = CreateWindowExA(WS_EX_NOPARENTNOTIFY, WC_STATIC, + "Installing Driver...", + WS_CHILDWINDOW | WS_VISIBLE | WS_GROUP, + 12,12,250,16, + hDlg, + NULL, + app_instance, + NULL); + if (hProgressBar == NULL) { + wdi_err("Unable to create progress text: %s", windows_error_str(0)); + } + + // Set the font to MS Dialog default + INIT_CREATEFONT; + if (IS_CREATEFONT_AVAILABLE) { + hFont = pCreateFontA(-11, 0, 0, 0, FW_DONTCARE, 0, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, + DEFAULT_QUALITY, DEFAULT_PITCH, "MS Shell Dlg 2"); + SendMessage(hProgressText, WM_SETFONT, (WPARAM)hFont, (LPARAM)TRUE); + } +} + +/* + * Callback for the run_with_progress_bar() function + */ +LRESULT CALLBACK progress_callback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + LRESULT loc; + HANDLE handle; + static int installation_time = 0; // active installation time, in secs + const int msg_max = sizeof(progress_message) / sizeof(progress_message[0]); + static int msg_index = 0; + int i; + // coordinates that we want to disable (=> no resize) + static LRESULT disabled[9] = { HTLEFT, HTRIGHT, HTTOP, HTBOTTOM, HTSIZE, + HTTOPLEFT, HTTOPRIGHT, HTBOTTOMLEFT, HTBOTTOMRIGHT }; + + switch (message) { + + case WM_CREATE: + // Reset static variables + installation_time = 0; + msg_index = 0; + hProgress = hDlg; + + // Start modal (disable parent Window) + EnableWindow(GetParent(hDlg), FALSE); + + init_children(hProgress); + center_dialog(hProgress); + + // Send a WM_TIMER message every second + SetTimer(hProgress, 1, 1000, NULL); + + PostMessage(hProgress, UM_PROGRESS_START, 0, 0); + + return (INT_PTR)TRUE; + + case WM_NCHITTEST: + // Check coordinates to prevent resize actions + loc = DefWindowProc(hDlg, message, wParam, lParam); + for(i = 0; i < 9; i++) { + if (loc == disabled[i]) { + return (INT_PTR)TRUE; + } + } + return (INT_PTR)FALSE; + + case UM_PROGRESS_START: + if (progress_thid != -1L) { + wdi_err("program assertion failed - another operation is in progress"); + } else { + // Using a thread prevents application freezout on security warning + progress_thid = _beginthread(progress_thread, 0, NULL); + if (progress_thid != -1L) { + return (INT_PTR)TRUE; + } + wdi_err("unable to create progress_thread"); + } + // Fall through and return an error + wParam = (WPARAM)WDI_ERROR_RESOURCE; + + case UM_PROGRESS_STOP: + // If you don't re-enable the parent Window before leaving + // all kind of bad things happen (other Windows get activated, etc.) + EnableWindow(GetParent(hDlg), TRUE); + PostQuitMessage((int)wParam); + DestroyWindow(hProgress); + return (INT_PTR)TRUE; + + case WM_TIMER: + if (find_security_prompt() == NULL) { + installation_time++; // Only increment outside of security prompts + if ( (msg_index < msg_max) && (installation_time > 15*(msg_index+1)) ) { + // Change the progress blurb + SetWindowTextA(hProgressText, progress_message[msg_index]); + msg_index++; + } else if ( (installation_time > 300) && (progress_thid != -1L) ) { + // Wait 300 (loose) seconds and kill the thread + // 300 secs is the timeout for driver installation on Vista + wdi_err("progress timeout expired - KILLING THREAD!"); + handle = OpenThread(THREAD_TERMINATE, FALSE, (DWORD)progress_thid); + TerminateThread(handle, -1); + CloseHandle(handle); + PostQuitMessage(WDI_ERROR_TIMEOUT); + DestroyWindow(hProgress); + return (INT_PTR)FALSE; + } + } + return (INT_PTR)TRUE; + + case WM_CLOSE: // prevent closure using Alt-F4 + return (INT_PTR)TRUE; + + case WM_DESTROY: // close application + hProgress = INVALID_HANDLE_VALUE; + return (INT_PTR)FALSE; + + } + return DefWindowProc(hDlg, message, wParam, lParam); +} + +/* + * Call a blocking function (returning an int) as a modal thread with a progress bar + */ +int run_with_progress_bar(HWND hWnd, int(*function)(void*), void* arglist) { + HWND hDlg; + MSG msg; + WNDCLASSEX wc; + BOOL r; + + if ( (function == NULL) || (hWnd == NULL) ) { + return WDI_ERROR_INVALID_PARAM; + } + + app_instance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); + + // protect access to the thread variables and prevent 2 progress + // dialogs from executing at the same time + progress_mutex = CreateMutex(NULL, TRUE, NULL); + if ((progress_mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) { + wdi_err("could not obtain progress dialog mutex - is another dialog active?"); + progress_mutex = INVALID_HANDLE_VALUE; + return WDI_ERROR_BUSY; + } + progress_function = function; + progress_arglist = arglist; + + // Since our lib can be static, we can't use resources + // => create the whole dialog manually. + + // First we create Window class if it doesn't already exist + if (!GetClassInfoExA(app_instance, "wdi_progress_class", &wc)) { + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = CS_DBLCLKS | CS_SAVEBITS; + wc.lpfnWndProc = progress_callback; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = app_instance; + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.lpszClassName = "wdi_progress_class"; + wc.lpszMenuName = NULL; + wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE); + + if (!RegisterClassExA(&wc)) { + wdi_err("can't register class %s", windows_error_str(0)); + safe_closehandle(progress_mutex); + return WDI_ERROR_RESOURCE; + } + } + + // Then we create the dialog base + hDlg = CreateWindowExA(WS_EX_WINDOWEDGE | WS_EX_CONTROLPARENT, + "wdi_progress_class", "Installing driver...", + WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CAPTION | WS_POPUP | WS_VISIBLE | WS_THICKFRAME, + 100, 100, 287, 102, hWnd, NULL, app_instance, NULL); + if (hDlg == NULL) { + wdi_err("Unable to create progress dialog: %s", windows_error_str(0)); + safe_closehandle(progress_mutex); + return WDI_ERROR_RESOURCE; + } + + // Finally we Display the dialog... + ShowWindow(hDlg, SW_SHOWNORMAL); + UpdateWindow(hDlg); + + // ...and handle the message processing loop + while( (r = GetMessage(&msg, NULL, 0, 0)) != 0) { + if (r == -1) { + wdi_err("GetMessage error"); + } else { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + safe_closehandle(progress_mutex); + + return (int)msg.wParam; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dll_2008.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dll_2008.vcproj new file mode 100644 index 0000000..f90a278 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_dll_2008.vcproj @@ -0,0 +1,369 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_sources b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_sources new file mode 100644 index 0000000..00d7a0b --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_sources @@ -0,0 +1,33 @@ +#TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build +TARGETNAME=libwdi +#Must be set, else DLL build will look for libwdi.def +DLLDEF= + +#DLL_EXPORT must be provided as a macro when buidling a DLL +!IF "$(TARGETTYPE)"=="DYNLINK" +DLL_DEFINES=/DDLL_EXPORT +!ENDIF + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +INCLUDES=..\msvc;$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD $(DLL_DEFINES) +LINKER_FLAGS=/ignore:4006 + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\ole32.lib + +SOURCES=logging.c \ + libwdi.c \ + libwdi_dlg.c \ + tokenizer.c \ + vid_data.c \ + libwdi.rc diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcproj new file mode 100644 index 0000000..799b9ad --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcproj @@ -0,0 +1,218 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj new file mode 100644 index 0000000..dee5226 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj @@ -0,0 +1,124 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + libwdi (static) + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} + libwdi + + + + StaticLibrary + MultiByte + true + + + StaticLibrary + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\lib\ + $(SolutionDir)$(Platform)\$(Configuration)\lib\libwdi\ + $(SolutionDir)$(Platform)\$(Configuration)\lib\ + $(SolutionDir)$(Platform)\$(Configuration)\lib\libwdi\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + Embedding binary resources + $(TargetDir)\..\helper\embedder $(ProjectDir)\embedded.h + + + Disabled + ..\msvc;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;OPT_M64;OPT_M32;USER_DIR="";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + + + E:\WinDDK\7600.16385.0;%(AdditionalIncludeDirectories) + + + + + Embedding binary resources + $(TargetDir)\..\helper\embedder $(ProjectDir)\embedded.h + + + MaxSpeed + true + ..\msvc;%(AdditionalIncludeDirectories) + _WIN32;_LIB;_CRT_SECURE_NO_WARNINGS;OPT_M64;OPT_M32;USER_DIR="";%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + + + E:\WinDDK\7600.16385.0;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + {792d44d5-28a7-4eb3-b84b-8021fe3189f9} + false + + + {e5a56ee0-182f-470f-8cdc-8c1b7b86ee26} + false + + + {9b1c561e-f95b-4849-a7aa-a4350e227c20} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.filters new file mode 100644 index 0000000..4eed6a0 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.filters @@ -0,0 +1,58 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {8a69c287-59a1-4d2d-87e8-7357b561fe4f} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.c new file mode 100644 index 0000000..a50a8a2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.c @@ -0,0 +1,331 @@ +/* + * libwdi logging functions + * Copyright (c) Johannes Erdfelt, Daniel Drake et al. + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "libwdi.h" +#include "logging.h" + +HANDLE logger_rd_handle = INVALID_HANDLE_VALUE; +HANDLE logger_wr_handle = INVALID_HANDLE_VALUE; +// Handle and Message for the destination Window when registered +HWND logger_dest = NULL; +UINT logger_msg = 0; +// Detect spurious log readouts +unsigned log_messages_pending = 0; +// Global debug level +static int global_log_level = WDI_LOG_LEVEL_INFO; + +extern char *windows_error_str(uint32_t retval); + +void pipe_wdi_log_v(enum wdi_log_level level, + const char *function, const char *format, va_list args) +{ + char buffer[LOGBUF_SIZE]; + DWORD junk; + int size1, size2; + bool truncated = false; + const char* prefix; + const char* truncation_notice = "TRUNCATION detected for above line - Please " + "send this log excerpt to the libwdi developers so we can fix it."; + + if (logger_wr_handle == INVALID_HANDLE_VALUE) + return; + +#ifndef ENABLE_DEBUG_LOGGING + if (level < global_log_level) + return; +#endif + + switch (level) { + case WDI_LOG_LEVEL_INFO: + prefix = "info"; + break; + case WDI_LOG_LEVEL_WARNING: + prefix = "warning"; + break; + case WDI_LOG_LEVEL_ERROR: + prefix = "error"; + break; + case WDI_LOG_LEVEL_DEBUG: + prefix = "debug"; + break; + default: + prefix = "unknown"; + break; + } + + size1 = safe_snprintf(buffer, LOGBUF_SIZE, "libwdi:%s [%s] ", prefix, function); + size2 = 0; + if (size1 < 0) { + buffer[LOGBUF_SIZE-1] = 0; + size1 = LOGBUF_SIZE-1; + truncated = true; + } else { + size2 = safe_vsnprintf(buffer+size1, LOGBUF_SIZE-size1, format, args); + if (size2 < 0) { + buffer[LOGBUF_SIZE-1] = 0; + size2 = LOGBUF_SIZE-1-size1; + truncated = true; + } + } + + // http://msdn.microsoft.com/en-us/library/aa365150%28VS.85%29.aspx: + // "if your specified buffer size is too small, the system will grow the + // buffer as needed, but the downside is that the operation will block + // until the (existing) data is read from the pipe." + // Existing pipe data should have produced a notification, but if the pipe + // is left to fill without readout, we might run into blocking log calls. + // TODO: address this potential issue if it is reported + WriteFile(logger_wr_handle, buffer, (DWORD)(size1+size2+1), &junk, NULL); + + // Notify the destination window of a new log message + log_messages_pending++; + PostMessage(logger_dest, logger_msg, level, 0); + + if (truncated) { + WriteFile(logger_wr_handle, truncation_notice, + (DWORD)strlen(truncation_notice)+1, &junk, NULL); + log_messages_pending++; + PostMessage(logger_dest, logger_msg, (WPARAM)level, 0); + } + +} + +void console_wdi_log_v(enum wdi_log_level level, + const char *function, const char *format, va_list args) +{ + FILE *stream; + const char *prefix; +#ifdef LOG_OUTPUT_DEBUGWINDOW + char fmt[LOGBUF_SIZE]; + char buf[LOGBUF_SIZE]; +#endif + stream = stdout; + +#ifndef ENABLE_DEBUG_LOGGING + if (level < global_log_level) + return; +#endif + + switch (level) { + case WDI_LOG_LEVEL_INFO: + prefix = "info"; + break; + case WDI_LOG_LEVEL_WARNING: + stream = stderr; + prefix = "warning"; + break; + case WDI_LOG_LEVEL_ERROR: + stream = stderr; + prefix = "error"; + break; + case WDI_LOG_LEVEL_DEBUG: + stream = stderr; + prefix = "debug"; + break; + default: + stream = stderr; + prefix = "unknown"; + break; + } +#ifdef LOG_OUTPUT_DEBUGWINDOW + safe_snprintf(fmt, LOGBUF_SIZE, "libwdi:%s [%s] %s\n", prefix, function, format); + + safe_vsnprintf(buf,LOGBUF_SIZE, fmt, args); + + OutputDebugStringA(buf); +#else + fprintf(stream, "libwdi:%s [%s] ", prefix, function); + + vfprintf(stream, format, args); + + fprintf(stream, "\n"); +#endif + +} + +void wdi_log(enum wdi_log_level level, + const char *function, const char *format, ...) +{ + va_list args; + + va_start (args, format); + if (logger_dest != NULL) { + pipe_wdi_log_v(level, function, format, args); + } else { + console_wdi_log_v(level, function, format, args); + } + va_end (args); +} + +// Create a synchronous pipe for messaging +int create_logger(DWORD buffsize) +{ + if (buffsize == 0) { + buffsize = LOGGER_PIPE_SIZE; + } + + if (logger_wr_handle != INVALID_HANDLE_VALUE) { + // We (supposedly) don't have logging, so try to reach a stderr + fprintf(stderr, "trying to recreate logger pipe\n"); + return WDI_ERROR_EXISTS; + } + + // Read end of the pipe + logger_rd_handle = CreateNamedPipe(LOGGER_PIPE_NAME, PIPE_ACCESS_INBOUND, + PIPE_TYPE_MESSAGE|PIPE_READMODE_MESSAGE, 1, buffsize, buffsize, 0, NULL); + if (logger_rd_handle == INVALID_HANDLE_VALUE) { + fprintf(stderr, "could not create logger pipe for reading: %s\n", windows_error_str(0)); + return WDI_ERROR_RESOURCE; + } + + // Write end of the pipe + logger_wr_handle = CreateFile(LOGGER_PIPE_NAME, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); + if (logger_wr_handle == INVALID_HANDLE_VALUE) { + fprintf(stderr, "could not create logger pipe for writing: %s\n", windows_error_str(0)); + CloseHandle(logger_rd_handle); + logger_rd_handle = INVALID_HANDLE_VALUE; + return WDI_ERROR_RESOURCE; + } + + log_messages_pending = 0; + + return WDI_SUCCESS; +} + +// Destroy the logging pipe +void destroy_logger(void) +{ + if (logger_wr_handle != INVALID_HANDLE_VALUE) { + CloseHandle(logger_wr_handle); + logger_wr_handle = INVALID_HANDLE_VALUE; + } + if (logger_rd_handle != INVALID_HANDLE_VALUE) { + CloseHandle(logger_rd_handle); + logger_rd_handle = INVALID_HANDLE_VALUE; + } +} + +/* + * Register a Window as destination for logging message + * This Window will be notified with a message event and should call + * wdi_read_logger() to retreive the message data + */ +int LIBWDI_API wdi_register_logger(HWND hWnd, UINT message, DWORD buffsize) +{ + int r; + + MUTEX_START; + + if (logger_dest != NULL) { + MUTEX_RETURN WDI_ERROR_EXISTS; + } + + r = create_logger(buffsize); + if (r == WDI_SUCCESS) { + logger_dest = hWnd; + logger_msg = message; + } + + MUTEX_RETURN r; +} + +/* + * Unregister a Window as destination for logging message + */ +int LIBWDI_API wdi_unregister_logger(HWND hWnd) +{ + MUTEX_START; + + if (logger_dest == NULL) { + MUTEX_RETURN WDI_SUCCESS; + } + + if (logger_dest != hWnd) { + MUTEX_RETURN WDI_ERROR_INVALID_PARAM; + } + + destroy_logger(); + logger_dest = NULL; + logger_msg = 0; + + MUTEX_RETURN WDI_SUCCESS; +} + +/* + * Read a log message + */ +int LIBWDI_API wdi_read_logger(char* buffer, DWORD buffer_size, DWORD* message_size) +{ + int size; + DWORD r; + + MUTEX_START; + + if ( (logger_rd_handle == INVALID_HANDLE_VALUE) && (create_logger(0) != WDI_SUCCESS) ) { + *message_size = 0; + MUTEX_RETURN WDI_ERROR_NOT_FOUND; + } + + if (log_messages_pending == 0) { + size = safe_snprintf(buffer, buffer_size, "ERROR: log buffer is empty"); + if (size <0) { + buffer[buffer_size-1] = 0; + MUTEX_RETURN buffer_size; + } + *message_size = (DWORD)size; + MUTEX_RETURN WDI_SUCCESS; + } + log_messages_pending--; + + if (ReadFile(logger_rd_handle, (void*)buffer, buffer_size, message_size, NULL)) { + MUTEX_RETURN WDI_SUCCESS; + } + + *message_size = 0; + r = GetLastError(); + if ((r == ERROR_INSUFFICIENT_BUFFER) || (r == ERROR_MORE_DATA)) { + MUTEX_RETURN WDI_ERROR_OVERFLOW; + } + MUTEX_RETURN WDI_ERROR_IO; +} + +/* + * Set the global log level. Only works if ENABLE_DEBUG_LOGGING is not set + */ +int LIBWDI_API wdi_set_log_level(int level) +{ +#if defined(ENABLE_DEBUG_LOGGING) + return WDI_ERROR_NOT_SUPPORTED; +#endif + if ( (level < WDI_LOG_LEVEL_DEBUG) || (level > WDI_LOG_LEVEL_ERROR) ) { + return WDI_ERROR_INVALID_PARAM; + } + global_log_level = level; + return WDI_SUCCESS; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.h new file mode 100644 index 0000000..386b7b0 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/logging.h @@ -0,0 +1,93 @@ +/* + * libwdi logging functions + * Copyright (c) Johannes Erdfelt, Daniel Drake et al. + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#pragma once + +#define LOGGER_PIPE_NAME "\\\\.\\pipe\\libwdi-logger" +#define LOGGER_PIPE_SIZE 8192 +#define LOGBUF_SIZE 512 + +// Prevent two exclusive libwdi calls from running at the same time +#define MUTEX_START char mutex_name[10+sizeof(__FUNCTION__)]; HANDLE mutex; \ + safe_snprintf(mutex_name, 10+sizeof(__FUNCTION__), "Global\\%s", __FUNCTION__); \ + mutex = CreateMutex(NULL, TRUE, mutex_name); \ + if ((mutex == NULL) || (GetLastError() == ERROR_ALREADY_EXISTS)) return WDI_ERROR_BUSY +#define MUTEX_RETURN CloseHandle(mutex); return + +#if defined(_MSC_VER) +#define safe_vsnprintf(buf, size, format, arg) _vsnprintf_s(buf, size, _TRUNCATE, format, arg) +#define safe_snprintf(buf, size, ...) _snprintf_s(buf, size, _TRUNCATE, __VA_ARGS__) +#else +#define safe_vsnprintf vsnprintf +#define safe_snprintf snprintf +#endif + + +#if !defined(_MSC_VER) || _MSC_VER > 1200 + +#if defined(ENABLE_DEBUG_LOGGING) || defined(INCLUDE_DEBUG_LOGGING) +#define _wdi_log(level, ...) wdi_log(level, __FUNCTION__, __VA_ARGS__) +#else +#define _wdi_log(level, ...) +#endif + +#if defined(ENABLE_DEBUG_LOGGING) || defined(INCLUDE_DEBUG_LOGGING) +#define wdi_dbg(...) _wdi_log(WDI_LOG_LEVEL_DEBUG, __VA_ARGS__) +#else +#define wdi_dbg(...) +#endif + +#define wdi_info(...) _wdi_log(WDI_LOG_LEVEL_INFO, __VA_ARGS__) +#define wdi_warn(...) _wdi_log(WDI_LOG_LEVEL_WARNING, __VA_ARGS__) +#define wdi_err(...) _wdi_log(WDI_LOG_LEVEL_ERROR, __VA_ARGS__) + +#else /* !defined(_MSC_VER) || _MSC_VER > 1200 */ + +void wdi_log_v(enum wdi_log_level level, + const char *function, const char *format, va_list args); + +#if defined(ENABLE_DEBUG_LOGGING) || defined(INCLUDE_DEBUG_LOGGING) +#define LOG_BODY(level) \ +{ \ + va_list args; \ + va_start (args, format); \ + wdi_log_v(level, "", format, args); \ + va_end(args); \ +} +#else +#define LOG_BODY(level) { } +#endif + +void inline wdi_info(const char *format, ...) + LOG_BODY(LOG_LEVEL_INFO) +void inline wdi_warn(const char *format, ...) + LOG_BODY(LOG_LEVEL_WARNING) +void inline wdi_err( const char *format, ...) + LOG_BODY(LOG_LEVEL_ERROR) + +void inline wdi_dbg(const char *format, ...) +#if defined(ENABLE_DEBUG_LOGGING) || defined(INCLUDE_DEBUG_LOGGING) + LOG_BODY(LOG_LEVEL_DEBUG) +#else +{ } +#endif + +#endif /* !defined(_MSC_VER) || _MSC_VER > 1200 */ + +extern void wdi_log(enum wdi_log_level level, const char *function, const char *format, ...); diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/msapi_utf8.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/msapi_utf8.h new file mode 100644 index 0000000..f31c5f4 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/msapi_utf8.h @@ -0,0 +1,536 @@ +/* + * MSAPI_UTF8: Common API calls using UTF-8 strings + * Compensating for what Microsoft should have done a long long time ago. + * + * Copyright (c) 2010 Pete Batard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define wchar_to_utf8_no_alloc(wsrc, dest, dest_size) \ + WideCharToMultiByte(CP_UTF8, 0, wsrc, -1, dest, dest_size, NULL, NULL) +#define utf8_to_wchar_no_alloc(src, wdest, wdest_size) \ + MultiByteToWideChar(CP_UTF8, 0, src, -1, wdest, wdest_size) +#define Edit_ReplaceSelU(hCtrl, str) ((void)SendMessageLU(hCtrl, EM_REPLACESEL, (WPARAM)FALSE, str)) +#define ComboBox_AddStringU(hCtrl, str) ((int)(DWORD)SendMessageLU(hCtrl, CB_ADDSTRING, (WPARAM)FALSE, str)) +#define ComboBox_GetTextU(hCtrl, str, max_str) GetWindowTextU(hCtrl, str, max_str) +#define GetSaveFileNameU(p) GetOpenSaveFileNameU(p, TRUE) +#define GetOpenFileNameU(p) GetOpenSaveFileNameU(p, FALSE) +#define ListView_SetItemTextU(hwndLV,i,iSubItem_,pszText_) { LVITEMW _ms_wlvi; _ms_wlvi.iSubItem = iSubItem_; \ + _ms_wlvi.pszText = utf8_to_wchar(pszText_); \ + SNDMSG((hwndLV),LVM_SETITEMTEXTW,(WPARAM)(i),(LPARAM)&_ms_wlvi); sfree(_ms_wlvi.pszText);} + +#define sfree(p) do {if (p != NULL) {free((void*)(p)); p = NULL;}} while(0) +#define wconvert(p) wchar_t* w ## p = utf8_to_wchar(p) +#define walloc(p, size) wchar_t* w ## p = calloc(size, sizeof(wchar_t)) +#define wfree(p) sfree(w ## p) + +/* + * Converts an UTF-16 string to UTF8 (allocate returned string) + * Returns NULL on error + */ +static __inline char* wchar_to_utf8(const wchar_t* wstr) +{ + int size = 0; + char* str = NULL; + + // Find out the size we need to allocate for our converted string + size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL); + if (size <= 1) // An empty string would be size 1 + return NULL; + + if ((str = (char*)calloc(size, 1)) == NULL) + return NULL; + + if (wchar_to_utf8_no_alloc(wstr, str, size) != size) { + sfree(str); + return NULL; + } + + return str; +} + +/* + * Converts an UTF8 string to UTF-16 (allocate returned string) + * Returns NULL on error + */ +static __inline wchar_t* utf8_to_wchar(const char* str) +{ + int size = 0; + wchar_t* wstr = NULL; + + // Find out the size we need to allocate for our converted string + size = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); + if (size <= 1) // An empty string would be size 1 + return NULL; + + if ((wstr = (wchar_t*)calloc(size, sizeof(wchar_t))) == NULL) + return NULL; + + if (utf8_to_wchar_no_alloc(str, wstr, size) != size) { + sfree(wstr); + return NULL; + } + return wstr; +} + +static __inline DWORD FormatMessageU(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, + DWORD dwLanguageId, char* lpBuffer, DWORD nSize, va_list *Arguments) +{ + DWORD ret = 0, err = ERROR_INVALID_DATA; + walloc(lpBuffer, nSize); + ret = FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId, wlpBuffer, nSize, Arguments); + err = GetLastError(); + if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nSize)) == 0)) { + err = GetLastError(); + ret = 0; + } + wfree(lpBuffer); + SetLastError(err); + return ret; +} + +// SendMessage, with LPARAM as UTF-8 string +static __inline LRESULT SendMessageLU(HWND hWnd, UINT Msg, WPARAM wParam, const char* lParam) +{ + LRESULT ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(lParam); + ret = SendMessageW(hWnd, Msg, wParam, (LPARAM)wlParam); + err = GetLastError(); + wfree(lParam); + SetLastError(err); + return ret; +} + +static __inline BOOL SHGetPathFromIDListU(LPCITEMIDLIST pidl, char* pszPath) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + walloc(pszPath, MAX_PATH); + ret = SHGetPathFromIDListW(pidl, wpszPath); + err = GetLastError(); + if ((ret) && (wchar_to_utf8_no_alloc(wpszPath, pszPath, MAX_PATH) == 0)) { + err = GetLastError(); + ret = FALSE; + } + wfree(pszPath); + SetLastError(err); + return ret; +} + +static __inline HWND CreateWindowU(char* lpClassName, char* lpWindowName, + DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, + HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) +{ + HWND ret = NULL; + DWORD err = ERROR_INVALID_DATA; + wconvert(lpClassName); + wconvert(lpWindowName); + ret = CreateWindowW(wlpClassName, wlpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + err = GetLastError(); + wfree(lpClassName); + wfree(lpWindowName); + SetLastError(err); + return ret; +} + +static __inline int GetWindowTextU(HWND hWnd, char* lpString, int nMaxCount) +{ + int ret = 0; + DWORD err = ERROR_INVALID_DATA; + walloc(lpString, nMaxCount); + ret = GetWindowTextW(hWnd, wlpString, nMaxCount); + err = GetLastError(); + if ( (ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0) ) { + err = GetLastError(); + } + wfree(lpString); + SetLastError(err); + return ret; +} + +static __inline BOOL SetWindowTextU(HWND hWnd, const char* lpString) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(lpString); + ret = SetWindowTextW(hWnd, wlpString); + err = GetLastError(); + wfree(lpString); + SetLastError(err); + return ret; +} + +static __inline int GetWindowTextLengthU(HWND hWnd) +{ + int ret = 0; + DWORD err = ERROR_INVALID_DATA; + wchar_t* wbuf = NULL; + char* buf = NULL; + + ret = GetWindowTextLengthW(hWnd); + err = GetLastError(); + if (ret == 0) goto out; + wbuf = calloc(ret, sizeof(wchar_t)); + err = GetLastError(); + if (wbuf == NULL) { + err = ERROR_OUTOFMEMORY; ret = 0; goto out; + } + ret = GetWindowTextW(hWnd, wbuf, ret); + err = GetLastError(); + if (ret == 0) goto out; + buf = wchar_to_utf8(wbuf); + err = GetLastError(); + if (buf == NULL) { + err = ERROR_OUTOFMEMORY; ret = 0; goto out; + } + ret = (int)strlen(buf) + 2; // GetDlgItemText seems to add a character + err = GetLastError(); +out: + sfree(wbuf); + sfree(buf); + return ret; +} + +static __inline UINT GetDlgItemTextU(HWND hDlg, int nIDDlgItem, char* lpString, int nMaxCount) +{ + UINT ret = 0; + DWORD err = ERROR_INVALID_DATA; + walloc(lpString, nMaxCount); + ret = GetDlgItemTextW(hDlg, nIDDlgItem, wlpString, nMaxCount); + err = GetLastError(); + if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpString, lpString, nMaxCount)) == 0)) { + err = GetLastError(); + } + wfree(lpString); + SetLastError(err); + return ret; +} + +static __inline BOOL SetDlgItemTextU(HWND hDlg, int nIDDlgItem, const char* lpString) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(lpString); + ret = SetDlgItemTextW(hDlg, nIDDlgItem, wlpString); + err = GetLastError(); + wfree(lpString); + SetLastError(err); + return ret; +} + +static __inline HANDLE CreateFileU(const char* lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, + LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, + DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +{ + HANDLE ret = INVALID_HANDLE_VALUE; + DWORD err = ERROR_INVALID_DATA; + wconvert(lpFileName); + ret = CreateFileW(wlpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, + dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); + err = GetLastError(); + wfree(lpFileName); + SetLastError(err); + return ret; +} + +// This function differs from regular GetTextExtentPoint in that it uses a zero terminated string +static __inline BOOL GetTextExtentPointU(HDC hdc, const char* lpString, LPSIZE lpSize) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(lpString); + ret = GetTextExtentPointW(hdc, wlpString, (int)wcslen(wlpString)+1, lpSize); + err = GetLastError(); + wfree(lpString); + SetLastError(err); + return ret; +} + +static __inline DWORD GetCurrentDirectoryU(DWORD nBufferLength, char* lpBuffer) +{ + DWORD ret = 0, err = ERROR_INVALID_DATA; + walloc(lpBuffer, nBufferLength); + ret = GetCurrentDirectoryW(nBufferLength, wlpBuffer); + err = GetLastError(); + if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) { + err = GetLastError(); + } + wfree(lpBuffer); + SetLastError(err); + return ret; +} + +static __inline DWORD GetFullPathNameU(const char* lpFileName, DWORD nBufferLength, char* lpBuffer, char** lpFilePart) +{ + DWORD ret = 0, err = ERROR_INVALID_DATA; + wchar_t* wlpFilePart; + wconvert(lpFileName); + walloc(lpBuffer, nBufferLength); + + // lpFilePart is not supported + if (lpFilePart != NULL) goto out; + + ret = GetFullPathNameW(wlpFileName, nBufferLength, wlpBuffer, &wlpFilePart); + err = GetLastError(); + if ((ret != 0) && ((ret = wchar_to_utf8_no_alloc(wlpBuffer, lpBuffer, nBufferLength)) == 0)) { + err = GetLastError(); + } + +out: + wfree(lpBuffer); + wfree(lpFileName); + SetLastError(err); + return ret; +} + +static __inline DWORD GetFileAttributesU(const char* lpFileName) +{ + DWORD ret = 0xFFFFFFFF, err = ERROR_INVALID_DATA; + wconvert(lpFileName); + ret = GetFileAttributesW(wlpFileName); + err = GetLastError(); + wfree(lpFileName); + SetLastError(err); + return ret; +} + +static __inline int SHCreateDirectoryExU(HWND hwnd, const char* pszPath, SECURITY_ATTRIBUTES *psa) +{ + int ret = ERROR_INVALID_DATA; + DWORD err = ERROR_INVALID_DATA; + wconvert(pszPath); + ret = SHCreateDirectoryExW(hwnd, wpszPath, psa); + err = GetLastError(); + wfree(pszPath); + SetLastError(err); + return ret; +} + +static __inline BOOL ShellExecuteExU(SHELLEXECUTEINFOA* lpExecInfo) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + SHELLEXECUTEINFOW wExecInfo; + + // Because we're lazy, we'll assume that the A and W structs inherently have the same size + if (lpExecInfo->cbSize != sizeof(SHELLEXECUTEINFOW)) { + SetLastError(ERROR_BAD_LENGTH); return FALSE; + } + memcpy(&wExecInfo, lpExecInfo, lpExecInfo->cbSize); + wExecInfo.lpVerb = utf8_to_wchar(lpExecInfo->lpVerb); + wExecInfo.lpFile = utf8_to_wchar(lpExecInfo->lpFile); + wExecInfo.lpParameters = utf8_to_wchar(lpExecInfo->lpParameters); + wExecInfo.lpDirectory = utf8_to_wchar(lpExecInfo->lpDirectory); + if (wExecInfo.fMask & SEE_MASK_CLASSNAME) { + wExecInfo.lpClass = utf8_to_wchar(lpExecInfo->lpClass); + } else { + wExecInfo.lpClass = NULL; + } + ret = ShellExecuteExW(&wExecInfo); + err = GetLastError(); + // Copy the returned values back + lpExecInfo->hInstApp = wExecInfo.hInstApp; + lpExecInfo->hProcess = wExecInfo.hProcess; + sfree(wExecInfo.lpVerb); + sfree(wExecInfo.lpFile); + sfree(wExecInfo.lpParameters); + sfree(wExecInfo.lpDirectory); + sfree(wExecInfo.lpClass); + SetLastError(err); + return ret; +} + +// Doesn't support LPSTARTUPINFOEX struct +static __inline BOOL CreateProcessU(const char* lpApplicationName, const char* lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, + LPVOID lpEnvironment, const char* lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + STARTUPINFOW wStartupInfo; + wconvert(lpApplicationName); + wconvert(lpCommandLine); + wconvert(lpCurrentDirectory); + + // Because we're lazy, we'll assume that the A and W structs inherently have the same size + // Also prevents the use of STARTUPINFOEX + if (lpStartupInfo->cb != sizeof(STARTUPINFOW)) { + err = ERROR_BAD_LENGTH; goto out; + } + memcpy(&wStartupInfo, lpStartupInfo, lpStartupInfo->cb); + wStartupInfo.lpDesktop = utf8_to_wchar(lpStartupInfo->lpDesktop); + wStartupInfo.lpTitle = utf8_to_wchar(lpStartupInfo->lpTitle); + ret = CreateProcessW(wlpApplicationName, wlpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, + dwCreationFlags, lpEnvironment, wlpCurrentDirectory, &wStartupInfo, lpProcessInformation); + err = GetLastError(); + sfree(wStartupInfo.lpDesktop); + sfree(wStartupInfo.lpTitle); +out: + wfree(lpApplicationName); + wfree(lpCommandLine); + wfree(lpCurrentDirectory); + return ret; +} + +// NOTE: when used, nFileOffset & nFileExtension MUST be provided +// in number of Unicode characters, NOT number of UTF-8 bytes +static __inline BOOL WINAPI GetOpenSaveFileNameU(LPOPENFILENAMEA lpofn, BOOL save) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + size_t i, len; + OPENFILENAMEW wofn; + memset(&wofn, 0, sizeof(wofn)); + wofn.lStructSize = sizeof(wofn); + wofn.hwndOwner = lpofn->hwndOwner; + wofn.hInstance = lpofn->hInstance; + + // No support for custom filters + if (lpofn->lpstrCustomFilter != NULL) goto out; + + // Count on Microsoft to use an moronic scheme for filters + // that relies on NULL separators and double NULL terminators + if (lpofn->lpstrFilter != NULL) { + // Replace the NULLs by something that can be converted + for (i=0; ; i++) { + if (lpofn->lpstrFilter[i] == 0) { + ((char*)lpofn->lpstrFilter)[i] = '\r'; + if (lpofn->lpstrFilter[i+1] == 0) { + break; + } + } + } + wofn.lpstrFilter = utf8_to_wchar(lpofn->lpstrFilter); + // And revert + len = wcslen(wofn.lpstrFilter); // don't use in the loop as it would be reevaluated + for (i=0; ilpstrFilter); + for (i=0; ilpstrFilter[i] == '\r') { + ((char*)lpofn->lpstrFilter)[i] = 0; + } + } + } else { + wofn.lpstrFilter = NULL; + } + wofn.nMaxCustFilter = lpofn->nMaxCustFilter; + wofn.nFilterIndex = lpofn->nFilterIndex; + wofn.lpstrFile = calloc(lpofn->nMaxFile, sizeof(wchar_t)); + utf8_to_wchar_no_alloc(lpofn->lpstrFile, wofn.lpstrFile, lpofn->nMaxFile); + wofn.nMaxFile = lpofn->nMaxFile; + wofn.lpstrFileTitle = calloc(lpofn->nMaxFileTitle, sizeof(wchar_t)); + utf8_to_wchar_no_alloc(lpofn->lpstrFileTitle, wofn.lpstrFileTitle, lpofn->nMaxFileTitle); + wofn.nMaxFileTitle = lpofn->nMaxFileTitle; + wofn.lpstrInitialDir = utf8_to_wchar(lpofn->lpstrInitialDir); + wofn.lpstrTitle = utf8_to_wchar(lpofn->lpstrTitle); + wofn.Flags = lpofn->Flags; + wofn.nFileOffset = lpofn->nFileOffset; + wofn.nFileExtension = lpofn->nFileExtension; + wofn.lpstrDefExt = utf8_to_wchar(lpofn->lpstrDefExt); + wofn.lCustData = lpofn->lCustData; + wofn.lpfnHook = lpofn->lpfnHook; + wofn.lpTemplateName = utf8_to_wchar(lpofn->lpTemplateName); + wofn.pvReserved = lpofn->pvReserved; + wofn.dwReserved = lpofn->dwReserved; + wofn.FlagsEx = lpofn->FlagsEx; + + if (save) { + ret = GetSaveFileNameW(&wofn); + } else { + ret = GetOpenFileNameW(&wofn); + } + err = GetLastError(); + if ( (ret) + && ( (wchar_to_utf8_no_alloc(wofn.lpstrFile, lpofn->lpstrFile, lpofn->nMaxFile) == 0) + || (wchar_to_utf8_no_alloc(wofn.lpstrFileTitle, lpofn->lpstrFileTitle, lpofn->nMaxFileTitle) == 0) ) ) { + err = GetLastError(); + ret = FALSE; + } +out: + sfree(wofn.lpstrDefExt); + sfree(wofn.lpstrFile); + sfree(wofn.lpstrFileTitle); + sfree(wofn.lpstrFilter); + sfree(wofn.lpstrInitialDir); + sfree(wofn.lpstrTitle); + sfree(wofn.lpTemplateName); + SetLastError(err); + return ret; +} + +extern BOOL WINAPI UpdateDriverForPlugAndPlayDevicesW(HWND hwndParent, LPCWSTR HardwareId, + LPCWSTR FullInfPath, DWORD InstallFlags, PBOOL bRebootRequired); + +static __inline BOOL UpdateDriverForPlugAndPlayDevicesU(HWND hwndParent, const char* HardwareId, const char* FullInfPath, + DWORD InstallFlags, PBOOL bRebootRequired) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(HardwareId); + wconvert(FullInfPath); + ret = UpdateDriverForPlugAndPlayDevicesW(hwndParent, wHardwareId, wFullInfPath, InstallFlags, bRebootRequired); + err = GetLastError(); + wfree(HardwareId); + wfree(FullInfPath); + SetLastError(err); + return ret; +} + +static __inline BOOL SetupCopyOEMInfU(const char* SourceInfFileName, const char* OEMSourceMediaLocation, DWORD OEMSourceMediaType, + DWORD CopyStyle, char* DestinationInfFileName, DWORD DestinationInfFileNameSize, + PDWORD RequiredSize, PTSTR DestinationInfFileNameComponent) +{ + BOOL ret = FALSE; + DWORD err = ERROR_INVALID_DATA; + wconvert(SourceInfFileName); + wconvert(OEMSourceMediaLocation); + walloc(DestinationInfFileName, DestinationInfFileNameSize); + + // DestinationInfFileNameComponent is not supported + if (DestinationInfFileNameComponent != NULL) goto out; + + ret = SetupCopyOEMInfW(wSourceInfFileName, wOEMSourceMediaLocation, OEMSourceMediaType, CopyStyle, + wDestinationInfFileName, DestinationInfFileNameSize, RequiredSize, NULL); + err = GetLastError(); + if ((ret != FALSE) && ((ret = wchar_to_utf8_no_alloc(wDestinationInfFileName, DestinationInfFileName, DestinationInfFileNameSize)) == 0)) { + err = GetLastError(); + } +out: + wfree(SourceInfFileName); + wfree(OEMSourceMediaLocation); + wfree(DestinationInfFileName); + SetLastError(err); + return ret; +} + +#ifdef __cplusplus +} +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/resource.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/resource.h new file mode 100644 index 0000000..b2598e9 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by libwdi.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1003 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/sources b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/sources new file mode 100644 index 0000000..0c5555a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/sources @@ -0,0 +1,35 @@ +TARGETTYPE=LIBRARY +#TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build +TARGETNAME=libwdi +#Must be set, else DLL build will look for libwdi.def +DLLDEF= + +#DLL_EXPORT must be provided as a macro when buidling a DLL +!IF "$(TARGETTYPE)"=="DYNLINK" +DLL_DEFINES=/DDLL_EXPORT +!ENDIF + +!IFNDEF MSC_WARNING_LEVEL +MSC_WARNING_LEVEL=/W3 +!ENDIF + +USE_MSVCRT=1 + +INCLUDES=..\msvc;$(DDK_INC_PATH) +C_DEFINES = $(C_DEFINES) /DDDKBUILD $(DLL_DEFINES) +LINKER_FLAGS=/ignore:4006 + +TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \ + $(SDK_LIB_PATH)\advapi32.lib \ + $(SDK_LIB_PATH)\user32.lib \ + $(SDK_LIB_PATH)\shell32.lib \ + $(SDK_LIB_PATH)\setupapi.lib \ + $(SDK_LIB_PATH)\ole32.lib + +SOURCES=logging.c \ + libwdi.c \ + libwdi_dlg.c \ + tokenizer.c \ + vid_data.c \ + libwdi.rc + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.c new file mode 100644 index 0000000..1e273ee --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.c @@ -0,0 +1,234 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2010 Travis Robinson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +*/ + +/* +08/05/2010 Revisions: + o minor string macro improvements +07/23/2010 Revisions: + o Fixed positive return value if memory allocation fails + o Changed grow size from 8192 to 1024 +*/ + +#include "tokenizer.h" +#include + +#define safe_min(a, b) min((size_t)(a), (size_t)(b)) +#define safe_strncpy(dst, dst_max, src, count) strncpy(dst, src, safe_min(count, dst_max - 1)) + +// If the dst buffer is to small it grows to what is needed+GROW_SIZE +#define GetDestSize(RequiredSize) RequiredSize+1024 + +BOOL grow_strcpy(char** DstPtr, char** DstPtrOrig, long* DstPos, long* DstAllocSize, + const char* ReplaceString, long ReplaceLength) +{ + if ((*DstPos)+(ReplaceLength) >= (*DstAllocSize)) + { + *DstAllocSize = GetDestSize((*DstPos) + ReplaceLength); + *DstPtr = realloc((*DstPtr),(*DstAllocSize)); + } + if (!(*DstPtr)) + { + free((*DstPtrOrig)); + return FALSE; + } + *DstPtrOrig = (*DstPtr); + safe_strncpy(((*DstPtr)+(*DstPos)),(*DstAllocSize)-(*DstPos), ReplaceString, ReplaceLength); + *DstPos += ReplaceLength; + + return TRUE; +} + +// replaces tokens in text. +// Returns: less than 0 on error, 0 if src is empty, +// number of chars written to dst on success. +// NOTE: On success dst must be freed by the calling function. +long tokenize_string(const char* src, // text to bo tokenized + long src_count, // length of src + char** dst, // destination buffer (must be freed) + const token_entity_t* token_entities, // match/replace token list + const char* tok_prefix, // the token prefix exmpl:"$(" + const char* tok_suffix, // the token suffix exmpl:")" + int recursive) // allows tokenzing tokens in tokens +{ + const token_entity_t* next_match; + long match_replace_pos; + const char* match_start; + long tok_prefix_size; + long tok_suffix_size; + int match_found; + long match_length; + long replace_length; + long dst_pos; + long dst_alloc_size; + char* pDst; + long match_count; + + if (!src || !dst || !token_entities || !src_count || !tok_prefix || !tok_suffix) + return -ERROR_BAD_ARGUMENTS; + + tok_prefix_size = (long)strlen(tok_prefix); + tok_suffix_size = (long)strlen(tok_suffix); + + // token prefix and suffix markers is required + if (!tok_prefix_size || !tok_suffix_size) + return -ERROR_BAD_ARGUMENTS; + + // if the src buffer count <= 0 assume it is null terminated + if (src_count < 0) src_count = (long)strlen(src); + + // nothing to do + if (src_count == 0) return 0; + + // Set the initial buffer size. + dst_alloc_size = GetDestSize(src_count); + *dst = pDst = malloc(dst_alloc_size); + if (!pDst) + return -ERROR_NOT_ENOUGH_MEMORY; + dst_pos=0; + + match_count=0; + + // search for a token prefix + while((match_start=strstr(src,tok_prefix))) + { + // found a token prefix + match_replace_pos=0; + match_found=0; + match_length = (long)(match_start-src); + + // copy all the text up to the tok_prefix start from src to dst. + if (!grow_strcpy(&pDst, dst, &dst_pos, &dst_alloc_size, src, match_length)) + { + return -ERROR_NOT_ENOUGH_MEMORY; + } + + src+=match_length+tok_prefix_size; + src_count-=(match_length+tok_prefix_size); + //ASSERT(src_count >=0); + + // If src_count equals 0 this is a token prefix and the end of src. + if (src_count > 0) + { + // iterate through the match/replace tokens + while ((next_match=&token_entities[match_replace_pos++])) + { + // the match and replace fields must both be set + if (!next_match->match || !next_match->replace) + { + break; + } + match_length=(long)strlen(next_match->match); + + // if this token will be longer than what's left in src buffer, skip it. + if (src_count < (match_length+tok_suffix_size)) + continue; // not found + + // check for a match suffix + if (strncmp(src+match_length,tok_suffix,tok_suffix_size)!=0) + continue; // not found + + if (strncmp(src,next_match->match,match_length)==0) + { + // found a valid token match + replace_length=(long)strlen(next_match->replace); + + if (!grow_strcpy(&pDst, dst, &dst_pos, &dst_alloc_size, + next_match->replace, replace_length)) + { + return -ERROR_NOT_ENOUGH_MEMORY; + } + + src+=match_length+tok_suffix_size; + src_count-=(match_length+tok_suffix_size); + match_found=1; + match_count++; + break; + } + } + } + if (!match_found) + { + // No matches were found; leave it as-is. + if (!grow_strcpy(&pDst, dst, &dst_pos, &dst_alloc_size, + tok_prefix, tok_prefix_size)) + { + return -ERROR_NOT_ENOUGH_MEMORY; + } + } + } + + match_length=src_count; + if (match_length > 0) + { + if (!grow_strcpy(&pDst, dst, &dst_pos, &dst_alloc_size, src, match_length)) + { + return -ERROR_NOT_ENOUGH_MEMORY; + } + } + // grow_strcpy is aware an extra char is always needed for null. + pDst[dst_pos]='\0'; + + if (recursive && match_count) + { + // if recursive mode is true, keep re-tokenizing until no matches are found + *dst = NULL; + dst_pos = tokenize_string(pDst,dst_pos,dst, + token_entities,tok_prefix,tok_suffix,recursive); + + // free the old dst buffer + free(pDst); + } + // return the new size (excluding null) + return dst_pos; +} + +// tokenizes a resource stored in the current module. +long tokenize_resource(LPCSTR resource_name, + LPCSTR resource_type, + char** dst, + const token_entity_t* token_entities, + const char* tok_prefix, + const char* tok_suffix, + int recursive) +{ + const char* src; + long src_count; + HGLOBAL res_data; + + HRSRC hSrc = FindResourceA(NULL, resource_name, resource_type); + + if (!hSrc) + return -ERROR_RESOURCE_DATA_NOT_FOUND; + + src_count = SizeofResource(NULL, hSrc); + + res_data = LoadResource(NULL,hSrc); + + if (!res_data) + return -ERROR_RESOURCE_DATA_NOT_FOUND; + + src = (char*) LockResource(res_data); + + if (!src) + return -ERROR_RESOURCE_DATA_NOT_FOUND; + + return tokenize_string(src, src_count, dst, + token_entities, tok_prefix, tok_suffix, recursive); + +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.h new file mode 100644 index 0000000..0f83fe2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/tokenizer.h @@ -0,0 +1,46 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2010 Travis Robinson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef _TOKENIZER_H +#define _TOKENIZER_H + +#include + +typedef struct _token_entity_t +{ + const char* match; + char replace[1024]; +}token_entity_t; + +long tokenize_string(const char* src, + long src_count, + char** dst, + const token_entity_t* token_entities, + const char* tok_prefix, + const char* tok_suffix, + int recursive); + +long tokenize_resource(LPCSTR resource_name, + LPCSTR resource_type, + char** dst, + const token_entity_t* token_entities, + const char* tok_prefix, + const char* tok_suffix, + int recursive); +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/vid_data.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/vid_data.c new file mode 100644 index 0000000..6cfa074 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/vid_data.c @@ -0,0 +1,2722 @@ +/* + * USB vendors, by VID + * based on http://www.linux-usb.org/usb.ids by Stephen J. Gowdy + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "libwdi.h" + +struct vendor_name { + unsigned short vid; + const char* name; +}; + +/* + * http://www.linux-usb.org/usb.ids + * Version: 2010.08.24 + */ +struct vendor_name usb_vendor[] = { + { 0x0001, "Fry's Electronics" }, + { 0x0002, "Ingram" }, + { 0x0003, "Club Mac" }, + { 0x0004, "Nebraska Furniture Mart" }, + { 0x0053, "Planex" }, + { 0x0079, "DragonRise Inc." }, + { 0x0105, "Trust International B.V." }, + { 0x0145, "Unknown" }, + { 0x0154, "LW154 Wireless 150N Adapter" }, + { 0x0204, "Chipsbank Microelectronics Co., Ltd" }, + { 0x0218, "Hangzhou Worlde" }, + { 0x02ad, "HUMAX Co., Ltd." }, + { 0x0324, "OCZ Technology Inc" }, + { 0x0325, "OCZ Technology Inc" }, + { 0x0386, "LTS" }, + { 0x03da, "Bernd Walter Computer Technology" }, + { 0x03e8, "EndPoints, Inc." }, + { 0x03e9, "Thesys Microelectronics" }, + { 0x03ea, "Data Broadcasting Corp." }, + { 0x03eb, "Atmel Corp." }, + { 0x03ec, "Iwatsu America, Inc." }, + { 0x03ed, "Mitel Corp." }, + { 0x03ee, "Mitsumi" }, + { 0x03f0, "Hewlett-Packard" }, + { 0x03f1, "Genoa Technology" }, + { 0x03f2, "Oak Technology, Inc." }, + { 0x03f3, "Adaptec, Inc." }, + { 0x03f4, "Diebold, Inc." }, + { 0x03f5, "Siemens Electromechanical" }, + { 0x03f8, "Epson Imaging Technology Center" }, + { 0x03f9, "KeyTronic Corp." }, + { 0x03fb, "OPTi, Inc." }, + { 0x03fc, "Elitegroup Computer Systems" }, + { 0x03fd, "Xilinx, Inc." }, + { 0x03fe, "Farallon Comunications" }, + { 0x0400, "National Semiconductor Corp." }, + { 0x0401, "National Registry, Inc." }, + { 0x0402, "ALi Corp." }, + { 0x0403, "Future Technology Devices International, Ltd" }, + { 0x0404, "NCR Corp." }, + { 0x0405, "Synopsys, Inc." }, + { 0x0406, "Fujitsu-ICL Computers" }, + { 0x0407, "Fujitsu Personal Systems, Inc." }, + { 0x0408, "Quanta Computer, Inc." }, + { 0x0409, "NEC Corp." }, + { 0x040a, "Kodak Co." }, + { 0x040b, "Weltrend Semiconductor" }, + { 0x040c, "VTech Computers, Ltd" }, + { 0x040d, "VIA Technologies, Inc." }, + { 0x040e, "MCCI" }, + { 0x040f, "Echo Speech Corp." }, + { 0x0411, "MelCo., Inc." }, + { 0x0412, "Award Software International" }, + { 0x0413, "Leadtek Research, Inc." }, + { 0x0414, "Giga-Byte Technology Co., Ltd" }, + { 0x0416, "Winbond Electronics Corp." }, + { 0x0417, "Symbios Logic" }, + { 0x0418, "AST Research" }, + { 0x0419, "Samsung Info. Systems America, Inc." }, + { 0x041a, "Phoenix Technologies, Ltd" }, + { 0x041b, "d'TV" }, + { 0x041d, "S3, Inc." }, + { 0x041e, "Creative Technology, Ltd" }, + { 0x041f, "LCS Telegraphics" }, + { 0x0420, "Chips and Technologies" }, + { 0x0421, "Nokia Mobile Phones" }, + { 0x0422, "ADI Systems, Inc." }, + { 0x0423, "Computer Access Technology Corp." }, + { 0x0424, "Standard Microsystems Corp." }, + { 0x0425, "Motorola Semiconductors HK, Ltd" }, + { 0x0426, "Integrated Device Technology, Inc." }, + { 0x0427, "Motorola Electronics Taiwan, Ltd" }, + { 0x0428, "Advanced Gravis Computer Tech, Ltd" }, + { 0x0429, "Cirrus Logic" }, + { 0x042a, "Ericsson Austrian, AG" }, + { 0x042b, "Intel Corp." }, + { 0x042c, "Innovative Semiconductors, Inc." }, + { 0x042d, "Micronics" }, + { 0x042e, "Acer, Inc." }, + { 0x042f, "Molex, Inc." }, + { 0x0430, "Sun Microsystems, Inc." }, + { 0x0431, "Itac Systems, Inc." }, + { 0x0432, "Unisys Corp." }, + { 0x0433, "Alps Electric, Inc." }, + { 0x0434, "Samsung Info. Systems America, Inc." }, + { 0x0435, "Hyundai Electronics America" }, + { 0x0436, "Taugagreining HF" }, + { 0x0437, "Framatome Connectors USA" }, + { 0x0438, "Advanced Micro Devices, Inc." }, + { 0x0439, "Voice Technologies Group" }, + { 0x043d, "Lexmark International, Inc." }, + { 0x043e, "LG Electronics USA, Inc." }, + { 0x043f, "RadiSys Corp." }, + { 0x0440, "Eizo Nanao Corp." }, + { 0x0441, "Winbond Systems Lab." }, + { 0x0442, "Ericsson, Inc." }, + { 0x0443, "Gateway, Inc." }, + { 0x0445, "Lucent Technologies, Inc." }, + { 0x0446, "NMB Technologies Corp." }, + { 0x0447, "Momentum Microsystems" }, + { 0x044a, "Shamrock Tech. Co., Ltd" }, + { 0x044b, "WSI" }, + { 0x044c, "CCL/ITRI" }, + { 0x044d, "Siemens Nixdorf AG" }, + { 0x044e, "Alps Electric Co., Ltd" }, + { 0x044f, "ThrustMaster, Inc." }, + { 0x0450, "DFI, Inc." }, + { 0x0451, "Texas Instruments, Inc." }, + { 0x0452, "Mitsubishi Electronics America, Inc." }, + { 0x0453, "CMD Technology" }, + { 0x0454, "Vobis Microcomputer AG" }, + { 0x0455, "Telematics International, Inc." }, + { 0x0456, "Analog Devices, Inc." }, + { 0x0457, "Silicon Integrated Systems Corp." }, + { 0x0458, "KYE Systems Corp. (Mouse Systems)" }, + { 0x0459, "Adobe Systems, Inc." }, + { 0x045a, "SONICblue, Inc." }, + { 0x045b, "Hitachi, Ltd" }, + { 0x045d, "Nortel Networks, Ltd" }, + { 0x045e, "Microsoft Corp." }, + { 0x0460, "Ace Cad Enterprise Co., Ltd" }, + { 0x0461, "Primax Electronics, Ltd" }, + { 0x0463, "MGE UPS Systems" }, + { 0x0464, "AMP/Tycoelectronics Corp." }, + { 0x0467, "AT&T Paradyne" }, + { 0x0468, "Wieson Technologies Co., Ltd" }, + { 0x046a, "Cherry GmbH" }, + { 0x046b, "American Megatrends, Inc." }, + { 0x046c, "Toshiba Corp., Digital Media Equipment" }, + { 0x046d, "Logitech, Inc." }, + { 0x046e, "Behavior Tech. Computer Corp." }, + { 0x046f, "Crystal Semiconductor" }, + { 0x0471, "Philips (or NXP)" }, + { 0x0472, "Chicony Electronics Co., Ltd" }, + { 0x0473, "Sanyo Information Business Co., Ltd" }, + { 0x0474, "Sanyo Electric Co., Ltd" }, + { 0x0475, "Relisys/Teco Information System" }, + { 0x0476, "AESP" }, + { 0x0477, "Seagate Technology, Inc." }, + { 0x0478, "Connectix Corp." }, + { 0x0479, "Advanced Peripheral Laboratories" }, + { 0x047a, "Semtech Corp." }, + { 0x047b, "Silitek Corp." }, + { 0x047c, "Dell Computer Corp." }, + { 0x047d, "Kensington" }, + { 0x047e, "Agere Systems, Inc. (Lucent)" }, + { 0x047f, "Plantronics, Inc." }, + { 0x0480, "Toshiba America Info. Systems, Inc." }, + { 0x0481, "Zenith Data Systems" }, + { 0x0482, "Kyocera Corp." }, + { 0x0483, "SGS Thomson Microelectronics" }, + { 0x0484, "Specialix" }, + { 0x0485, "Nokia Monitors" }, + { 0x0486, "ASUS Computers, Inc." }, + { 0x0487, "Stewart Connector" }, + { 0x0488, "Cirque Corp." }, + { 0x0489, "Foxconn / Hon Hai" }, + { 0x048a, "S-MOS Systems, Inc." }, + { 0x048c, "Alps Electric Ireland, Ltd" }, + { 0x048d, "Integrated Technology Express, Inc." }, + { 0x048f, "Eicon Tech." }, + { 0x0490, "United Microelectronics Corp." }, + { 0x0491, "Capetronic" }, + { 0x0492, "Samsung SemiConductor, Inc." }, + { 0x0493, "MAG Technology Co., Ltd" }, + { 0x0495, "ESS Technology, Inc." }, + { 0x0496, "Micron Electronics" }, + { 0x0497, "Smile International" }, + { 0x0498, "Capetronic (Kaohsiung) Corp." }, + { 0x0499, "Yamaha Corp." }, + { 0x049a, "Gandalf Technologies, Ltd" }, + { 0x049b, "Curtis Computer Products" }, + { 0x049c, "Acer Advanced Labs, Inc." }, + { 0x049d, "VLSI Technology" }, + { 0x049f, "Compaq Computer Corp." }, + { 0x04a0, "Digital Equipment Corp." }, + { 0x04a1, "SystemSoft Corp." }, + { 0x04a2, "FirePower Systems" }, + { 0x04a3, "Trident Microsystems, Inc." }, + { 0x04a4, "Hitachi, Ltd" }, + { 0x04a5, "Acer Peripherals Inc. (now BenQ Corp.)" }, + { 0x04a6, "Nokia Display Products" }, + { 0x04a7, "Visioneer" }, + { 0x04a8, "Multivideo Labs, Inc." }, + { 0x04a9, "Canon, Inc." }, + { 0x04aa, "DaeWoo Telecom, Ltd" }, + { 0x04ab, "Chromatic Research" }, + { 0x04ac, "Micro Audiometrics Corp." }, + { 0x04ad, "Dooin Electronics" }, + { 0x04af, "Winnov L.P." }, + { 0x04b0, "Nikon Corp." }, + { 0x04b1, "Pan International" }, + { 0x04b3, "IBM Corp." }, + { 0x04b4, "Cypress Semiconductor Corp." }, + { 0x04b5, "ROHM LSI Systems USA, LLC" }, + { 0x04b6, "Hint Corp." }, + { 0x04b7, "Compal Electronics, Inc." }, + { 0x04b8, "Seiko Epson Corp." }, + { 0x04b9, "Rainbow Technologies, Inc." }, + { 0x04ba, "Toucan Systems, Ltd" }, + { 0x04bb, "I-O Data Device, Inc." }, + { 0x04bd, "Toshiba Electronics Taiwan Corp." }, + { 0x04be, "Telia Research AB" }, + { 0x04bf, "TDK Corp." }, + { 0x04c1, "U.S. Robotics (3Com)" }, + { 0x04c2, "Methode Electronics Far East PTE, Ltd" }, + { 0x04c3, "Maxi Switch, Inc." }, + { 0x04c4, "Lockheed Martin Energy Research" }, + { 0x04c5, "Fujitsu, Ltd" }, + { 0x04c6, "Toshiba America Electronic Components" }, + { 0x04c7, "Micro Macro Technologies" }, + { 0x04c8, "Konica Corp." }, + { 0x04ca, "Lite-On Technology Corp." }, + { 0x04cb, "Fuji Photo Film Co., Ltd" }, + { 0x04cc, "ST-Ericsson" }, + { 0x04cd, "Tatung Co. Of America" }, + { 0x04ce, "ScanLogic Corp." }, + { 0x04cf, "Myson Century, Inc." }, + { 0x04d0, "Digi International" }, + { 0x04d1, "ITT Canon" }, + { 0x04d2, "Altec Lansing Technologies" }, + { 0x04d3, "VidUS, Inc." }, + { 0x04d4, "LSI Logic, Inc." }, + { 0x04d5, "Forte Technologies, Inc." }, + { 0x04d6, "Mentor Graphics" }, + { 0x04d7, "Oki Semiconductor" }, + { 0x04d8, "Microchip Technology, Inc." }, + { 0x04d9, "Holtek Semiconductor, Inc." }, + { 0x04da, "Panasonic (Matsushita)" }, + { 0x04db, "Hypertec Pty, Ltd" }, + { 0x04dc, "Huan Hsin Holdings, Ltd" }, + { 0x04dd, "Sharp Corp." }, + { 0x04de, "MindShare, Inc." }, + { 0x04df, "Interlink Electronics" }, + { 0x04e1, "Iiyama North America, Inc." }, + { 0x04e2, "Exar Corp." }, + { 0x04e3, "Zilog, Inc." }, + { 0x04e4, "ACC Microelectronics" }, + { 0x04e5, "Promise Technology" }, + { 0x04e6, "SCM Microsystems, Inc." }, + { 0x04e7, "Elo TouchSystems" }, + { 0x04e8, "Samsung Electronics Co., Ltd" }, + { 0x04e9, "PC-Tel, Inc." }, + { 0x04ea, "Brooktree Corp." }, + { 0x04eb, "Northstar Systems, Inc." }, + { 0x04ec, "Tokyo Electron Device, Ltd" }, + { 0x04ed, "Annabooks" }, + { 0x04ef, "Pacific Electronic International, Inc." }, + { 0x04f0, "Daewoo Electronics Co., Ltd" }, + { 0x04f1, "Victor Company of Japan, Ltd" }, + { 0x04f2, "Chicony Electronics Co., Ltd" }, + { 0x04f3, "Elan Microelectronics Corp." }, + { 0x04f4, "Harting Elektronik, Inc." }, + { 0x04f5, "Fujitsu-ICL Systems, Inc." }, + { 0x04f6, "Norand Corp." }, + { 0x04f7, "Newnex Technology Corp." }, + { 0x04f8, "FuturePlus Systems" }, + { 0x04f9, "Brother Industries, Ltd" }, + { 0x04fa, "Dallas Semiconductor" }, + { 0x04fb, "Biostar Microtech International Corp." }, + { 0x04fc, "Sunplus Technology Co., Ltd" }, + { 0x04fd, "Soliton Systems, K.K." }, + { 0x04fe, "PFU, Ltd" }, + { 0x04ff, "E-CMOS Corp." }, + { 0x0500, "Siam United Hi-Tech" }, + { 0x0501, "Fujikura DDK, Ltd" }, + { 0x0502, "Acer, Inc." }, + { 0x0503, "Hitachi America, Ltd" }, + { 0x0504, "Hayes Microcomputer Products" }, + { 0x0506, "3Com Corp." }, + { 0x0507, "Hosiden Corp." }, + { 0x0508, "Clarion Co., Ltd" }, + { 0x0509, "Aztech Systems, Ltd" }, + { 0x050a, "Cinch Connectors" }, + { 0x050b, "Cable System International" }, + { 0x050c, "InnoMedia, Inc." }, + { 0x050d, "Belkin Components" }, + { 0x050e, "Neon Technology, Inc." }, + { 0x050f, "KC Technology, Inc." }, + { 0x0510, "Sejin Electron, Inc." }, + { 0x0511, "N'Able (DataBook) Technologies, Inc." }, + { 0x0512, "Hualon Microelectronics Corp." }, + { 0x0513, "digital-X, Inc." }, + { 0x0514, "FCI Electronics" }, + { 0x0515, "ACTC" }, + { 0x0516, "Longwell Electronics" }, + { 0x0517, "Butterfly Communications" }, + { 0x0518, "EzKEY Corp." }, + { 0x0519, "Star Micronics Co., Ltd" }, + { 0x051a, "WYSE Technology" }, + { 0x051b, "Silicon Graphics" }, + { 0x051c, "Shuttle, Inc." }, + { 0x051d, "American Power Conversion" }, + { 0x051e, "Scientific Atlanta, Inc." }, + { 0x051f, "IO Systems (Elite Electronics), Inc." }, + { 0x0520, "Taiwan Semiconductor Manufacturing Co." }, + { 0x0521, "Airborn Connectors" }, + { 0x0522, "Advanced Connectek, Inc." }, + { 0x0523, "ATEN GmbH" }, + { 0x0524, "Sola Electronics" }, + { 0x0525, "Netchip Technology, Inc." }, + { 0x0526, "Temic MHS S.A." }, + { 0x0527, "ALTRA" }, + { 0x0528, "ATI Technologies, Inc." }, + { 0x0529, "Aladdin Knowledge Systems" }, + { 0x052a, "Crescent Heart Software" }, + { 0x052b, "Tekom Technologies, Inc." }, + { 0x052c, "Canon Information Systems, Inc." }, + { 0x052d, "Avid Electronics Corp." }, + { 0x052e, "Standard Microsystems Corp." }, + { 0x052f, "Unicore Software, Inc." }, + { 0x0530, "American Microsystems, Inc." }, + { 0x0531, "Wacom Technology Corp." }, + { 0x0532, "Systech Corp." }, + { 0x0533, "Alcatel Mobile Phones" }, + { 0x0534, "Motorola, Inc." }, + { 0x0535, "LIH TZU Electric Co., Ltd" }, + { 0x0536, "Hand Held Products (Welch Allyn, Inc.)" }, + { 0x0537, "Inventec Corp." }, + { 0x0538, "Caldera International, Inc. (SCO)" }, + { 0x0539, "Shyh Shiun Terminals Co., Ltd" }, + { 0x053a, "PrehKeyTec GmbH" }, + { 0x053b, "Global Village Communication" }, + { 0x053c, "Institut of Microelectronic & Mechatronic Systems" }, + { 0x053d, "Silicon Architect" }, + { 0x053e, "Mobility Electronics" }, + { 0x053f, "Synopsys, Inc." }, + { 0x0540, "UniAccess AB" }, + { 0x0541, "Sirf Technology, Inc." }, + { 0x0543, "ViewSonic Corp." }, + { 0x0544, "Cristie Electronics, Ltd" }, + { 0x0545, "Xirlink, Inc." }, + { 0x0546, "Polaroid Corp." }, + { 0x0547, "Anchor Chips, Inc." }, + { 0x0548, "Tyan Computer Corp." }, + { 0x0549, "Pixera Corp." }, + { 0x054a, "Fujitsu Microelectronics, Inc." }, + { 0x054b, "New Media Corp." }, + { 0x054c, "Sony Corp." }, + { 0x054d, "Try Corp." }, + { 0x054e, "Proside Corp." }, + { 0x054f, "WYSE Technology Taiwan" }, + { 0x0550, "Fuji Xerox Co., Ltd" }, + { 0x0551, "CompuTrend Systems, Inc." }, + { 0x0552, "Philips Monitors" }, + { 0x0553, "STMicroelectronics Imaging Division (VLSI Vision)" }, + { 0x0554, "Dictaphone Corp." }, + { 0x0555, "ANAM S&T Co., Ltd" }, + { 0x0556, "Asahi Kasei Microsystems Co., Ltd" }, + { 0x0557, "ATEN International Co., Ltd" }, + { 0x0558, "Truevision, Inc." }, + { 0x0559, "Cadence Design Systems, Inc." }, + { 0x055a, "Kenwood USA" }, + { 0x055b, "KnowledgeTek, Inc." }, + { 0x055c, "Proton Electronic Ind." }, + { 0x055d, "Samsung Electro-Mechanics Co." }, + { 0x055e, "CTX Opto-Electronics Corp." }, + { 0x055f, "Mustek Systems, Inc." }, + { 0x0560, "Interface Corp." }, + { 0x0561, "Oasis Design, Inc." }, + { 0x0562, "Telex Communications, Inc." }, + { 0x0563, "Immersion Corp." }, + { 0x0564, "Chinon Industries, Inc." }, + { 0x0565, "Peracom Networks, Inc." }, + { 0x0566, "Monterey International Corp." }, + { 0x0567, "Xyratex International, Ltd" }, + { 0x0568, "Quartz Ingenierie" }, + { 0x0569, "SegaSoft" }, + { 0x056a, "Wacom Co., Ltd" }, + { 0x056b, "Decicon, Inc." }, + { 0x056c, "eTEK Labs" }, + { 0x056d, "EIZO Corp." }, + { 0x056e, "Elecom Co., Ltd" }, + { 0x056f, "Korea Data Systems Co., Ltd" }, + { 0x0570, "Epson America" }, + { 0x0571, "Interex, Inc." }, + { 0x0572, "Conexant Systems (Rockwell), Inc." }, + { 0x0573, "Zoran Co. Personal Media Division (Nogatech)" }, + { 0x0574, "City University of Hong Kong" }, + { 0x0575, "Philips Creative Display Solutions" }, + { 0x0576, "BAFO/Quality Computer Accessories" }, + { 0x0577, "ELSA" }, + { 0x0578, "Intrinsix Corp." }, + { 0x0579, "GVC Corp." }, + { 0x057a, "Samsung Electronics America" }, + { 0x057b, "Y-E Data, Inc." }, + { 0x057c, "AVM GmbH" }, + { 0x057d, "Shark Multimedia, Inc." }, + { 0x057e, "Nintendo Co., Ltd" }, + { 0x057f, "QuickShot, Ltd" }, + { 0x0580, "Denron, Inc." }, + { 0x0581, "Racal Data Group" }, + { 0x0582, "Roland Corp." }, + { 0x0583, "Padix Co., Ltd (Rockfire)" }, + { 0x0584, "RATOC System, Inc." }, + { 0x0585, "FlashPoint Technology, Inc." }, + { 0x0586, "ZyXEL Communications Corp." }, + { 0x0587, "America Kotobuki Electronics Industries, Inc." }, + { 0x0588, "Sapien Design" }, + { 0x0589, "Victron" }, + { 0x058a, "Nohau Corp." }, + { 0x058b, "Infineon Technologies" }, + { 0x058c, "In Focus Systems" }, + { 0x058d, "Micrel Semiconductor" }, + { 0x058e, "Tripath Technology, Inc." }, + { 0x058f, "Alcor Micro Corp." }, + { 0x0590, "Omron Corp." }, + { 0x0591, "Questra Consulting" }, + { 0x0592, "Powerware Corp." }, + { 0x0593, "Incite" }, + { 0x0594, "Princeton Graphic Systems" }, + { 0x0595, "Zoran Microelectronics, Ltd" }, + { 0x0596, "MicroTouch Systems, Inc." }, + { 0x0597, "Trisignal Communications" }, + { 0x0598, "Niigata Canotec Co., Inc." }, + { 0x0599, "Brilliance Semiconductor, Inc." }, + { 0x059a, "Spectrum Signal Processing, Inc." }, + { 0x059b, "Iomega Corp." }, + { 0x059c, "A-Trend Technology Co., Ltd" }, + { 0x059d, "Advanced Input Devices" }, + { 0x059e, "Intelligent Instrumentation" }, + { 0x059f, "LaCie, Ltd" }, + { 0x05a0, "Vetronix Corp." }, + { 0x05a1, "USC Corp." }, + { 0x05a2, "Fuji Film Microdevices Co., Ltd" }, + { 0x05a3, "ARC International" }, + { 0x05a4, "Ortek Technology, Inc." }, + { 0x05a5, "Sampo Technology Corp." }, + { 0x05a6, "Cisco Systems, Inc." }, + { 0x05a7, "Bose Corp." }, + { 0x05a8, "Spacetec IMC Corp." }, + { 0x05a9, "OmniVision Technologies, Inc." }, + { 0x05aa, "Utilux South China, Ltd" }, + { 0x05ab, "In-System Design" }, + { 0x05ac, "Apple, Inc." }, + { 0x05ad, "Y.C. Cable U.S.A., Inc." }, + { 0x05ae, "Synopsys, Inc." }, + { 0x05af, "Jing-Mold Enterprise Co., Ltd" }, + { 0x05b0, "Fountain Technologies, Inc." }, + { 0x05b1, "First International Computer, Inc." }, + { 0x05b4, "LG Semicon Co., Ltd" }, + { 0x05b5, "Dialogic Corp." }, + { 0x05b6, "Proxima Corp." }, + { 0x05b7, "Medianix Semiconductor, Inc." }, + { 0x05b8, "Agiler, Inc." }, + { 0x05b9, "Philips Research Laboratories" }, + { 0x05ba, "DigitalPersona, Inc." }, + { 0x05bb, "Grey Cell Systems" }, + { 0x05bc, "3G Green Green Globe Co., Ltd" }, + { 0x05bd, "RAFI GmbH & Co. KG" }, + { 0x05be, "Tyco Electronics (Raychem)" }, + { 0x05bf, "S & S Research" }, + { 0x05c0, "Keil Software" }, + { 0x05c1, "Kawasaki Microelectronics, Inc." }, + { 0x05c2, "Media Phonics (Suisse) S.A." }, + { 0x05c5, "Digi International, Inc." }, + { 0x05c6, "Qualcomm, Inc." }, + { 0x05c7, "Qtronix Corp." }, + { 0x05c8, "Cheng Uei Precision Industry Co., Ltd (Foxlink)" }, + { 0x05c9, "Semtech Corp." }, + { 0x05ca, "Ricoh Co., Ltd" }, + { 0x05cb, "PowerVision Technologies, Inc." }, + { 0x05cc, "ELSA AG" }, + { 0x05cd, "Silicom, Ltd" }, + { 0x05ce, "sci-worx GmbH" }, + { 0x05cf, "Sung Forn Co., Ltd" }, + { 0x05d0, "GE Medical Systems Lunar" }, + { 0x05d1, "Brainboxes, Ltd" }, + { 0x05d2, "Wave Systems Corp." }, + { 0x05d3, "Tohoku Ricoh Co., Ltd" }, + { 0x05d5, "Super Gate Technology Co., Ltd" }, + { 0x05d6, "Philips Semiconductors, CICT" }, + { 0x05d7, "Thomas & Betts Corp." }, + { 0x05d8, "Ultima Electronics Corp." }, + { 0x05d9, "Axiohm Transaction Solutions" }, + { 0x05da, "Microtek International, Inc." }, + { 0x05db, "Sun Corp. (Suntac?)" }, + { 0x05dc, "Lexar Media, Inc." }, + { 0x05dd, "Delta Electronics, Inc." }, + { 0x05df, "Silicon Vision, Inc." }, + { 0x05e0, "Symbol Technologies" }, + { 0x05e1, "Syntek Semiconductor Co., Ltd" }, + { 0x05e2, "ElecVision, Inc." }, + { 0x05e3, "Genesys Logic, Inc." }, + { 0x05e4, "Red Wing Corp." }, + { 0x05e5, "Fuji Electric Co., Ltd" }, + { 0x05e6, "Keithley Instruments" }, + { 0x05e8, "ICC, Inc." }, + { 0x05e9, "Kawasaki LSI" }, + { 0x05eb, "FFC, Ltd" }, + { 0x05ec, "COM21, Inc." }, + { 0x05ee, "Cytechinfo Inc." }, + { 0x05ef, "AVB, Inc. [anko?]" }, + { 0x05f0, "Canopus Co., Ltd" }, + { 0x05f1, "Compass Communications" }, + { 0x05f2, "Dexin Corp., Ltd" }, + { 0x05f3, "PI Engineering, Inc." }, + { 0x05f5, "Unixtar Technology, Inc." }, + { 0x05f6, "AOC International" }, + { 0x05f7, "RFC Distribution(s) PTE, Ltd" }, + { 0x05f9, "PSC Scanning, Inc." }, + { 0x05fa, "Siemens Telecommunications Systems, Ltd" }, + { 0x05fc, "Harman Multimedia" }, + { 0x05fd, "InterAct, Inc." }, + { 0x05fe, "Chic Technology Corp." }, + { 0x05ff, "LeCroy Corp." }, + { 0x0600, "Barco Display Systems" }, + { 0x0601, "Jazz Hipster Corp." }, + { 0x0602, "Vista Imaging, Inc." }, + { 0x0603, "Novatek Microelectronics Corp." }, + { 0x0604, "Jean Co., Ltd" }, + { 0x0605, "Anchor C&C Co., Ltd" }, + { 0x0606, "Royal Information Electronics Co., Ltd" }, + { 0x0607, "Bridge Information Co., Ltd" }, + { 0x0608, "Genrad Ads" }, + { 0x0609, "SMK Manufacturing, Inc." }, + { 0x060a, "Worthington Data Solutions, Inc." }, + { 0x060b, "Solid Year" }, + { 0x060c, "EEH Datalink GmbH" }, + { 0x060d, "Auctor Corp." }, + { 0x060e, "Transmonde Technologies, Inc." }, + { 0x060f, "Joinsoon Electronics Mfg. Co., Ltd" }, + { 0x0610, "Costar Electronics, Inc." }, + { 0x0611, "Totoku Electric Co., Ltd" }, + { 0x0613, "TransAct Technologies, Inc." }, + { 0x0614, "Bio-Rad Laboratories" }, + { 0x0615, "Quabbin Wire & Cable Co., Inc." }, + { 0x0616, "Future Techno Designs PVT, Ltd" }, + { 0x0617, "Swiss Federal Insitute of Technology" }, + { 0x0618, "MacAlly" }, + { 0x0619, "Seiko Instruments, Inc." }, + { 0x061a, "Veridicom International, Inc." }, + { 0x061b, "Promptus Communications, Inc." }, + { 0x061c, "Act Labs, Ltd" }, + { 0x061d, "Quatech, Inc." }, + { 0x061e, "Nissei Electric Co." }, + { 0x0620, "Alaris, Inc." }, + { 0x0621, "ODU-Steckverbindungssysteme GmbH & Co. KG" }, + { 0x0622, "Iotech, Inc." }, + { 0x0623, "Littelfuse, Inc." }, + { 0x0624, "Avocent Corp." }, + { 0x0625, "TiMedia Technology Co., Ltd" }, + { 0x0626, "Nippon Systems Development Co., Ltd" }, + { 0x0627, "Adomax Technology Co., Ltd" }, + { 0x0628, "Tasking Software, Inc." }, + { 0x0629, "Zida Technologies, Ltd" }, + { 0x062a, "Creative Labs" }, + { 0x062b, "Greatlink Electronics Taiwan, Ltd" }, + { 0x062c, "Institute for Information Industry" }, + { 0x062d, "Taiwan Tai-Hao Enterprises Co., Ltd" }, + { 0x062e, "Mainsuper Enterprises Co., Ltd" }, + { 0x062f, "Sin Sheng Terminal & Machine, Inc." }, + { 0x0631, "JUJO Electronics Corp." }, + { 0x0633, "Cyrix Corp." }, + { 0x0634, "Micron Technology, Inc." }, + { 0x0635, "Methode Electronics, Inc." }, + { 0x0636, "Sierra Imaging, Inc." }, + { 0x0638, "Avision, Inc." }, + { 0x0639, "Chrontel, Inc." }, + { 0x063a, "Techwin Corp." }, + { 0x063b, "Taugagreining HF" }, + { 0x063c, "Yamaichi Electronics Co., Ltd (Sakura)" }, + { 0x063d, "Fong Kai Industrial Co., Ltd" }, + { 0x063e, "RealMedia Technology, Inc." }, + { 0x063f, "New Technology Cable, Ltd" }, + { 0x0640, "Hitex Development Tools" }, + { 0x0641, "Woods Industries, Inc." }, + { 0x0642, "VIA Medical Corp." }, + { 0x0644, "TEAC Corp." }, + { 0x0645, "Who? Vision Systems, Inc." }, + { 0x0646, "UMAX" }, + { 0x0647, "Acton Research Corp." }, + { 0x0648, "Inside Out Networks" }, + { 0x0649, "Weli Science Co., Ltd" }, + { 0x064b, "Analog Devices, Inc. (White Mountain DSP)" }, + { 0x064c, "Ji-Haw Industrial Co., Ltd" }, + { 0x064d, "TriTech Microelectronics, Ltd" }, + { 0x064e, "Suyin Corp." }, + { 0x064f, "WIBU-Systems AG" }, + { 0x0650, "Dynapro Systems" }, + { 0x0651, "Likom Technology Sdn. Bhd." }, + { 0x0652, "Stargate Solutions, Inc." }, + { 0x0653, "CNF, Inc." }, + { 0x0654, "Granite Microsystems, Inc." }, + { 0x0655, "Space Shuttle Hi-Tech Co., Ltd" }, + { 0x0656, "Glory Mark Electronic, Ltd" }, + { 0x0657, "Tekcon Electronics Corp." }, + { 0x0658, "Sigma Designs, Inc." }, + { 0x0659, "Aethra" }, + { 0x065a, "Optoelectronics Co., Ltd" }, + { 0x065b, "Tracewell Systems" }, + { 0x065e, "Silicon Graphics" }, + { 0x065f, "Good Way Technology Co., Ltd & GWC technology Inc." }, + { 0x0660, "TSAY-E (BVI) International, Inc." }, + { 0x0661, "Hamamatsu Photonics K.K." }, + { 0x0662, "Kansai Electric Co., Ltd" }, + { 0x0663, "Topmax Electronic Co., Ltd" }, + { 0x0664, "Groovy Technology Corp." }, + { 0x0665, "Cypress Semiconductor" }, + { 0x0667, "Aiwa Co., Ltd" }, + { 0x0668, "WordWand" }, + { 0x0669, "Oce' Printing Systems GmbH" }, + { 0x066a, "Total Technologies, Ltd" }, + { 0x066b, "Linksys, Inc." }, + { 0x066d, "Entrega, Inc." }, + { 0x066e, "Acer Semiconductor America, Inc." }, + { 0x066f, "SigmaTel, Inc." }, + { 0x0670, "Sequel Imaging" }, + { 0x0672, "Labtec, Inc." }, + { 0x0673, "HCL" }, + { 0x0674, "Key Mouse Electronic Enterprise Co., Ltd" }, + { 0x0675, "Draytech" }, + { 0x0676, "Teles AG" }, + { 0x0677, "Aiwa Co., Ltd" }, + { 0x0678, "ACard Technology Corp." }, + { 0x067b, "Prolific Technology, Inc." }, + { 0x067c, "Efficient Networks, Inc." }, + { 0x067d, "Hohner Corp." }, + { 0x067e, "Intermec Technologies Corp." }, + { 0x067f, "Virata, Ltd" }, + { 0x0680, "Realtek Semiconductor Corp., CPP Div. (Avance Logic)" }, + { 0x0681, "Siemens Information and Communication Products" }, + { 0x0682, "Victor Company of Japan, Ltd" }, + { 0x0684, "Actiontec Electronics, Inc." }, + { 0x0686, "Minolta Co., Ltd" }, + { 0x068a, "Pertech, Inc." }, + { 0x068b, "Potrans International, Inc." }, + { 0x068e, "CH Products, Inc." }, + { 0x0690, "Golden Bridge Electech, Inc." }, + { 0x0693, "Hagiwara Sys-Com Co., Ltd" }, + { 0x0694, "Lego Group" }, + { 0x0698, "Chuntex (CTX)" }, + { 0x0699, "Tektronix, Inc." }, + { 0x069a, "Askey Computer Corp." }, + { 0x069b, "Thomson, Inc." }, + { 0x069d, "Hughes Network Systems (HNS)" }, + { 0x069e, "Marx" }, + { 0x069f, "Allied Data Technologies BV" }, + { 0x06a2, "Topro Technology, Inc." }, + { 0x06a3, "Saitek PLC" }, + { 0x06a4, "Xiamen Doowell Electron Co., Ltd" }, + { 0x06a5, "Divio" }, + { 0x06a7, "MicroStore, Inc." }, + { 0x06a8, "Topaz Systems, Inc." }, + { 0x06a9, "Westell" }, + { 0x06aa, "Sysgration, Ltd" }, + { 0x06ac, "Fujitsu Laboratories of America, Inc." }, + { 0x06ad, "Greatland Electronics Taiwan, Ltd" }, + { 0x06ae, "Professional Multimedia Testing Centre" }, + { 0x06af, "Harting, Inc. of North America" }, + { 0x06b8, "Pixela Corp." }, + { 0x06b9, "Alcatel Telecom" }, + { 0x06ba, "Smooth Cord & Connector Co., Ltd" }, + { 0x06bb, "EDA, Inc." }, + { 0x06bc, "Oki Data Corp." }, + { 0x06bd, "AGFA-Gevaert NV" }, + { 0x06be, "AME Optimedia Technology Co., Ltd" }, + { 0x06bf, "Leoco Corp." }, + { 0x06c2, "Phidgets Inc. (formerly GLAB)" }, + { 0x06c4, "Bizlink International Corp." }, + { 0x06c5, "Hagenuk, GmbH" }, + { 0x06c6, "Infowave Software, Inc." }, + { 0x06c8, "SIIG, Inc." }, + { 0x06c9, "Taxan (Europe), Ltd" }, + { 0x06ca, "Newer Technology, Inc." }, + { 0x06cb, "Synaptics, Inc." }, + { 0x06cc, "Terayon Communication Systems" }, + { 0x06cd, "Keyspan" }, + { 0x06cf, "SpheronVR AG" }, + { 0x06d0, "LapLink, Inc." }, + { 0x06d1, "Daewoo Electronics Co., Ltd" }, + { 0x06d3, "Mitsubishi Electric Corp." }, + { 0x06d4, "Cisco Systems" }, + { 0x06d5, "Toshiba" }, + { 0x06d6, "Aashima Technology B.V." }, + { 0x06d7, "Network Computing Devices (NCD)" }, + { 0x06d8, "Technical Marketing Research, Inc." }, + { 0x06da, "Phoenixtec Power Co., Ltd" }, + { 0x06db, "Paradyne" }, + { 0x06dc, "Foxlink Image Technology Co., Ltd" }, + { 0x06de, "Heisei Electronics Co., Ltd" }, + { 0x06e0, "Multi-Tech Systems, Inc." }, + { 0x06e1, "ADS Technologies, Inc." }, + { 0x06e4, "Alcatel Microelectronics" }, + { 0x06e6, "Tiger Jet Network, Inc." }, + { 0x06ea, "Sirius Technologies" }, + { 0x06eb, "PC Expert Tech. Co., Ltd" }, + { 0x06ef, "I.A.C. Geometrische Ingenieurs B.V." }, + { 0x06f0, "T.N.C Industrial Co., Ltd" }, + { 0x06f1, "Opcode Systems, Inc." }, + { 0x06f2, "Emine Technology Co." }, + { 0x06f6, "Wintrend Technology Co., Ltd" }, + { 0x06f7, "Wailly Technology Ltd" }, + { 0x06f8, "Guillemot Corp." }, + { 0x06fa, "HSD S.r.L" }, + { 0x06fc, "Motorola Semiconductor Products Sector" }, + { 0x06fd, "Boston Acoustics" }, + { 0x06fe, "Gallant Computer, Inc." }, + { 0x0701, "Supercomal Wire & Cable SDN. BHD." }, + { 0x0703, "Bvtech Industry, Inc." }, + { 0x0705, "NKK Corp." }, + { 0x0706, "Ariel Corp." }, + { 0x0707, "Standard Microsystems Corp." }, + { 0x0708, "Putercom Co., Ltd" }, + { 0x0709, "Silicon Systems, Ltd (SSL)" }, + { 0x070a, "Oki Electric Industry Co., Ltd" }, + { 0x070d, "Comoss Electronic Co., Ltd" }, + { 0x070e, "Excel Cell Electronic Co., Ltd" }, + { 0x0710, "Connect Tech, Inc." }, + { 0x0711, "Magic Control Technology Corp." }, + { 0x0713, "Interval Research Corp." }, + { 0x0714, "NewMotion, Inc." }, + { 0x0717, "ZNK Corp." }, + { 0x0718, "Imation Corp." }, + { 0x0719, "Tremon Enterprises Co., Ltd" }, + { 0x071b, "Domain Technologies, Inc." }, + { 0x071c, "Xionics Document Technologies, Inc." }, + { 0x071d, "Eicon Networks Corp." }, + { 0x071e, "Ariston Technologies" }, + { 0x0723, "Centillium Communications Corp." }, + { 0x0726, "Vanguard International Semiconductor-America" }, + { 0x0729, "Amitm" }, + { 0x072e, "Sunix Co., Ltd" }, + { 0x072f, "Advanced Card Systems, Ltd" }, + { 0x0731, "Susteen, Inc." }, + { 0x0732, "Goldfull Electronics & Telecommunications Corp." }, + { 0x0733, "ViewQuest Technologies, Inc." }, + { 0x0734, "Lasat Communications A/S" }, + { 0x0735, "Asuscom Network" }, + { 0x0736, "Lorom Industrial Co., Ltd" }, + { 0x0738, "Mad Catz, Inc." }, + { 0x073a, "Chaplet Systems, Inc." }, + { 0x073b, "Suncom Technologies" }, + { 0x073c, "Industrial Electronic Engineers, Inc." }, + { 0x073d, "Eutron S.p.a." }, + { 0x073e, "NEC, Inc." }, + { 0x0745, "Syntech Information Co., Ltd" }, + { 0x0746, "Onkyo Corp." }, + { 0x0747, "Labway Corp." }, + { 0x0748, "Strong Man Enterprise Co., Ltd" }, + { 0x0749, "EVer Electronics Corp." }, + { 0x074a, "Ming Fortune Industry Co., Ltd" }, + { 0x074b, "Polestar Tech. Corp." }, + { 0x074c, "C-C-C Group PLC" }, + { 0x074d, "Micronas GmbH" }, + { 0x074e, "Digital Stream Corp." }, + { 0x0755, "Aureal Semiconductor" }, + { 0x0757, "Network Technologies, Inc." }, + { 0x075b, "Sophisticated Circuits, Inc." }, + { 0x0763, "Midiman" }, + { 0x0764, "Cyber Power System, Inc." }, + { 0x0765, "X-Rite, Inc." }, + { 0x0766, "Jess-Link Products Co., Ltd" }, + { 0x0767, "Tokheim Corp." }, + { 0x0768, "Camtel Technology Corp." }, + { 0x0769, "Surecom Technology Corp." }, + { 0x076a, "Smart Technology Enablers, Inc." }, + { 0x076b, "OmniKey AG" }, + { 0x076c, "Partner Tech" }, + { 0x076d, "Denso Corp." }, + { 0x076e, "Kuan Tech Enterprise Co., Ltd" }, + { 0x076f, "Jhen Vei Electronic Co., Ltd" }, + { 0x0770, "Welch Allyn, Inc - Medical Division" }, + { 0x0771, "Observator Instruments BV" }, + { 0x0774, "AmTRAN Technology Co., Ltd" }, + { 0x0775, "Longshine Electronics Corp." }, + { 0x0776, "Inalways Corp." }, + { 0x0777, "Comda Enterprise Corp." }, + { 0x0778, "Volex, Inc." }, + { 0x0779, "Fairchild Semiconductor" }, + { 0x077a, "Sankyo Seiki Mfg. Co., Ltd" }, + { 0x077b, "Linksys" }, + { 0x077c, "Forward Electronics Co., Ltd" }, + { 0x077d, "Griffin Technology" }, + { 0x077f, "Well Excellent & Most Corp." }, + { 0x0780, "Sagem Monetel GmbH" }, + { 0x0781, "SanDisk Corp." }, + { 0x0782, "Trackerball" }, + { 0x0783, "C3PO" }, + { 0x0784, "Vivitar, Inc." }, + { 0x0785, "NTT-ME" }, + { 0x0789, "Logitec Corp." }, + { 0x078b, "Happ Controls, Inc." }, + { 0x078c, "GTCO/CalComp" }, + { 0x078e, "Brincom, Inc." }, + { 0x0790, "Pro-Image Manufacturing Co., Ltd" }, + { 0x0791, "Copartner Wire and Cable Mfg. Corp." }, + { 0x0792, "Axis Communications AB" }, + { 0x0793, "Wha Yu Industrial Co., Ltd" }, + { 0x0794, "ABL Electronics Corp." }, + { 0x0795, "RealChip, Inc." }, + { 0x0796, "Certicom Corp." }, + { 0x0797, "Grandtech Semiconductor Corp." }, + { 0x0798, "Optelec" }, + { 0x0799, "Altera" }, + { 0x079b, "Sagem" }, + { 0x079d, "Alfadata Computer Corp." }, + { 0x07a1, "Digicom S.p.A." }, + { 0x07a2, "National Technical Systems" }, + { 0x07a3, "Onnto Corp." }, + { 0x07a4, "Be, Inc." }, + { 0x07a6, "ADMtek, Inc." }, + { 0x07aa, "Corega K.K." }, + { 0x07ab, "Freecom Technologies" }, + { 0x07af, "Microtech" }, + { 0x07b0, "Trust Technologies" }, + { 0x07b1, "IMP, Inc." }, + { 0x07b2, "Motorola BCS, Inc." }, + { 0x07b3, "Plustek, Inc." }, + { 0x07b4, "Olympus Optical Co., Ltd" }, + { 0x07b5, "Mega World International, Ltd" }, + { 0x07b6, "Marubun Corp." }, + { 0x07b7, "TIME Interconnect, Ltd" }, + { 0x07b8, "D-Link Corp." }, + { 0x07bc, "Canon Computer Systems, Inc." }, + { 0x07bd, "Webgear, Inc." }, + { 0x07be, "Veridicom" }, + { 0x07c0, "Code Mercenaries Hard- und Software GmbH" }, + { 0x07c1, "Keisokugiken" }, + { 0x07c4, "Datafab Systems, Inc." }, + { 0x07c5, "APG Cash Drawer" }, + { 0x07c6, "ShareWave, Inc." }, + { 0x07c7, "Powertech Industrial Co., Ltd" }, + { 0x07c8, "B.U.G., Inc." }, + { 0x07c9, "Allied Telesyn International" }, + { 0x07ca, "AVerMedia Technologies, Inc." }, + { 0x07cb, "Kingmax Technology, Inc." }, + { 0x07cc, "Carry Computer Eng., Co., Ltd" }, + { 0x07cd, "Elektor" }, + { 0x07cf, "Casio Computer Co., Ltd" }, + { 0x07d0, "Dazzle" }, + { 0x07d1, "D-Link System" }, + { 0x07d2, "Aptio Products, Inc." }, + { 0x07d3, "Cyberdata Corp." }, + { 0x07d5, "Radiant Systems" }, + { 0x07d7, "GCC Technologies, Inc." }, + { 0x07da, "Arasan Chip Systems" }, + { 0x07de, "Diamond Multimedia" }, + { 0x07df, "David Electronics Co., Ltd" }, + { 0x07e1, "Ambient Technologies, Inc." }, + { 0x07e2, "Elmeg GmbH & Co., Ltd" }, + { 0x07e3, "Planex Communications, Inc." }, + { 0x07e4, "Movado Enterprise Co., Ltd" }, + { 0x07e5, "QPS, Inc." }, + { 0x07e6, "Allied Cable Corp." }, + { 0x07e7, "Mirvo Toys, Inc." }, + { 0x07e8, "Labsystems" }, + { 0x07ea, "Iwatsu Electric Co., Ltd" }, + { 0x07eb, "Double-H Technology Co., Ltd" }, + { 0x07ec, "Taiyo Electric Wire & Cable Co., Ltd" }, + { 0x07ee, "Torex Retail (formerly Logware)" }, + { 0x07ef, "STSN" }, + { 0x07f2, "Microcomputer Applications, Inc." }, + { 0x07f6, "Circuit Assembly Corp." }, + { 0x07f7, "Century Corp." }, + { 0x07f9, "Dotop Technology, Inc." }, + { 0x07fa, "Draytek" }, + { 0x07fd, "Mark of the Unicorn" }, + { 0x07ff, "Unknown" }, + { 0x0801, "Mag-Tek" }, + { 0x0802, "Mako Technologies, LLC" }, + { 0x0803, "Zoom Telephonics, Inc." }, + { 0x0809, "Genicom Technology, Inc." }, + { 0x080a, "Evermuch Technology Co., Ltd" }, + { 0x080b, "Cross Match Technologies" }, + { 0x080c, "Datalogic S.p.A." }, + { 0x080d, "Teco Image Systems Co., Ltd" }, + { 0x0810, "Personal Communication Systems, Inc." }, + { 0x0813, "Mattel, Inc." }, + { 0x0819, "eLicenser" }, + { 0x081a, "MG Logic" }, + { 0x081b, "Indigita Corp." }, + { 0x081c, "Mipsys" }, + { 0x081e, "AlphaSmart, Inc." }, + { 0x0822, "Reudo Corp." }, + { 0x0825, "GC Protronics" }, + { 0x0826, "Data Transit" }, + { 0x0827, "BroadLogic, Inc." }, + { 0x0828, "Sato Corp." }, + { 0x0829, "DirecTV Broadband, Inc. (Telocity)" }, + { 0x082d, "Handspring" }, + { 0x0830, "Palm, Inc." }, + { 0x0832, "Kouwell Electronics Corp." }, + { 0x0833, "Sourcenext Corp." }, + { 0x0835, "Action Star Enterprise Co., Ltd" }, + { 0x0839, "Samsung Techwin Co., Ltd" }, + { 0x083a, "Accton Technology Corp." }, + { 0x083f, "Global Village" }, + { 0x0840, "Argosy Research, Inc." }, + { 0x0841, "Rioport.com, Inc." }, + { 0x0844, "Welland Industrial Co., Ltd" }, + { 0x0846, "NetGear, Inc." }, + { 0x084d, "Minton Optic Industry Co., Inc." }, + { 0x084e, "KB Gear" }, + { 0x084f, "Empeg" }, + { 0x0850, "Fast Point Technologies, Inc." }, + { 0x0851, "Macronix International Co., Ltd" }, + { 0x0852, "CSEM" }, + { 0x0853, "Topre Corporation" }, + { 0x0854, "ActiveWire, Inc." }, + { 0x0856, "B&B Electronics" }, + { 0x0858, "Hitachi Maxell, Ltd" }, + { 0x0859, "Minolta Systems Laboratory, Inc." }, + { 0x085a, "Xircom" }, + { 0x085c, "ColorVision, Inc." }, + { 0x0862, "Teletrol Systems, Inc." }, + { 0x0863, "Filanet Corp." }, + { 0x0864, "NetGear, Inc." }, + { 0x0867, "Data Translation, Inc." }, + { 0x086a, "Emagic Soft- und Hardware GmbH" }, + { 0x086c, "DeTeWe - Deutsche Telephonwerke AG & Co." }, + { 0x086e, "System TALKS, Inc." }, + { 0x086f, "MEC IMEX, Inc." }, + { 0x0870, "Metricom" }, + { 0x0871, "SanDisk, Inc." }, + { 0x0873, "Xpeed, Inc." }, + { 0x0874, "A-Tec Subsystem, Inc." }, + { 0x0879, "Comtrol Corp." }, + { 0x087c, "Adesso/Kbtek America, Inc." }, + { 0x087d, "Jaton Corp." }, + { 0x087e, "Fujitsu Computer Products of America" }, + { 0x087f, "Virtual IP Group, Inc." }, + { 0x0880, "APT Technologies, Inc." }, + { 0x0883, "Recording Industry Association of America (RIAA)" }, + { 0x0885, "Boca Research, Inc." }, + { 0x0886, "XAC Automation Corp." }, + { 0x0887, "Hannstar Electronics Corp." }, + { 0x088b, "MassWorks, Inc." }, + { 0x088c, "Swecoin AB" }, + { 0x088e, "iLok" }, + { 0x0892, "DioGraphy, Inc." }, + { 0x0897, "Lauterbach" }, + { 0x089c, "United Technologies Research Cntr." }, + { 0x089d, "Icron Technologies Corp." }, + { 0x089e, "NST Co., Ltd" }, + { 0x089f, "Primex Aerospace Co." }, + { 0x08a5, "e9, Inc." }, + { 0x08a8, "Andrea Electronics" }, + { 0x08ae, "Macally (Mace Group, Inc.)" }, + { 0x08b4, "Sorenson Vision, Inc." }, + { 0x08b7, "NATSU" }, + { 0x08b8, "J. Gordon Electronic Design, Inc." }, + { 0x08b9, "RadioShack Corp. (Tandy)" }, + { 0x08bb, "Texas Instruments Japan" }, + { 0x08bd, "Citizen Watch Co., Ltd" }, + { 0x08c3, "Precise Biometrics" }, + { 0x08c4, "Proxim, Inc." }, + { 0x08c7, "Key Nice Enterprise Co., Ltd" }, + { 0x08c8, "2Wire, Inc." }, + { 0x08c9, "Nippon Telegraph and Telephone Corp." }, + { 0x08ca, "Aiptek International, Inc." }, + { 0x08cd, "Jue Hsun Ind. Corp." }, + { 0x08ce, "Long Well Electronics Corp." }, + { 0x08cf, "Productivity Enhancement Products" }, + { 0x08d1, "smartBridges, Inc." }, + { 0x08d3, "Virtual Ink" }, + { 0x08d4, "Fujitsu Siemens Computers" }, + { 0x08d8, "IXXAT Automation GmbH" }, + { 0x08d9, "Increment P Corp." }, + { 0x08dd, "Billionton Systems, Inc." }, + { 0x08de, "?" }, + { 0x08df, "Spyrus, Inc." }, + { 0x08e3, "Olitec, Inc." }, + { 0x08e4, "Pioneer Corp." }, + { 0x08e5, "Litronic" }, + { 0x08e6, "Gemplus" }, + { 0x08e7, "Pan-International Wire & Cable" }, + { 0x08e8, "Integrated Memory Logic" }, + { 0x08e9, "Extended Systems, Inc." }, + { 0x08ea, "Ericsson, Inc., Blue Ridge Labs" }, + { 0x08ec, "M-Systems Flash Disk Pioneers" }, + { 0x08ed, "MediaTek Inc." }, + { 0x08ee, "CCSI/Hesso" }, + { 0x08f0, "Corex Technologies" }, + { 0x08f1, "CTI Electronics Corp." }, + { 0x08f2, "Gotop Information Inc." }, + { 0x08f5, "SysTec Co., Ltd" }, + { 0x08f6, "Logic 3 International, Ltd" }, + { 0x08f7, "Vernier" }, + { 0x08f8, "Keen Top International Enterprise Co., Ltd" }, + { 0x08f9, "Wipro Technologies" }, + { 0x08fa, "Caere" }, + { 0x08fb, "Socket Communications" }, + { 0x08fc, "Sicon Cable Technology Co., Ltd" }, + { 0x08fd, "Digianswer A/S" }, + { 0x08ff, "AuthenTec, Inc." }, + { 0x0900, "Pinnacle Systems, Inc." }, + { 0x0901, "VST Technologies" }, + { 0x0906, "Faraday Technology Corp." }, + { 0x0908, "ShenZhen SANZHAI Technology Co.,Ltd" }, + { 0x0909, "Audio-Technica Corp." }, + { 0x090a, "Trumpion Microelectronics, Inc." }, + { 0x090b, "Neurosmith" }, + { 0x090c, "Feiya Technology Corp." }, + { 0x090d, "Multiport Computer Vertriebs GmbH" }, + { 0x090e, "Shining Technology, Inc." }, + { 0x090f, "Fujitsu Devices, Inc." }, + { 0x0910, "Alation Systems, Inc." }, + { 0x0911, "Philips Speech Processing" }, + { 0x0912, "Voquette, Inc." }, + { 0x0915, "GlobeSpan, Inc." }, + { 0x0917, "SmartDisk Corp." }, + { 0x0919, "Tiger Electronics" }, + { 0x091e, "Garmin International" }, + { 0x0920, "Echelon Co." }, + { 0x0921, "GoHubs, Inc." }, + { 0x0922, "Dymo-CoStar Corp." }, + { 0x0923, "IC Media Corp." }, + { 0x0924, "Xerox" }, + { 0x0925, "Lakeview Research" }, + { 0x0927, "Summus, Ltd" }, + { 0x0928, "Oxford Semiconductor, Ltd" }, + { 0x0929, "American Biometric Co." }, + { 0x092a, "Toshiba Information & Industrial Sys. And Services" }, + { 0x092b, "Sena Technologies, Inc." }, + { 0x092f, "Northern Embedded Science/CAVNEX" }, + { 0x0930, "Toshiba Corp." }, + { 0x0931, "Harmonic Data Systems, Ltd" }, + { 0x0932, "Crescentec Corp." }, + { 0x0933, "Quantum Corp." }, + { 0x0934, "Netcom Systems" }, + { 0x0936, "NuTesla" }, + { 0x0939, "Lumberg, Inc." }, + { 0x093a, "Pixart Imaging, Inc." }, + { 0x093b, "Plextor Corp." }, + { 0x093c, "Intrepid Control Systems, Inc." }, + { 0x093d, "InnoSync, Inc." }, + { 0x093e, "J.S.T. Mfg. Co., Ltd" }, + { 0x093f, "Olympia Telecom Vertriebs GmbH" }, + { 0x0940, "Japan Storage Battery Co., Ltd" }, + { 0x0941, "Photobit Corp." }, + { 0x0942, "i2Go.com, LLC" }, + { 0x0943, "HCL Technologies India Private, Ltd" }, + { 0x0944, "KORG, Inc." }, + { 0x0945, "Pasco Scientific" }, + { 0x0948, "Kronauer music in digital" }, + { 0x094b, "Linkup Systems Corp." }, + { 0x094d, "Cable Television Laboratories" }, + { 0x094f, "Yano" }, + { 0x0951, "Kingston Technology" }, + { 0x0954, "RPM Systems Corp." }, + { 0x0955, "NVidia Corp." }, + { 0x0956, "BSquare Corp." }, + { 0x0957, "Agilent Technologies, Inc." }, + { 0x0958, "CompuLink Research, Inc." }, + { 0x0959, "Cologne Chip AG" }, + { 0x095a, "Portsmith" }, + { 0x095b, "Medialogic Corp." }, + { 0x095c, "K-Tec Electronics" }, + { 0x095d, "Polycom, Inc." }, + { 0x0967, "Acer (?)" }, + { 0x0968, "Catalyst Enterprises, Inc." }, + { 0x096e, "Feitian Technologies, Inc." }, + { 0x0971, "Gretag-Macbeth AG" }, + { 0x0973, "Schlumberger" }, + { 0x0974, "Datagraphix, a business unit of Anacomp" }, + { 0x0975, "OL'E Communications, Inc." }, + { 0x0976, "Adirondack Wire & Cable" }, + { 0x0977, "Lightsurf Technologies" }, + { 0x0978, "Beckhoff GmbH" }, + { 0x0979, "Jeilin Technology Corp., Ltd" }, + { 0x097a, "Minds At Work LLC" }, + { 0x097b, "Knudsen Engineering, Ltd" }, + { 0x097c, "Marunix Co., Ltd" }, + { 0x097d, "Rosun Technologies, Inc." }, + { 0x097f, "Barun Electronics Co., Ltd" }, + { 0x0981, "Oak Technology, Ltd" }, + { 0x0984, "Apricorn" }, + { 0x0985, "cab Produkttechnik GmbH & Co KG" }, + { 0x0986, "Matsushita Electric Works, Ltd." }, + { 0x098c, "Vitana Corp." }, + { 0x098d, "INDesign" }, + { 0x098e, "Integrated Intellectual Property, Inc." }, + { 0x098f, "Kenwood TMI Corp." }, + { 0x0993, "Gemstar eBook Group, Ltd" }, + { 0x0996, "Integrated Telecom Express, Inc." }, + { 0x099a, "Zippy Technology Corp." }, + { 0x09a3, "PairGain Technologies" }, + { 0x09a4, "Contech Research, Inc." }, + { 0x09a5, "VCON Telecommunications" }, + { 0x09a6, "Poinchips" }, + { 0x09a7, "Data Transmission Network Corp." }, + { 0x09a8, "Lin Shiung Enterprise Co., Ltd" }, + { 0x09a9, "Smart Card Technologies Co., Ltd" }, + { 0x09aa, "Intersil Corp." }, + { 0x09ab, "Japan Cash Machine Co., Ltd." }, + { 0x09ae, "Tripp Lite" }, + { 0x09b2, "Franklin Electronic Publishers, Inc." }, + { 0x09b3, "Altius Solutions, Inc." }, + { 0x09b4, "MDS Telephone Systems" }, + { 0x09b5, "Celltrix Technology Co., Ltd" }, + { 0x09bc, "Grundig" }, + { 0x09be, "MySmart.Com" }, + { 0x09bf, "Auerswald GmbH & Co. KG" }, + { 0x09c1, "Arris Interactive LLC" }, + { 0x09c2, "Nisca Corp." }, + { 0x09c3, "ActivCard, Inc." }, + { 0x09c4, "ACTiSYS Corp." }, + { 0x09c5, "Memory Corp." }, + { 0x09cc, "Workbit Corp." }, + { 0x09cd, "Psion Dacom Home Networks, Ltd" }, + { 0x09ce, "City Electronics, Ltd" }, + { 0x09cf, "Electronics Testing Center, Taiwan" }, + { 0x09d1, "NeoMagic, Inc." }, + { 0x09d2, "Vreelin Engineering, Inc." }, + { 0x09d3, "Com One" }, + { 0x09d7, "Novatel Wireless" }, + { 0x09d9, "KRF Tech, Ltd" }, + { 0x09da, "A4 Tech Co., Ltd" }, + { 0x09db, "Measurement Computing Corp." }, + { 0x09dc, "Aimex Corp." }, + { 0x09dd, "Fellowes, Inc." }, + { 0x09df, "Addonics Technologies Corp." }, + { 0x09e1, "Intellon Corp." }, + { 0x09e5, "Jo-Dan International, Inc." }, + { 0x09e6, "Silutia, Inc." }, + { 0x09e7, "Real 3D, Inc." }, + { 0x09e8, "AKAI Professional M.I. Corp." }, + { 0x09e9, "Chen-Source, Inc." }, + { 0x09eb, "IM Networks, Inc." }, + { 0x09ef, "Xitel" }, + { 0x09f3, "GoFlight, Inc." }, + { 0x09f5, "AresCom" }, + { 0x09f6, "RocketChips, Inc." }, + { 0x09f7, "Edu-Science (H.K.), Ltd" }, + { 0x09f8, "SoftConnex Technologies, Inc." }, + { 0x09f9, "Bay Associates" }, + { 0x09fa, "Mtek Vision" }, + { 0x09fb, "Altera" }, + { 0x09ff, "Gain Technology Corp." }, + { 0x0a00, "Liquid Audio" }, + { 0x0a01, "ViA, Inc." }, + { 0x0a07, "Ontrak Control Systems Inc." }, + { 0x0a0b, "Cybex Computer Products Co." }, + { 0x0a11, "Xentec, Inc." }, + { 0x0a12, "Cambridge Silicon Radio, Ltd" }, + { 0x0a13, "Telebyte, Inc." }, + { 0x0a14, "Spacelabs Medical, Inc." }, + { 0x0a15, "Scalar Corp." }, + { 0x0a16, "Trek Technology (S) PTE, Ltd" }, + { 0x0a17, "Pentax Corp." }, + { 0x0a18, "Heidelberger Druckmaschinen AG" }, + { 0x0a19, "Hua Geng Technologies, Inc." }, + { 0x0a21, "Medtronic Physio Control Corp." }, + { 0x0a22, "Century Semiconductor USA, Inc." }, + { 0x0a27, "Datacard Group" }, + { 0x0a2c, "AK-Modul-Bus Computer GmbH" }, + { 0x0a34, "TG3 Electronics, Inc." }, + { 0x0a39, "Gilat Satellite Networks, Ltd" }, + { 0x0a3a, "PentaMedia Co., Ltd" }, + { 0x0a3c, "NTT DoCoMo, Inc." }, + { 0x0a3d, "Varo Vision" }, + { 0x0a3f, "Swissonic AG" }, + { 0x0a43, "Boca Systems, Inc." }, + { 0x0a46, "Davicom Semiconductor, Inc." }, + { 0x0a47, "Hirose Electric" }, + { 0x0a48, "I/O Interconnect" }, + { 0x0a4b, "Fujitsu Media Devices, Ltd" }, + { 0x0a4c, "Computex Co., Ltd" }, + { 0x0a4d, "Evolution Electronics, Ltd" }, + { 0x0a4e, "Steinberg Soft-und Hardware GmbH" }, + { 0x0a4f, "Litton Systems, Inc." }, + { 0x0a50, "Mimaki Engineering Co., Ltd" }, + { 0x0a51, "Sony Electronics, Inc." }, + { 0x0a52, "Jebsee Electronics Co., Ltd" }, + { 0x0a53, "Portable Peripheral Co., Ltd" }, + { 0x0a5a, "Electronics For Imaging, Inc." }, + { 0x0a5b, "EAsics NV" }, + { 0x0a5c, "Broadcom Corp." }, + { 0x0a5d, "Diatrend Corp." }, + { 0x0a5f, "Zebra" }, + { 0x0a62, "MPMan" }, + { 0x0a66, "ClearCube Technology" }, + { 0x0a67, "Medeli Electronics Co., Ltd" }, + { 0x0a68, "Comaide Corp." }, + { 0x0a69, "Chroma ate, Inc." }, + { 0x0a6b, "Green House Co., Ltd" }, + { 0x0a6c, "Integrated Circuit Systems, Inc." }, + { 0x0a6d, "UPS Manufacturing" }, + { 0x0a6e, "Benwin" }, + { 0x0a6f, "Core Technology, Inc." }, + { 0x0a70, "International Game Technology" }, + { 0x0a72, "Sanwa Denshi" }, + { 0x0a7d, "NSTL, Inc." }, + { 0x0a7e, "Octagon Systems Corp." }, + { 0x0a80, "Rexon Technology Corp., Ltd" }, + { 0x0a81, "Chesen Electronics Corp." }, + { 0x0a82, "Syscan" }, + { 0x0a83, "NextComm, Inc." }, + { 0x0a84, "Maui Innovative Peripherals" }, + { 0x0a85, "Idexx Labs" }, + { 0x0a86, "NITGen Co., Ltd" }, + { 0x0a8d, "Picturetel" }, + { 0x0a8e, "Japan Aviation Electronics Industry, Ltd" }, + { 0x0a90, "Candy Technology Co., Ltd" }, + { 0x0a91, "Globlink Technology, Inc." }, + { 0x0a92, "EGO SYStems, Inc." }, + { 0x0a93, "C Technologies AB" }, + { 0x0a94, "Intersense" }, + { 0x0aa3, "Lava Computer Mfg., Inc." }, + { 0x0aa4, "Develco Elektronik" }, + { 0x0aa5, "First International Digital" }, + { 0x0aa6, "Perception Digital, Ltd" }, + { 0x0aa7, "Wincor Nixdorf International GmbH" }, + { 0x0aa8, "TriGem Computer, Inc." }, + { 0x0aa9, "Baromtec Co." }, + { 0x0aaa, "Japan CBM Corp." }, + { 0x0aab, "Vision Shape Europe SA" }, + { 0x0aac, "iCompression, Inc." }, + { 0x0aad, "Rohde & Schwarz GmbH & Co. KG" }, + { 0x0aae, "NEC infrontia Corp. (Nitsuko)" }, + { 0x0aaf, "Digitalway Co., Ltd" }, + { 0x0ab0, "Arrow Strong Electronics Co., Ltd" }, + { 0x0ab1, "FEIG ELECTRONIC GmbH" }, + { 0x0aba, "Ellisys" }, + { 0x0abe, "Stereo-Link" }, + { 0x0ac3, "Sanyo Semiconductor Company Micro" }, + { 0x0ac4, "Leco Corp." }, + { 0x0ac5, "I & C Corp." }, + { 0x0ac6, "Singing Electrons, Inc." }, + { 0x0ac7, "Panwest Corp." }, + { 0x0ac8, "Z-Star Microelectronics Corp." }, + { 0x0ac9, "Micro Solutions, Inc." }, + { 0x0aca, "OPEN Networks Ltd" }, + { 0x0acc, "Koga Electronics Co." }, + { 0x0acd, "ID Tech" }, + { 0x0ace, "ZyDAS" }, + { 0x0acf, "Intoto, Inc." }, + { 0x0ad0, "Intellix Corp." }, + { 0x0ad1, "Remotec Technology, Ltd" }, + { 0x0ad2, "Service & Quality Technology Co., Ltd" }, + { 0x0ada, "Data Encryption Systems Ltd." }, + { 0x0ae3, "Allion Computer, Inc." }, + { 0x0ae4, "Taito Corp." }, + { 0x0ae7, "Neodym Systems, Inc." }, + { 0x0ae8, "System Support Co., Ltd" }, + { 0x0ae9, "North Shore Circuit Design L.L.P." }, + { 0x0aea, "SciEssence, LLC" }, + { 0x0aeb, "TTP Communications, Ltd" }, + { 0x0aec, "Neodio Technologies Corp." }, + { 0x0af0, "Option" }, + { 0x0af6, "Silver I Co., Ltd" }, + { 0x0af7, "B2C2, Inc." }, + { 0x0af9, "Hama, Inc." }, + { 0x0afc, "Zaptronix Ltd" }, + { 0x0afd, "Tateno Dennou, Inc." }, + { 0x0afe, "Cummins Engine Co." }, + { 0x0aff, "Jump Zone Network Products, Inc." }, + { 0x0b00, "INGENICO" }, + { 0x0b05, "ASUSTek Computer, Inc." }, + { 0x0b0b, "Datamax-O'Neil" }, + { 0x0b0c, "Todos AB" }, + { 0x0b0d, "ProjectLab" }, + { 0x0b0e, "GN Netcom" }, + { 0x0b0f, "AVID Technology" }, + { 0x0b10, "Pcally" }, + { 0x0b11, "I Tech Solutions Co., Ltd" }, + { 0x0b1e, "Electronic Warfare Assoc., Inc. (EWA)" }, + { 0x0b1f, "Insyde Software Corp." }, + { 0x0b20, "TransDimension, Inc." }, + { 0x0b21, "Yokogawa Electric Corp." }, + { 0x0b22, "Japan System Development Co., Ltd" }, + { 0x0b23, "Pan-Asia Electronics Co., Ltd" }, + { 0x0b24, "Link Evolution Corp." }, + { 0x0b27, "Ritek Corp." }, + { 0x0b28, "Kenwood Corp." }, + { 0x0b2c, "Village Center, Inc." }, + { 0x0b30, "PNY Technologies, Inc." }, + { 0x0b33, "Contour Design, Inc." }, + { 0x0b37, "Hitachi ULSI Systems Co., Ltd" }, + { 0x0b38, "Gear Head" }, + { 0x0b39, "Omnidirectional Control Technology, Inc." }, + { 0x0b3a, "IPaxess" }, + { 0x0b3b, "Tekram Technology Co., Ltd" }, + { 0x0b3c, "Olivetti Techcenter" }, + { 0x0b3e, "Kikusui Electronics Corp." }, + { 0x0b41, "Hal Corp." }, + { 0x0b43, "Play.com, Inc." }, + { 0x0b47, "Sportbug.com, Inc." }, + { 0x0b48, "TechnoTrend AG" }, + { 0x0b49, "ASCII Corp." }, + { 0x0b4b, "Pine Corp. Ltd." }, + { 0x0b4d, "Graphtec America, Inc." }, + { 0x0b4e, "Musical Electronics, Ltd" }, + { 0x0b50, "Dumpries Co., Ltd" }, + { 0x0b51, "Comfort Keyboard Co." }, + { 0x0b52, "Colorado MicroDisplay, Inc." }, + { 0x0b54, "Sinbon Electronics Co., Ltd" }, + { 0x0b56, "TYI Systems, Ltd" }, + { 0x0b57, "Beijing HanwangTechnology Co., Ltd" }, + { 0x0b59, "Lake Communications, Ltd" }, + { 0x0b5a, "Corel Corp." }, + { 0x0b5f, "Green Electronics Co., Ltd" }, + { 0x0b60, "Nsine, Ltd" }, + { 0x0b61, "NEC Viewtechnology, Ltd" }, + { 0x0b62, "Orange Micro, Inc." }, + { 0x0b63, "ADLink Technology, Inc." }, + { 0x0b64, "Wonderful Wire Cable Co., Ltd" }, + { 0x0b65, "Expert Magnetics Corp." }, + { 0x0b69, "CacheVision" }, + { 0x0b6a, "Maxim Integrated Products" }, + { 0x0b6f, "Nagano Japan Radio Co., Ltd" }, + { 0x0b70, "PortalPlayer, Inc." }, + { 0x0b71, "SHIN-EI Sangyo Co., Ltd" }, + { 0x0b72, "Embedded Wireless Technology Co., Ltd" }, + { 0x0b73, "Computone Corp." }, + { 0x0b75, "Roland DG Corp." }, + { 0x0b79, "Sunrise Telecom, Inc." }, + { 0x0b7a, "Zeevo, Inc." }, + { 0x0b7b, "Taiko Denki Co., Ltd" }, + { 0x0b7c, "ITRAN Communications, Ltd" }, + { 0x0b7d, "Astrodesign, Inc." }, + { 0x0b81, "id3 Semiconductors" }, + { 0x0b84, "Rextron Technology, Inc." }, + { 0x0b85, "Elkat Electronics, Sdn., Bhd." }, + { 0x0b86, "Exputer Systems, Inc." }, + { 0x0b87, "Plus-One I & T, Inc." }, + { 0x0b88, "Sigma Koki Co., Ltd, Technology Center" }, + { 0x0b89, "Advanced Digital Broadcast, Ltd" }, + { 0x0b8c, "SMART Technologies Inc." }, + { 0x0b95, "ASIX Electronics Corp." }, + { 0x0b96, "Sewon Telecom" }, + { 0x0b97, "O2 Micro, Inc." }, + { 0x0b98, "Playmates Toys, Inc." }, + { 0x0b99, "Audio International, Inc." }, + { 0x0b9b, "Dipl.-Ing. Stefan Kunde" }, + { 0x0b9d, "Softprotec Co." }, + { 0x0b9f, "Chippo Technologies" }, + { 0x0baf, "U.S. Robotics" }, + { 0x0bb0, "Concord Camera Corp." }, + { 0x0bb1, "Infinilink Corp." }, + { 0x0bb2, "Ambit Microsystems Corp." }, + { 0x0bb3, "Ofuji Technology" }, + { 0x0bb4, "High Tech Computer Corp." }, + { 0x0bb5, "Murata Manufacturing Co., Ltd" }, + { 0x0bb6, "Network Alchemy" }, + { 0x0bb7, "Joytech Computer Co., Ltd" }, + { 0x0bb8, "Hitachi Semiconductor and Devices Sales Co., Ltd" }, + { 0x0bb9, "Eiger M&C Co., Ltd" }, + { 0x0bba, "ZAccess Systems" }, + { 0x0bbb, "General Meters Corp." }, + { 0x0bbc, "Assistive Technology, Inc." }, + { 0x0bbd, "System Connection, Inc." }, + { 0x0bc0, "Knilink Technology, Inc." }, + { 0x0bc1, "Fuw Yng Electronics Co., Ltd" }, + { 0x0bc2, "Seagate RSS LLC" }, + { 0x0bc3, "IPWireless, Inc." }, + { 0x0bc4, "Microcube Corp." }, + { 0x0bc5, "JCN Co., Ltd" }, + { 0x0bc6, "ExWAY, Inc." }, + { 0x0bc7, "X10 Wireless Technology, Inc." }, + { 0x0bc8, "Telmax Communications" }, + { 0x0bc9, "ECI Telecom, Ltd" }, + { 0x0bca, "Startek Engineering, Inc." }, + { 0x0bcb, "Perfect Technic Enterprise Co., Ltd" }, + { 0x0bd7, "Andrew Pargeter & Associates" }, + { 0x0bda, "Realtek Semiconductor Corp." }, + { 0x0bdb, "Ericsson Business Mobile Networks BV" }, + { 0x0bdc, "Y Media Corp." }, + { 0x0bdd, "Orange PCS" }, + { 0x0be2, "Kanda Tsushin Kogyo Co., Ltd" }, + { 0x0be3, "TOYO Corp." }, + { 0x0be4, "Elka International, Ltd" }, + { 0x0be5, "DOME imaging systems, Inc." }, + { 0x0be6, "Dong Guan Humen Wonderful Wire Cable Factory" }, + { 0x0bed, "Silicon Labs" }, + { 0x0bee, "LTK Industries, Ltd" }, + { 0x0bef, "Way2Call Communications" }, + { 0x0bf0, "Pace Micro Technology PLC" }, + { 0x0bf1, "Intracom S.A." }, + { 0x0bf2, "Konexx" }, + { 0x0bf6, "Addonics Technologies, Inc." }, + { 0x0bf7, "Sunny Giken, Inc." }, + { 0x0bf8, "Fujitsu Siemens Computers" }, + { 0x0c04, "MOTO Development Group, Inc." }, + { 0x0c05, "Appian Graphics" }, + { 0x0c06, "Hasbro Games, Inc." }, + { 0x0c07, "Infinite Data Storage, Ltd" }, + { 0x0c08, "Agate" }, + { 0x0c09, "Comjet Information System" }, + { 0x0c0a, "Highpoint Technologies, Inc." }, + { 0x0c0b, "Dura Micro, Inc. (Acomdata)" }, + { 0x0c12, "Zeroplus" }, + { 0x0c15, "Iris Graphics" }, + { 0x0c16, "Gyration, Inc." }, + { 0x0c17, "Cyberboard A/S" }, + { 0x0c18, "SynerTek Korea, Inc." }, + { 0x0c19, "cyberPIXIE, Inc." }, + { 0x0c1a, "Silicon Motion, Inc." }, + { 0x0c1b, "MIPS Technologies" }, + { 0x0c1c, "Hang Zhou Silan Electronics Co., Ltd" }, + { 0x0c22, "Tally Printer Corp." }, + { 0x0c23, "Lernout + Hauspie" }, + { 0x0c24, "Taiyo Yuden" }, + { 0x0c25, "Sampo Corp." }, + { 0x0c26, "Prolific Technology Inc." }, + { 0x0c27, "RFIDeas, Inc" }, + { 0x0c2e, "Metro" }, + { 0x0c35, "Eagletron, Inc." }, + { 0x0c36, "E Ink Corp." }, + { 0x0c37, "e.Digital" }, + { 0x0c38, "Der An Electric Wire & Cable Co., Ltd" }, + { 0x0c39, "IFR" }, + { 0x0c3a, "Furui Precise Component (Kunshan) Co., Ltd" }, + { 0x0c3b, "Komatsu, Ltd" }, + { 0x0c3c, "Radius Co., Ltd" }, + { 0x0c3d, "Innocom, Inc." }, + { 0x0c3e, "Nextcell, Inc." }, + { 0x0c44, "Motorola iDEN" }, + { 0x0c45, "Microdia" }, + { 0x0c46, "WaveRider Communications, Inc." }, + { 0x0c4b, "Reiner SCT Kartensysteme GmbH" }, + { 0x0c52, "Sealevel Systems, Inc." }, + { 0x0c53, "ViewPLUS, Inc." }, + { 0x0c54, "Glory, Ltd" }, + { 0x0c55, "Spectrum Digital, Inc." }, + { 0x0c56, "Billion Bright, Ltd" }, + { 0x0c57, "Imaginative Design Operation Co., Ltd" }, + { 0x0c58, "Vidar Systems Corp." }, + { 0x0c59, "Dong Guan Shinko Wire Co., Ltd" }, + { 0x0c5a, "TRS International Mfg., Inc." }, + { 0x0c5e, "Xytronix Research & Design" }, + { 0x0c60, "Apogee Electronics Corp." }, + { 0x0c62, "Chant Sincere Co., Ltd" }, + { 0x0c63, "Toko, Inc." }, + { 0x0c64, "Signality System Engineering Co., Ltd" }, + { 0x0c65, "Eminence Enterprise Co., Ltd" }, + { 0x0c66, "Rexon Electronics Corp." }, + { 0x0c67, "Concept Telecom, Ltd" }, + { 0x0c70, "MCT Elektronikladen" }, + { 0x0c74, "Optronic Laboratories Inc." }, + { 0x0c76, "JMTek, LLC." }, + { 0x0c77, "Sipix Group, Ltd" }, + { 0x0c78, "Detto Corp." }, + { 0x0c79, "NuConnex Technologies Pte., Ltd" }, + { 0x0c7a, "Wing-Span Enterprise Co., Ltd" }, + { 0x0c86, "NDA Technologies, Inc." }, + { 0x0c88, "Kyocera Wireless Corp." }, + { 0x0c89, "Honda Tsushin Kogyo Co., Ltd" }, + { 0x0c8a, "Pathway Connectivity, Inc." }, + { 0x0c8b, "Wavefly Corp." }, + { 0x0c8c, "Coactive Networks" }, + { 0x0c8d, "Tempo" }, + { 0x0c8e, "Cesscom Co., Ltd" }, + { 0x0c8f, "Applied Microsystems" }, + { 0x0c98, "Berkshire Products, Inc." }, + { 0x0c99, "Innochips Co., Ltd" }, + { 0x0c9a, "Hanwool Robotics Corp." }, + { 0x0c9b, "Jobin Yvon, Inc." }, + { 0x0c9d, "SemTek" }, + { 0x0ca2, "Zyfer" }, + { 0x0ca3, "Sega Corp." }, + { 0x0ca4, "ST&T Instrument Corp." }, + { 0x0ca5, "BAE Systems Canada, Inc." }, + { 0x0ca6, "Castles Technology Co., Ltd" }, + { 0x0ca7, "Information Systems Laboratories" }, + { 0x0cad, "Motorola CGISS" }, + { 0x0cae, "Ascom Business Systems, Ltd" }, + { 0x0caf, "Buslink" }, + { 0x0cb0, "Flying Pig Systems" }, + { 0x0cb1, "Innovonics, Inc." }, + { 0x0cb6, "Celestix Networks, Pte., Ltd" }, + { 0x0cb7, "Singatron Enterprise Co., Ltd" }, + { 0x0cb8, "Opticis Co., Ltd" }, + { 0x0cba, "Trust Electronic (Shanghai) Co., Ltd" }, + { 0x0cbb, "Shanghai Darong Electronics Co., Ltd" }, + { 0x0cbc, "Palmax Technology Co., Ltd" }, + { 0x0cbd, "Pentel Co., Ltd (Electronics Equipment Div.)" }, + { 0x0cbe, "Keryx Technologies, Inc." }, + { 0x0cbf, "Union Genius Computer Co., Ltd" }, + { 0x0cc0, "Kuon Yi Industrial Corp." }, + { 0x0cc1, "Given Imaging, Ltd" }, + { 0x0cc2, "Timex Corp." }, + { 0x0cc3, "Rimage Corp." }, + { 0x0cc4, "emsys GmbH" }, + { 0x0cc5, "Sendo" }, + { 0x0cc6, "Intermagic Corp." }, + { 0x0cc7, "Kontron Medical AG" }, + { 0x0cc8, "Technotools Corp." }, + { 0x0cc9, "BroadMAX Technologies, Inc." }, + { 0x0cca, "Amphenol" }, + { 0x0ccb, "SKNet Co., Ltd" }, + { 0x0ccc, "Domex Technology Corp." }, + { 0x0ccd, "TerraTec Electronic GmbH" }, + { 0x0cd4, "Bang Olufsen" }, + { 0x0cd5, "LabJack Corporation" }, + { 0x0cd7, "NewChip S.r.l." }, + { 0x0cd8, "JS Digitech, Inc." }, + { 0x0cd9, "Hitachi Shin Din Cable, Ltd" }, + { 0x0cde, "Z-Com" }, + { 0x0ce5, "Validation Technologies International" }, + { 0x0ce9, "pico Technology" }, + { 0x0cf1, "e-Conn Electronic Co., Ltd" }, + { 0x0cf2, "ENE Technology, Inc." }, + { 0x0cf3, "Atheros Communications, Inc." }, + { 0x0cf4, "Fomtex Corp." }, + { 0x0cf5, "Cellink Co., Ltd" }, + { 0x0cf6, "Compucable Corp." }, + { 0x0cf7, "ishoni Networks" }, + { 0x0cf8, "Clarisys, Inc." }, + { 0x0cf9, "Central System Research Co., Ltd" }, + { 0x0cfa, "Inviso, Inc." }, + { 0x0cfc, "Minolta-QMS, Inc." }, + { 0x0cff, "SAFA MEDIA Co., Ltd." }, + { 0x0d06, "telos EDV Systementwicklung GmbH" }, + { 0x0d08, "UTStarcom" }, + { 0x0d0b, "Contemporary Controls" }, + { 0x0d0c, "Astron Electronics Co., Ltd" }, + { 0x0d0d, "MKNet Corp." }, + { 0x0d0e, "Hybrid Networks, Inc." }, + { 0x0d0f, "Feng Shin Cable Co., Ltd" }, + { 0x0d10, "Elastic Networks" }, + { 0x0d11, "Maspro Denkoh Corp." }, + { 0x0d12, "Hansol Electronics, Inc." }, + { 0x0d13, "BMF Corp." }, + { 0x0d14, "Array Comm, Inc." }, + { 0x0d15, "OnStream b.v." }, + { 0x0d16, "Hi-Touch Imaging Technologies Co., Ltd" }, + { 0x0d17, "NALTEC, Inc." }, + { 0x0d18, "coaXmedia" }, + { 0x0d19, "Hank Connection Industrial Co., Ltd" }, + { 0x0d32, "Leo Hui Electric Wire & Cable Co., Ltd" }, + { 0x0d33, "AirSpeak, Inc." }, + { 0x0d34, "Rearden Steel Technologies" }, + { 0x0d35, "Dah Kun Co., Ltd" }, + { 0x0d3a, "Posiflex Technologies, Inc." }, + { 0x0d3c, "Sri Cable Technology, Ltd" }, + { 0x0d3d, "Tangtop Technology Co., Ltd" }, + { 0x0d3e, "Fitcom, inc." }, + { 0x0d3f, "MTS Systems Corp." }, + { 0x0d40, "Ascor, Inc." }, + { 0x0d41, "Ta Yun Terminals Industrial Co., Ltd" }, + { 0x0d42, "Full Der Co., Ltd" }, + { 0x0d46, "Kobil Systems GmbH" }, + { 0x0d49, "Maxtor" }, + { 0x0d4a, "NF Corp." }, + { 0x0d4b, "Grape Systems, Inc." }, + { 0x0d4c, "Tedas AG" }, + { 0x0d4d, "Coherent, Inc." }, + { 0x0d4e, "Agere Systems Netherland BV" }, + { 0x0d4f, "EADS Airbus France" }, + { 0x0d50, "Cleware GmbH" }, + { 0x0d51, "Volex (Asia) Pte., Ltd" }, + { 0x0d53, "HMI Co., Ltd" }, + { 0x0d54, "Holon Corp." }, + { 0x0d55, "ASKA Technologies, Inc." }, + { 0x0d56, "AVLAB Technology, Inc." }, + { 0x0d57, "Solomon Microtech, Ltd" }, + { 0x0d5c, "SMC Networks, Inc." }, + { 0x0d5e, "Myacom, Ltd" }, + { 0x0d5f, "CSI, Inc." }, + { 0x0d60, "IVL Technologies, Ltd" }, + { 0x0d61, "Meilu Electronics (Shenzhen) Co., Ltd" }, + { 0x0d62, "Darfon Electronics Corp." }, + { 0x0d63, "Fritz Gegauf AG" }, + { 0x0d64, "DXG Technology Corp." }, + { 0x0d65, "KMJP Co., Ltd" }, + { 0x0d66, "TMT" }, + { 0x0d67, "Advanet, Inc." }, + { 0x0d68, "Super Link Electronics Co., Ltd" }, + { 0x0d69, "NSI" }, + { 0x0d6a, "Megapower International Corp." }, + { 0x0d6b, "And-Or Logic" }, + { 0x0d70, "Try Computer Co., Ltd" }, + { 0x0d71, "Hirakawa Hewtech Corp." }, + { 0x0d72, "Winmate Communication, Inc." }, + { 0x0d73, "Hit's Communications, Inc." }, + { 0x0d76, "MFP Korea, Inc." }, + { 0x0d77, "Power Sentry/Newpoint" }, + { 0x0d78, "Japan Distributor Corp." }, + { 0x0d7a, "MARX Datentechnik GmbH" }, + { 0x0d7b, "Wellco Technology Co., Ltd" }, + { 0x0d7c, "Taiwan Line Tek Electronic Co., Ltd" }, + { 0x0d7d, "Phison Electronics Corp." }, + { 0x0d7e, "American Computer & Digital Components" }, + { 0x0d7f, "Essential Reality LLC" }, + { 0x0d80, "H.R. Silvine Electronics, Inc." }, + { 0x0d81, "TechnoVision" }, + { 0x0d83, "Think Outside, Inc." }, + { 0x0d87, "Dolby Laboratories Inc." }, + { 0x0d89, "Oz Software" }, + { 0x0d8a, "King Jim Co., Ltd" }, + { 0x0d8b, "Ascom Telecommunications, Ltd" }, + { 0x0d8c, "C-Media Electronics, Inc." }, + { 0x0d8d, "Promotion & Display Technology, Ltd" }, + { 0x0d8e, "Global Sun Technology, Inc." }, + { 0x0d8f, "Pitney Bowes" }, + { 0x0d90, "Sure-Fire Electrical Corp." }, + { 0x0d96, "Skanhex Technology, Inc." }, + { 0x0d97, "Santa Barbara Instrument Group" }, + { 0x0d98, "Mars Semiconductor Corp." }, + { 0x0d99, "Trazer Technologies, Inc." }, + { 0x0d9a, "RTX Telecom AS" }, + { 0x0d9b, "Tat Shing Electrical Co." }, + { 0x0d9c, "Chee Chen Hi-Technology Co., Ltd" }, + { 0x0d9d, "Sanwa Supply, Inc." }, + { 0x0d9e, "Avaya" }, + { 0x0d9f, "Powercom Co., Ltd" }, + { 0x0da0, "Danger Research" }, + { 0x0da1, "Suzhou Peter's Precise Industrial Co., Ltd" }, + { 0x0da2, "Land Instruments International, Ltd" }, + { 0x0da3, "Nippon Electro-Sensory Devices Corp." }, + { 0x0da4, "Polar Electro OY" }, + { 0x0da7, "IOGear, Inc." }, + { 0x0da8, "softDSP Co., Ltd" }, + { 0x0dab, "Cubig Group" }, + { 0x0dad, "Westover Scientific" }, + { 0x0db0, "Micro Star International" }, + { 0x0db1, "Wen Te Electronics Co., Ltd" }, + { 0x0db2, "Shian Hwi Plug Parts, Plastic Factory" }, + { 0x0db3, "Tekram Technology Co., Ltd" }, + { 0x0db4, "Chung Fu Chen Yeh Enterprise Corp." }, + { 0x0db7, "ELCON Systemtechnik" }, + { 0x0dbc, "A&D Medical" }, + { 0x0dbe, "Jiuh Shiuh Precision Industry Co., Ltd" }, + { 0x0dbf, "Quik Tech Solutions" }, + { 0x0dc0, "Great Notions" }, + { 0x0dc1, "Tamagawa Seiki Co., Ltd" }, + { 0x0dc3, "Athena Smartcard Solutions, Inc." }, + { 0x0dc4, "Macpower Peripherals, Ltd" }, + { 0x0dc5, "SDK Co., Ltd" }, + { 0x0dc6, "Precision Squared Technology Corp." }, + { 0x0dc7, "First Cable Line, Inc." }, + { 0x0dcd, "NetworkFab Corp." }, + { 0x0dd0, "Access Solutions" }, + { 0x0dd1, "Contek Electronics Co., Ltd" }, + { 0x0dd2, "Power Quotient International Co., Ltd" }, + { 0x0dd3, "MediaQ" }, + { 0x0dd4, "Custom Engineering SPA" }, + { 0x0dd5, "California Micro Devices" }, + { 0x0dd7, "Kocom Co., Ltd" }, + { 0x0dd8, "Netac Technology Co., Ltd" }, + { 0x0dd9, "HighSpeed Surfing" }, + { 0x0dda, "Integrated Circuit Solution, Inc." }, + { 0x0ddb, "Tamarack, Inc." }, + { 0x0ddd, "Datelink Technology Co., Ltd" }, + { 0x0dde, "Ubicom, Inc." }, + { 0x0de0, "BD Consumer Healthcare" }, + { 0x0dea, "UTECH Electronic (D.G.) Co., Ltd." }, + { 0x0ded, "Novasonics" }, + { 0x0dee, "Lifetime Memory Products" }, + { 0x0def, "Full Rise Electronic Co., Ltd" }, + { 0x0df4, "NET&SYS" }, + { 0x0df6, "Sitecom Europe B.V." }, + { 0x0df7, "Mobile Action Technology, Inc." }, + { 0x0dfa, "Toyo Communication Equipment Co., Ltd" }, + { 0x0dfc, "GeneralTouch Technology Co., Ltd" }, + { 0x0e03, "Nippon Systemware Co., Ltd" }, + { 0x0e08, "Winbest Technology Co., Ltd" }, + { 0x0e0b, "Amigo Technology Inc." }, + { 0x0e0c, "Gesytec" }, + { 0x0e0f, "VMware, Inc." }, + { 0x0e16, "JMTek, LLC" }, + { 0x0e17, "Walex Electronic, Ltd" }, + { 0x0e1b, "Crewave" }, + { 0x0e20, "Pegasus Technologies Ltd." }, + { 0x0e21, "Cowon Systems, Inc." }, + { 0x0e22, "Symbian Ltd." }, + { 0x0e23, "Liou Yuane Enterprise Co., Ltd" }, + { 0x0e25, "VinChip Systems, Inc." }, + { 0x0e26, "J-Phone East Co., Ltd" }, + { 0x0e30, "HeartMath LLC" }, + { 0x0e34, "Micro Computer Control Corp." }, + { 0x0e35, "3Pea Technologies, Inc." }, + { 0x0e36, "TiePie engineering" }, + { 0x0e38, "Stratitec, Inc." }, + { 0x0e39, "Smart Modular Technologies, Inc." }, + { 0x0e3a, "Neostar Technology Co., Ltd" }, + { 0x0e3b, "Mansella, Ltd" }, + { 0x0e41, "Line6, Inc." }, + { 0x0e44, "Sun-Riseful Technology Co., Ltd." }, + { 0x0e48, "Julia Corp., Ltd" }, + { 0x0e4a, "Shenzhen Bao Hing Electric Wire & Cable Mfr. Co." }, + { 0x0e4c, "Radica Games, Ltd" }, + { 0x0e55, "Speed Dragon Multimedia, Ltd" }, + { 0x0e56, "Kingston Technology Company, Inc." }, + { 0x0e5a, "Active Co., Ltd" }, + { 0x0e5b, "Union Power Information Industrial Co., Ltd" }, + { 0x0e5c, "Bitland Information Technology Co., Ltd" }, + { 0x0e5d, "Neltron Industrial Co., Ltd" }, + { 0x0e5e, "Conwise Technology Co., Ltd." }, + { 0x0e66, "Hawking Technologies" }, + { 0x0e67, "Fossil, Inc." }, + { 0x0e6a, "Megawin Technology Co., Ltd" }, + { 0x0e6f, "Logic3" }, + { 0x0e70, "Tokyo Electronic Industry Co., Ltd" }, + { 0x0e72, "Hsi-Chin Electronics Co., Ltd" }, + { 0x0e75, "TVS Electronics, Ltd" }, + { 0x0e79, "Archos, Inc." }, + { 0x0e7b, "On-Tech Industry Co., Ltd" }, + { 0x0e7e, "Gmate, Inc." }, + { 0x0e82, "Ching Tai Electric Wire & Cable Co., Ltd" }, + { 0x0e83, "Shin An Wire & Cable Co." }, + { 0x0e8c, "Well Force Electronic Co., Ltd" }, + { 0x0e8d, "MediaTek Inc." }, + { 0x0e8f, "GreenAsia Inc." }, + { 0x0e90, "WiebeTech, LLC" }, + { 0x0e91, "VTech Engineering Canada, Ltd" }, + { 0x0e92, "C's Glory Enterprise Co., Ltd" }, + { 0x0e93, "eM Technics Co., Ltd" }, + { 0x0e95, "Future Technology Co., Ltd" }, + { 0x0e96, "Aplux Communications, Ltd" }, + { 0x0e97, "Fingerworks, Inc." }, + { 0x0e98, "Advanced Analogic Technologies, Inc." }, + { 0x0e99, "Parallel Dice Co., Ltd" }, + { 0x0e9a, "TA HSING Industries, Ltd" }, + { 0x0e9b, "ADTEC Corp." }, + { 0x0e9c, "Streamzap, Inc." }, + { 0x0e9f, "Tamura Corp." }, + { 0x0ea0, "Ours Technology, Inc." }, + { 0x0ea6, "Nihon Computer Co., Ltd" }, + { 0x0ea7, "MSL Enterprises Corp." }, + { 0x0ea8, "CenDyne, Inc." }, + { 0x0ead, "Humax Co., Ltd" }, + { 0x0eb0, "NovaTech" }, + { 0x0eb1, "WIS Technologies, Inc." }, + { 0x0eb2, "Y-S Electronic Co., Ltd" }, + { 0x0eb3, "Saint Technology Corp." }, + { 0x0eb7, "Endor AG" }, + { 0x0ebe, "VWeb Corp." }, + { 0x0ebf, "Omega Technology of Taiwan, Inc." }, + { 0x0ec0, "LHI Technology (China) Co., Ltd" }, + { 0x0ec1, "Abit Computer Corp." }, + { 0x0ec2, "Sweetray Industrial, Ltd" }, + { 0x0ec3, "Axell Co., Ltd" }, + { 0x0ec4, "Ballracing Developments, Ltd" }, + { 0x0ec5, "GT Information System Co., Ltd" }, + { 0x0ec6, "InnoVISION Multimedia, Ltd" }, + { 0x0ec7, "Theta Link Corp." }, + { 0x0ecd, "Lite-On IT Corp." }, + { 0x0ece, "TaiSol Electronics Co., Ltd" }, + { 0x0ecf, "Phogenix Imaging, LLC" }, + { 0x0ed1, "WinMaxGroup" }, + { 0x0ed2, "Kyoto Micro Computer Co., Ltd" }, + { 0x0ed3, "Wing-Tech Enterprise Co., Ltd" }, + { 0x0ed5, "Fiberbyte" }, + { 0x0eda, "Noriake Itron Corp." }, + { 0x0edf, "e-MDT Co., Ltd" }, + { 0x0ee0, "Shima Seiki Mfg., Ltd" }, + { 0x0ee1, "Sarotech Co., Ltd" }, + { 0x0ee2, "AMI Semiconductor, Inc." }, + { 0x0ee3, "ComTrue Technology Corp." }, + { 0x0ee4, "Sunrich Technology, Ltd" }, + { 0x0eee, "Digital Stream Technology, Inc." }, + { 0x0eef, "D-WAV Scientific Co., Ltd" }, + { 0x0ef0, "Hitachi Cable, Ltd" }, + { 0x0ef1, "Aichi Micro Intelligent Corp." }, + { 0x0ef2, "I/O Magic Corp." }, + { 0x0ef3, "Lynn Products, Inc." }, + { 0x0ef4, "DSI Datotech" }, + { 0x0ef5, "PointChips" }, + { 0x0ef6, "Yield Microelectronics Corp." }, + { 0x0ef7, "SM Tech Co., Ltd (Tulip)" }, + { 0x0efd, "Oasis Semiconductor" }, + { 0x0efe, "Wem Technology, Inc." }, + { 0x0f06, "Visual Frontier Enterprise Co., Ltd" }, + { 0x0f08, "CSL Wire & Plug (Shen Zhen) Co." }, + { 0x0f0c, "CAS Corp." }, + { 0x0f0d, "Hori Co., Ltd" }, + { 0x0f0e, "Energy Full Corp." }, + { 0x0f11, "LD Didactic GmbH" }, + { 0x0f12, "Mars Engineering Corp." }, + { 0x0f13, "Acetek Technology Co., Ltd" }, + { 0x0f18, "Finger Lakes Instrumentation" }, + { 0x0f19, "Oracom Co., Ltd" }, + { 0x0f1b, "Onset Computer Corp." }, + { 0x0f1c, "Funai Electric Co., Ltd" }, + { 0x0f1d, "Iwill Corp." }, + { 0x0f21, "IOI Technology Corp." }, + { 0x0f22, "Senior Industries, Inc." }, + { 0x0f23, "Leader Tech Manufacturer Co., Ltd" }, + { 0x0f24, "Flex-P Industries, Snd., Bhd." }, + { 0x0f2d, "ViPower, Inc." }, + { 0x0f2e, "Geniality Maple Technology Co., Ltd" }, + { 0x0f2f, "Priva Design Services" }, + { 0x0f30, "Jess Technology Co., Ltd" }, + { 0x0f31, "Chrysalis Development" }, + { 0x0f32, "YFC-BonEagle Electric Co., Ltd" }, + { 0x0f37, "Kokuyo Co., Ltd" }, + { 0x0f38, "Nien-Yi Industrial Corp." }, + { 0x0f3d, "Airprime, Incorporated" }, + { 0x0f41, "RDC Semiconductor Co., Ltd" }, + { 0x0f42, "Nital Consulting Services, Inc." }, + { 0x0f44, "Polhemus" }, + { 0x0f4b, "St. John Technology Co., Ltd" }, + { 0x0f4c, "WorldWide Cable Opto Corp." }, + { 0x0f4d, "Microtune, Inc." }, + { 0x0f4e, "Freedom Scientific" }, + { 0x0f52, "Wing Key Electrical Co., Ltd" }, + { 0x0f53, "Dongguan White Horse Cable Factory, Ltd" }, + { 0x0f54, "Kawai Musical Instruments Mfg. Co., Ltd" }, + { 0x0f55, "AmbiCom, Inc." }, + { 0x0f5c, "Prairiecomm, Inc." }, + { 0x0f5d, "NewAge International, LLC" }, + { 0x0f5f, "Key Technology Corp." }, + { 0x0f60, "NTK, Ltd" }, + { 0x0f61, "Varian, Inc." }, + { 0x0f62, "Acrox Technologies Co., Ltd" }, + { 0x0f63, "LeapFrog Enterprises" }, + { 0x0f68, "Kobe Steel, Ltd" }, + { 0x0f69, "Dionex Corp." }, + { 0x0f6a, "Vibren Technologies, Inc." }, + { 0x0f6e, "INTELLIGENT SYSTEMS" }, + { 0x0f73, "DFI" }, + { 0x0f7c, "DQ Technology, Inc." }, + { 0x0f7d, "NetBotz, Inc." }, + { 0x0f7e, "Fluke Corp." }, + { 0x0f88, "VTech Holdings, Ltd" }, + { 0x0f8b, "Yazaki Corp." }, + { 0x0f8c, "Young Generation International Corp." }, + { 0x0f8d, "Uniwill Computer Corp." }, + { 0x0f8e, "Kingnet Technology Co., Ltd" }, + { 0x0f8f, "Soma Networks" }, + { 0x0f97, "CviLux Corp." }, + { 0x0f98, "CyberBank Corp." }, + { 0x0f9c, "Hyun Won, Inc." }, + { 0x0f9e, "Lucent Technologies" }, + { 0x0fa3, "Starconn Electronic Co., Ltd" }, + { 0x0fa4, "ATL Technology" }, + { 0x0fa5, "Sotec Co., Ltd" }, + { 0x0fa7, "Epox Computer Co., Ltd" }, + { 0x0fa8, "Logic Controls, Inc." }, + { 0x0faf, "Winpoint Electronic Corp." }, + { 0x0fb0, "Haurtian Wire & Cable Co., Ltd" }, + { 0x0fb1, "Inclose Design, Inc." }, + { 0x0fb2, "Juan-Chern Industrial Co., Ltd" }, + { 0x0fb8, "Wistron Corp." }, + { 0x0fb9, "AACom Corp." }, + { 0x0fba, "San Shing Electronics Co., Ltd" }, + { 0x0fbb, "Bitwise Systems, Inc." }, + { 0x0fc1, "Mitac Internatinal Corp." }, + { 0x0fc2, "Plug and Jack Industrial, Inc." }, + { 0x0fc5, "Delcom Engineering" }, + { 0x0fc6, "Dataplus Supplies, Inc." }, + { 0x0fca, "Research In Motion, Ltd." }, + { 0x0fce, "Sony Ericsson Mobile Communications AB" }, + { 0x0fcf, "Dynastream Innovations, Inc." }, + { 0x0fd0, "Tulip Computers B.V." }, + { 0x0fd1, "Giant Electronics Ltd." }, + { 0x0fd4, "Tenovis GmbH & Co., KG" }, + { 0x0fd5, "Direct Access Technology, Inc." }, + { 0x0fdc, "Micro Plus" }, + { 0x0fe4, "IN-Tech Electronics, Ltd" }, + { 0x0fe5, "Greenconn (U.S.A.), Inc." }, + { 0x0fe6, "Kontron (Industrial Computer Source / ICS Advent)" }, + { 0x0fe9, "DVICO" }, + { 0x0fea, "United Computer Accessories" }, + { 0x0feb, "CRS Electronic Co., Ltd" }, + { 0x0fec, "UMC Electronics Co., Ltd" }, + { 0x0fed, "Access Co., Ltd" }, + { 0x0fee, "Xsido Corp." }, + { 0x0fef, "MJ Research, Inc." }, + { 0x0ff6, "Core Valley Co., Ltd" }, + { 0x0ff7, "CHI SHING Computer Accessories Co., Ltd" }, + { 0x0fff, "Aopen, Inc." }, + { 0x1000, "Speed Tech Corp." }, + { 0x1001, "Ritronics Components (S) Pte., Ltd" }, + { 0x1003, "Sigma Corp." }, + { 0x1004, "LG Electronics, Inc." }, + { 0x1005, "Apacer Technology, Inc." }, + { 0x1006, "iRiver, Ltd." }, + { 0x1009, "Emuzed, Inc." }, + { 0x100a, "AV Chaseway, Ltd" }, + { 0x100b, "Chou Chin Industrial Co., Ltd" }, + { 0x100d, "Netopia, Inc." }, + { 0x1010, "Fukuda Denshi Co., Ltd" }, + { 0x1011, "Mobile Media Tech." }, + { 0x1012, "SDKM Fibres, Wires & Cables Berhad" }, + { 0x1013, "TST-Touchless Sensor Technology AG" }, + { 0x1014, "Densitron Technologies PLC" }, + { 0x1015, "Softronics Pty., Ltd" }, + { 0x1016, "Xiamen Hung's Enterprise Co., Ltd" }, + { 0x1017, "Speedy Industrial Supplies, Pte., Ltd" }, + { 0x1019, "Elitegroup Computer Systems (ECS)" }, + { 0x1020, "Labtec" }, + { 0x1022, "Shinko Shoji Co., Ltd" }, + { 0x1025, "Hyper-Paltek" }, + { 0x1026, "Newly Corp." }, + { 0x1027, "Time Domain" }, + { 0x1028, "Inovys Corp." }, + { 0x1029, "Atlantic Coast Telesys" }, + { 0x102a, "Ramos Technology Co., Ltd" }, + { 0x102b, "Infotronic America, Inc." }, + { 0x102c, "Etoms Electronics Corp." }, + { 0x102d, "Winic Corp." }, + { 0x1031, "Comax Technology, Inc." }, + { 0x1032, "C-One Technology Corp." }, + { 0x1033, "Nucam Corp." }, + { 0x1038, "Ideazon, Inc." }, + { 0x1039, "devolo AG" }, + { 0x103d, "Stanton" }, + { 0x1043, "iCreate Technologies Corp." }, + { 0x1044, "Chu Yuen Enterprise Co., Ltd" }, + { 0x1046, "Winbond Electronics Corp. [hex]" }, + { 0x1048, "Targus Group International" }, + { 0x104c, "AMCO TEC International, Inc." }, + { 0x104d, "Newport Corporation" }, + { 0x104f, "WB Electronics" }, + { 0x1050, "Yubico.com" }, + { 0x1053, "Immanuel Electronics Co., Ltd" }, + { 0x1054, "BMS International Beheer N.V." }, + { 0x1055, "Complex Micro Interconnection Co., Ltd" }, + { 0x1056, "Hsin Chen Ent Co., Ltd" }, + { 0x1057, "ON Semiconductor" }, + { 0x1058, "Western Digital Technologies, Inc." }, + { 0x1059, "Giesecke & Devrient GmbH" }, + { 0x105c, "Hong Ji Electric Wire & Cable (Dongguan) Co., Ltd" }, + { 0x105d, "Delkin Devices, Inc." }, + { 0x105e, "Valence Semiconductor Design, Ltd" }, + { 0x105f, "Chin Shong Enterprise Co., Ltd" }, + { 0x1060, "Easthome Industrial Co., Ltd" }, + { 0x1063, "Motorola Electronics Taiwan, Ltd [hex]" }, + { 0x1065, "CCYU Technology" }, + { 0x106a, "Loyal Legend, Ltd" }, + { 0x106c, "Curitel Communications, Inc." }, + { 0x106d, "San Chieh Manufacturing, Ltd" }, + { 0x106e, "ConectL" }, + { 0x106f, "Money Controls" }, + { 0x1076, "GCT Semiconductor, Inc." }, + { 0x107b, "Gateway, Inc." }, + { 0x107d, "Arlec Australia, Ltd" }, + { 0x107e, "Midoriya Electric Co., Ltd" }, + { 0x107f, "KidzMouse, Inc." }, + { 0x1082, "Shin-Etsukaken Co., Ltd" }, + { 0x1083, "Canon Electronics, Inc." }, + { 0x1084, "Pantech Co., Ltd" }, + { 0x108a, "Chloride Power Protection" }, + { 0x108b, "Grand-tek Technology Co., Ltd" }, + { 0x108c, "Robert Bosch GmbH" }, + { 0x108e, "Lotes Co., Ltd." }, + { 0x1099, "Surface Optics Corp." }, + { 0x109a, "DATASOFT Systems GmbH" }, + { 0x109f, "eSOL Co., Ltd" }, + { 0x10a0, "Hirotech, Inc." }, + { 0x10a3, "Mitsubishi Materials Corp." }, + { 0x10a9, "SK Teletech Co., Ltd" }, + { 0x10aa, "Cables To Go" }, + { 0x10ab, "USI Co., Ltd" }, + { 0x10ac, "Honeywell, Inc." }, + { 0x10ae, "Princeton Technology Corp." }, + { 0x10af, "Liebert Corp." }, + { 0x10b5, "Comodo (PLX?)" }, + { 0x10b8, "DiBcom" }, + { 0x10bb, "TM Technology, Inc." }, + { 0x10bc, "Dinging Technology Co., Ltd" }, + { 0x10bd, "TMT Technology, Inc." }, + { 0x10bf, "SmartHome" }, + { 0x10c4, "Cygnal Integrated Products, Inc." }, + { 0x10c5, "Sanei Electric, Inc." }, + { 0x10c6, "Intec, Inc." }, + { 0x10cb, "Eratech" }, + { 0x10cc, "GBM Connector Co., Ltd" }, + { 0x10cd, "Kycon, Inc." }, + { 0x10ce, "Silicon Labs" }, + { 0x10cf, "Velleman Components, Inc." }, + { 0x10d1, "Hottinger Baldwin Measurement" }, + { 0x10d4, "Man Boon Manufactory, Ltd" }, + { 0x10d5, "Uni Class Technology Co., Ltd" }, + { 0x10d6, "Actions Semiconductor Co., Ltd" }, + { 0x10de, "Authenex, Inc." }, + { 0x10df, "In-Win Development, Inc." }, + { 0x10e0, "Post-Op Video, Inc." }, + { 0x10e1, "CablePlus, Ltd" }, + { 0x10e2, "Nada Electronics, Ltd" }, + { 0x10ec, "Vast Technologies, Inc." }, + { 0x10f0, "Nexio Co., Ltd" }, + { 0x10f1, "Importek" }, + { 0x10f5, "Turtle Beach" }, + { 0x10fb, "Pictos Technologies, Inc." }, + { 0x10fd, "Anubis Electronics, Ltd" }, + { 0x1100, "VirTouch, Ltd" }, + { 0x1101, "EasyPass Industrial Co., Ltd" }, + { 0x1108, "Brightcom Technologies, Ltd" }, + { 0x110a, "Moxa Technologies Co., Ltd." }, + { 0x1110, "Analog Devices Canada, Ltd (Allied Telesyn)" }, + { 0x1111, "Pandora International Ltd." }, + { 0x1112, "YM ELECTRIC CO., Ltd" }, + { 0x1113, "Medion AG" }, + { 0x111e, "VSO Electric Co., Ltd" }, + { 0x112a, "RedRat" }, + { 0x112e, "Master Hill Electric Wire and Cable Co., Ltd" }, + { 0x112f, "Cellon International, Inc." }, + { 0x1130, "Tenx Technology, Inc." }, + { 0x1131, "Integrated System Solution Corp." }, + { 0x1132, "Toshiba Corp., Digital Media Equipment [hex]" }, + { 0x1136, "CTS Electronincs" }, + { 0x113c, "Arin Tech Co., Ltd" }, + { 0x113d, "Mapower Electronics Co., Ltd" }, + { 0x1141, "V One Multimedia, Pte., Ltd" }, + { 0x1142, "CyberScan Technologies, Inc." }, + { 0x1145, "Japan Radio Company" }, + { 0x1146, "Shimane SANYO Electric Co., Ltd." }, + { 0x1147, "Ever Great Electric Wire and Cable Co., Ltd" }, + { 0x114b, "Sphairon Access Systems GmbH" }, + { 0x114c, "Tinius Olsen Testing Machine Co., Inc." }, + { 0x114d, "Alpha Imaging Technology Corp." }, + { 0x114f, "Wavecom" }, + { 0x115b, "Salix Technology Co., Ltd." }, + { 0x1162, "Secugen Corp." }, + { 0x1163, "DeLorme Publishing, Inc." }, + { 0x1164, "YUAN High-Tech Development Co., Ltd" }, + { 0x1165, "Telson Electronics Co., Ltd" }, + { 0x1166, "Bantam Interactive Technologies" }, + { 0x1167, "Salient Systems Corp." }, + { 0x1168, "BizConn International Corp." }, + { 0x116e, "Gigastorage Corp." }, + { 0x116f, "Silicon 10 Technology Corp." }, + { 0x1175, "Shengyih Steel Mold Co., Ltd" }, + { 0x117d, "Santa Electronic, Inc." }, + { 0x117e, "JNC, Inc." }, + { 0x1182, "Venture Corp., Ltd" }, + { 0x1183, "Compaq Computer Corp. [hex] (Digital Dream ?)" }, + { 0x1184, "Kyocera Elco Corp." }, + { 0x1188, "Bloomberg L.P." }, + { 0x1189, "Acer Communications & Multimedia" }, + { 0x118f, "You Yang Technology Co., Ltd" }, + { 0x1190, "Tripace" }, + { 0x1191, "Loyalty Founder Enterprise Co., Ltd" }, + { 0x1196, "Yankee Robotics, LLC" }, + { 0x1197, "Technoimagia Co., Ltd" }, + { 0x1198, "StarShine Technology Corp." }, + { 0x1199, "Sierra Wireless, Inc." }, + { 0x119a, "ZHAN QI Technology Co., Ltd" }, + { 0x119b, "ruwido austria GmbH" }, + { 0x11a0, "Chipcon AS" }, + { 0x11a3, "Technovas Co., Ltd" }, + { 0x11aa, "GlobalMedia Group, LLC" }, + { 0x11ab, "Exito Electronics Co., Ltd" }, + { 0x11b0, "ATECH FLASH TECHNOLOGY" }, + { 0x11c5, "Inmax" }, + { 0x11db, "Topfield Co., Ltd." }, + { 0x11e6, "K.I. Technology Co. Ltd." }, + { 0x11f5, "Siemens AG (?)" }, + { 0x11f6, "Prolific" }, + { 0x11f7, "Alcatel (?)" }, + { 0x1209, "InterBiometrics" }, + { 0x120e, "Hudson Soft Co., Ltd" }, + { 0x120f, "Magellan" }, + { 0x1210, "DigiTech" }, + { 0x121e, "Jungsoft Co., Ltd" }, + { 0x1223, "SKYCABLE ENTERPRISE. CO., LTD." }, + { 0x1230, "Chipidea-Microelectronica, S.A." }, + { 0x1235, "Novation EMS" }, + { 0x1241, "Belkin" }, + { 0x124a, "AirVast" }, + { 0x124b, "Nyko (Honey Bee)" }, + { 0x124c, "MXI - Memory Experts International, Inc." }, + { 0x125c, "Apogee Inc." }, + { 0x125f, "A-DATA Technology Co., Ltd." }, + { 0x1260, "Standard Microsystems Corp." }, + { 0x1264, "Covidien Energy-based Devices" }, + { 0x1266, "Pirelli Broadband Solutions" }, + { 0x1267, "Logic3 / SpectraVideo plc" }, + { 0x126c, "Aristocrat Technologies" }, + { 0x126d, "Bel Stewart" }, + { 0x126e, "Strobe Data, Inc." }, + { 0x126f, "TwinMOS" }, + { 0x1275, "Xaxero Marine Software Engineering, Ltd." }, + { 0x1283, "zebris Medical GmbH" }, + { 0x1286, "Marvell Semiconductor, Inc." }, + { 0x1291, "Qualcomm Flarion Technologies, Inc. / Leadtek Research, Inc." }, + { 0x1292, "Innomedia" }, + { 0x1293, "Belkin Components [hex]" }, + { 0x1294, "RISO KAGAKU CORP." }, + { 0x129b, "CyberTAN Technology" }, + { 0x12a7, "Trendchip Technologies Corp." }, + { 0x12ab, "Honey Bee Electronic International Ltd." }, + { 0x12b8, "Zhejiang Xinya Electronic Technology Co., Ltd." }, + { 0x12ba, "Licensed by Sony Computer Entertainment America" }, + { 0x12c4, "Autocue Group Ltd" }, + { 0x12d1, "Huawei Technologies Co., Ltd." }, + { 0x12d2, "LINE TECH INDUSTRIAL CO., LTD." }, + { 0x12d6, "EMS Dr. Thomas Wuensche" }, + { 0x12d7, "BETTER WIRE FACTORY CO., LTD." }, + { 0x12e6, "Waldorf Music GmbH" }, + { 0x12ef, "Tapwave, Inc." }, + { 0x12f5, "Dynamic System Electronics Corp." }, + { 0x12f7, "Memorex Products, Inc." }, + { 0x12fd, "AIN Comm. Technology Co., Ltd" }, + { 0x12ff, "Fascinating Electronics, Inc." }, + { 0x1307, "Transcend Information, Inc." }, + { 0x1308, "Shuttle, Inc." }, + { 0x1310, "Roper" }, + { 0x1312, "ICS Electronics" }, + { 0x131d, "Natural Point" }, + { 0x132b, "Konica Minolta" }, + { 0x1342, "Mobility" }, + { 0x1345, "Sino Lite Technology Corp." }, + { 0x1347, "Moravian Instruments" }, + { 0x1348, "Katsuragawa Electric Co., Ltd." }, + { 0x134c, "PanJit International Inc." }, + { 0x134e, "Digby's Bitpile, Inc. DBA D Bit" }, + { 0x1357, "P&E Microcomputer Systems" }, + { 0x1366, "SEGGER" }, + { 0x136b, "STEC" }, + { 0x1370, "Swissbit" }, + { 0x1371, "CNet Technology Inc." }, + { 0x1376, "Vimtron Electronics Co., Ltd." }, + { 0x137b, "SCAPS GmbH" }, + { 0x1385, "Netgear, Inc" }, + { 0x138a, "DigitalPersona, Inc" }, + { 0x138e, "Jungo LTD" }, + { 0x1390, "TOMTOM B.V." }, + { 0x1391, "IdealTEK, Inc." }, + { 0x1395, "Sennheiser Communications" }, + { 0x1397, "BEHRINGER International GmbH" }, + { 0x1398, "Q-tec" }, + { 0x13ad, "Baltech" }, + { 0x13b0, "PerkinElmer Optoelectronics" }, + { 0x13b1, "Linksys" }, + { 0x13b3, "Nippon Dics Co., Ltd." }, + { 0x13ba, "Unknown" }, + { 0x13be, "Ricoh Printing Systems, Ltd." }, + { 0x13ca, "JyeTai Precision Industrial Co., Ltd." }, + { 0x13cf, "Wisair Ltd." }, + { 0x13d0, "Techsan Electronics Co., Ltd." }, + { 0x13d1, "A-Max Technology Macao Commercial Offshore Co. Ltd." }, + { 0x13d2, "Shark Multimedia" }, + { 0x13d3, "IMC Networks" }, + { 0x13dc, "ALEREON, INC." }, + { 0x13dd, "i.Tech Dynamic Limited" }, + { 0x13e1, "Kaibo Wire & Cable (Shenzhen) Co., Ltd." }, + { 0x13e5, "Rane" }, + { 0x13e6, "TechnoScope Co., Ltd." }, + { 0x13ec, "Zydacron" }, + { 0x13fd, "Initio Corporation" }, + { 0x13fe, "Kingston Technology Company Inc." }, + { 0x1400, "Axxion Group Corp." }, + { 0x1402, "Bowe Bell & Howell" }, + { 0x1403, "Sitronix" }, + { 0x140e, "Telechips, Inc." }, + { 0x1410, "Novatel Wireless" }, + { 0x1415, "Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc." }, + { 0x1419, "ABILITY ENTERPRISE CO., LTD." }, + { 0x1429, "Vega Technologies Industrial (Austria) Co." }, + { 0x142a, "Thales E-Transactions" }, + { 0x142b, "Arbiter Systems, Inc." }, + { 0x1430, "RedOctane" }, + { 0x1431, "Pertech Resources, Inc." }, + { 0x1435, "Wistron NeWeb" }, + { 0x1436, "Denali Software, Inc." }, + { 0x143c, "Altek Corporation" }, + { 0x1443, "Digilent" }, + { 0x1453, "Radio Shack" }, + { 0x1456, "Extending Wire & Cable Co., Ltd." }, + { 0x1457, "First International Computer, Inc." }, + { 0x145f, "Trust" }, + { 0x1460, "Tatung Co." }, + { 0x1461, "Staccato Communications" }, + { 0x1462, "Micro Star International" }, + { 0x1472, "Huawei-3Com" }, + { 0x147a, "Formosa Industrial Computing, Inc." }, + { 0x147e, "Upek" }, + { 0x147f, "Hama GmbH & Co., KG" }, + { 0x1484, "Elsa AG [hex]" }, + { 0x1485, "Silicom" }, + { 0x1487, "DSP Group, Ltd." }, + { 0x148e, "EVATRONIX SA" }, + { 0x148f, "Ralink Technology, Corp." }, + { 0x1497, "Panstrong Company Ltd." }, + { 0x1498, "Microtek International Inc." }, + { 0x149a, "Imagination Technologies" }, + { 0x14aa, "WideView Technology Inc." }, + { 0x14ad, "CTK Corporation" }, + { 0x14ae, "Printronix Inc." }, + { 0x14af, "ATP Electronics Inc." }, + { 0x14b0, "StarTech.com Ltd." }, + { 0x14b2, "Ralink Technology, Corp." }, + { 0x14c0, "Rockwell Automation, Inc." }, + { 0x14c2, "Gemlight Computer, Ltd" }, + { 0x14cd, "Super Top" }, + { 0x14d8, "JAMER INDUSTRIES CO., LTD." }, + { 0x14dd, "Raritan Computer, Inc." }, + { 0x14e1, "Dialogue Technology Corp." }, + { 0x14e5, "SAIN Information & Communications Co., Ltd." }, + { 0x14ea, "Planex Communications" }, + { 0x14ed, "Shure Inc." }, + { 0x14f7, "TechniSat Digital GmbH" }, + { 0x1500, "Ellisys" }, + { 0x1501, "Pine-Tum Enterprise Co., Ltd." }, + { 0x1509, "First International Computer, Inc." }, + { 0x1513, "Hypercom" }, + { 0x1514, "Actel" }, + { 0x1516, "CompUSA" }, + { 0x1518, "Cheshire Engineering Corp." }, + { 0x1520, "Bitwire Corp." }, + { 0x1524, "ENE Technology Inc" }, + { 0x1527, "Silicon Portals" }, + { 0x1529, "UBIQUAM Co., Ltd." }, + { 0x152d, "JMicron Technology Corp. / JMicron USA Technology Corp." }, + { 0x152e, "LG (HLDS)" }, + { 0x1532, "Razer USA, Ltd" }, + { 0x1546, "U-Blox AG" }, + { 0x154a, "Celectronic GmbH" }, + { 0x154b, "PNY" }, + { 0x154d, "ConnectCounty Holdings Berhad" }, + { 0x154e, "D&M Holdings, Inc. (Denon/Marantz)" }, + { 0x1554, "Prolink Microsystems Corp." }, + { 0x1557, "OQO" }, + { 0x1568, "Sunf Pu Technology Co., Ltd" }, + { 0x156f, "Quantum Corporation" }, + { 0x1570, "ALLTOP TECHNOLOGY CO., LTD." }, + { 0x157b, "Ketron SRL" }, + { 0x157e, "TRENDnet" }, + { 0x1582, "Fiberline" }, + { 0x1587, "SMA Technologie AG" }, + { 0x158d, "Oakley Inc." }, + { 0x158e, "JDS Uniphase Corporation (JDSU)" }, + { 0x1598, "Kunshan Guoji Electronics Co., Ltd." }, + { 0x15a2, "Freescale Semiconductor, Inc." }, + { 0x15a4, "Afatech Technologies, Inc." }, + { 0x15a8, "Teams Power Limited" }, + { 0x15a9, "Gemtek" }, + { 0x15aa, "Gearway Electronics (Dong Guan) Co., Ltd." }, + { 0x15ba, "Olimex Ltd." }, + { 0x15c0, "XL Imaging" }, + { 0x15c2, "SoundGraph Inc." }, + { 0x15c5, "Advance Multimedia Internet Technology Inc. (AMIT)" }, + { 0x15c6, "Laboratoires MXM" }, + { 0x15c8, "KTF Technologies" }, + { 0x15c9, "D-Box Technologies" }, + { 0x15ca, "Textech International Ltd." }, + { 0x15d5, "Coulomb Electronics Ltd." }, + { 0x15d9, "Trust International B.V." }, + { 0x15dc, "Hynix Semiconductor Inc." }, + { 0x15e0, "Seong Ji Industrial Co., Ltd." }, + { 0x15e1, "RSA" }, + { 0x15e8, "SohoWare" }, + { 0x15e9, "Pacific Digital Corp." }, + { 0x15ec, "Belcarra Technologies Corp." }, + { 0x15f4, "HanfTek" }, + { 0x1604, "Tascam" }, + { 0x1606, "Umax" }, + { 0x1608, "Inside Out Networks [hex]" }, + { 0x160a, "VIA Technologies, Inc." }, + { 0x1614, "Amoi Electronics" }, + { 0x1619, "L & K Precision Technology Co., Ltd." }, + { 0x1621, "Wionics Research" }, + { 0x1628, "Stonestreet One, Inc." }, + { 0x162a, "Airgo Networks Inc." }, + { 0x162f, "WiQuest Communications, Inc." }, + { 0x1630, "2Wire, Inc." }, + { 0x1631, "Good Way Technology" }, + { 0x1645, "Entrega [hex]" }, + { 0x1649, "SofTec Microsystems" }, + { 0x164a, "ChipX" }, + { 0x164c, "Matrix Vision GmbH" }, + { 0x1657, "Struck Innovative Systeme GmbH" }, + { 0x165b, "Frontier Design Group" }, + { 0x1660, "Creatix Polymedia GmbH" }, + { 0x1668, "Actiontec Electronics, Inc. [hex]" }, + { 0x1669, "PiKRON Ltd. [hex]" }, + { 0x1677, "China Huada Integrated Circuit Design (Group) Co., Ltd. (CIDC Group)" }, + { 0x1679, "Total Phase" }, + { 0x1680, "Golden Bridge Electech Inc." }, + { 0x1681, "Prevo Technologies, Inc." }, + { 0x1682, "Maxwise Production Enterprise Ltd." }, + { 0x1684, "Godspeed Computer Corp." }, + { 0x1685, "Delock" }, + { 0x1686, "ZOOM Corporation" }, + { 0x1687, "Kingmax Digital Inc." }, + { 0x1688, "Saab AB" }, + { 0x168c, "Atheros Communications" }, + { 0x1690, "Askey Computer Corp. [hex]" }, + { 0x1696, "Hitachi Video and Information System, Inc." }, + { 0x1697, "VTec Test, Inc." }, + { 0x16a5, "Shenzhen Zhengerya Cable Co., Ltd." }, + { 0x16a6, "Unigraf" }, + { 0x16ab, "Global Sun Technology" }, + { 0x16ac, "Dongguan ChingLung Wire & Cable Co., Ltd." }, + { 0x16b4, "iStation" }, + { 0x16b5, "Persentec, Inc." }, + { 0x16c0, "VOTI" }, + { 0x16ca, "Wireless Cables, Inc." }, + { 0x16cc, "silex technology, Inc." }, + { 0x16d3, "Frontline Test Equipment, Inc." }, + { 0x16d5, "AnyDATA Corporation" }, + { 0x16d6, "JABLOCOM s.r.o." }, + { 0x16d8, "CMOTECH Co., Ltd." }, + { 0x16dc, "Wiener, Plein & Baus" }, + { 0x16df, "King Billion Electronics Co., Ltd." }, + { 0x16f5, "Futurelogic Inc." }, + { 0x1706, "BlueView Technologies, Inc." }, + { 0x1707, "ARTIMI" }, + { 0x170b, "Swissonic" }, + { 0x170d, "Avnera" }, + { 0x1726, "Axesstel, Inc." }, + { 0x172f, "Waltop International Corp." }, + { 0x1733, "Cellink Technology Co., Ltd" }, + { 0x1736, "CANON IMAGING SYSTEM TECHNOLOGIES INC." }, + { 0x1737, "Linksys" }, + { 0x1740, "Senao" }, + { 0x1743, "General Atomics" }, + { 0x174c, "ASMedia Technology Inc." }, + { 0x174f, "Syntek" }, + { 0x1753, "GERTEC Telecomunicacoes Ltda." }, + { 0x1759, "LucidPort Technology, Inc." }, + { 0x1761, "ASUSTek Computer, Inc. (wrong ID)" }, + { 0x1772, "System Level Solutions, Inc." }, + { 0x1776, "Arowana" }, + { 0x177f, "Sweex" }, + { 0x1781, "Multiple Vendors" }, + { 0x1782, "Spreadtrum Communications Inc." }, + { 0x1784, "TopSeed Technology Corp." }, + { 0x1788, "ShenZhen Litkconn Technology Co., Ltd." }, + { 0x1796, "Printrex, Inc." }, + { 0x1797, "JALCO CO., LTD." }, + { 0x1799, "Belkin Components" }, + { 0x179d, "Ricavision International, Inc." }, + { 0x17a0, "Samson Technologies Corp." }, + { 0x17a4, "Concept2" }, + { 0x17a5, "Advanced Connection Technology Inc." }, + { 0x17a7, "MICOMSOFT CO., LTD." }, + { 0x17b3, "Grey Innovation" }, + { 0x17c3, "Singim International Corp." }, + { 0x17cc, "Native Instruments" }, + { 0x17cf, "Hip Hing Cable & Plug Mfy. Ltd." }, + { 0x17d0, "Sanford L.P." }, + { 0x17d3, "Korea Techtron Co., Ltd." }, + { 0x17e9, "Newnham Research" }, + { 0x17eb, "Cornice, Inc." }, + { 0x17ef, "Lenovo" }, + { 0x17f5, "K.K. Rocky" }, + { 0x17f6, "Unicomp, Inc" }, + { 0x1809, "Advantech" }, + { 0x1822, "Twinhan" }, + { 0x1831, "Gwo Jinn Industries Co., Ltd." }, + { 0x1832, "Huizhou Shenghua Industrial Co., Ltd." }, + { 0x183d, "VIVOphone" }, + { 0x1843, "Vaisala" }, + { 0x1854, "Memory Devices Ltd." }, + { 0x185b, "Compro" }, + { 0x1861, "Tech Technology Industrial Company" }, + { 0x1862, "Teridian Semiconductor Corp." }, + { 0x1870, "Nexio Co., Ltd" }, + { 0x1871, "Aveo Technology Corp." }, + { 0x187c, "Alienware Corporation" }, + { 0x187f, "Siano Mobile Silicon" }, + { 0x1894, "Topseed" }, + { 0x1897, "Evertop Wire Cable Co." }, + { 0x18a5, "Verbatim, Ltd" }, + { 0x18b1, "Petalynx" }, + { 0x18b4, "e3C Technologies" }, + { 0x18b6, "Mikkon Technology Limited" }, + { 0x18b7, "Zotek Electronic Co., Ltd." }, + { 0x18c5, "AMIT Technology, Inc." }, + { 0x18cd, "Ecamm" }, + { 0x18d1, "Google Inc." }, + { 0x18d5, "Starline International Group Limited" }, + { 0x18d9, "Kaba" }, + { 0x18dd, "Planon System Solutions Inc." }, + { 0x18e3, "Fitipower Integrated Technology Inc" }, + { 0x18e8, "Qcom" }, + { 0x18ea, "Matrox Graphics, Inc." }, + { 0x18ec, "Arkmicro Technologies Inc." }, + { 0x18fd, "FineArch Inc." }, + { 0x190d, "Motorola GSG" }, + { 0x1914, "Alco Digital Devices Limited" }, + { 0x1915, "Nordic Semiconductor ASA" }, + { 0x1926, "NextWindow" }, + { 0x192f, "Avago Technologies, Pte." }, + { 0x1930, "Shenzhen Xianhe Technology Co., Ltd." }, + { 0x1931, "Ningbo Broad Telecommunication Co., Ltd." }, + { 0x1934, "Feature Integration Technology Inc. (Fintek)" }, + { 0x1941, "Dream Link" }, + { 0x1943, "Sensoray Co., Inc." }, + { 0x1949, "Lab126" }, + { 0x1951, "Hyperstone AG" }, + { 0x1953, "Ironkey Inc." }, + { 0x1954, "Radiient Technologies" }, + { 0x195d, "Itron Technology iONE" }, + { 0x1967, "CASIO HITACHI Mobile Communications Co., Ltd." }, + { 0x196b, "Wispro Technology Inc." }, + { 0x1970, "Dane-Elec Corp. USA" }, + { 0x1975, "Dongguan Guneetal Wire & Cable Co., Ltd." }, + { 0x1976, "Chipsbrand Microelectronics (HK) Co., Ltd." }, + { 0x1977, "T-Logic" }, + { 0x1989, "Nuconn Technology Corp." }, + { 0x198f, "Beceem Communications Inc." }, + { 0x1990, "Acron Precision Industrial Co., Ltd." }, + { 0x1995, "Trillium Technology Pty. Ltd." }, + { 0x199e, "The Imaging Source Europe GmbH" }, + { 0x199f, "Benica Corporation" }, + { 0x19a8, "Biforst Technology Inc." }, + { 0x19ab, "Bodelin" }, + { 0x19af, "S Life" }, + { 0x19b4, "Celestron" }, + { 0x19b5, "B & W Group" }, + { 0x19b6, "Infotech Logistic, LLC" }, + { 0x19b9, "Data Robotics" }, + { 0x19ca, "Mindtribe" }, + { 0x19cf, "Parrot SA" }, + { 0x19d2, "ONDA Communication S.p.A." }, + { 0x19e1, "WeiDuan Electronic Accessory (S.Z.) Co., Ltd." }, + { 0x19e8, "Industrial Technology Research Institute" }, + { 0x19ef, "Pak Heng Technology (Shenzhen) Co., Ltd." }, + { 0x19f7, "RODE Microphones" }, + { 0x19fa, "Gampaq Co.Ltd" }, + { 0x19ff, "Dynex" }, + { 0x1a08, "Bellwood International, Inc." }, + { 0x1a0a, "USB-IF non-workshop" }, + { 0x1a12, "KES Co., Ltd." }, + { 0x1a25, "Amphenol East Asia Ltd." }, + { 0x1a2a, "Seagate Branded Solutions" }, + { 0x1a32, "Quanta Microsystems, Inc." }, + { 0x1a36, "Biwin Technology Ltd." }, + { 0x1a40, "TERMINUS TECHNOLOGY INC." }, + { 0x1a41, "Action Electronics Co., Ltd." }, + { 0x1a44, "VASCO Data Security International" }, + { 0x1a4a, "Silicon Image" }, + { 0x1a4b, "SafeBoot International B.V." }, + { 0x1a61, "Abbott Diabetes Care" }, + { 0x1a6a, "Spansion Inc." }, + { 0x1a6d, "SamYoung Electronics Co., Ltd" }, + { 0x1a6e, "Global Unichip Corp." }, + { 0x1a6f, "Sagem Orga GmbH" }, + { 0x1a79, "Bayer Health Care LLC" }, + { 0x1a7b, "Lumberg Connect GmbH & Co. KG" }, + { 0x1a7c, "Kingsis Peripherals" }, + { 0x1a86, "QinHeng Electronics" }, + { 0x1a89, "Dynalith Systems Co., Ltd." }, + { 0x1a8b, "SGS Taiwan Ltd." }, + { 0x1a98, "Leica Camera AG" }, + { 0x1aa4, "Data Drive Thru, Inc." }, + { 0x1aa5, "UBeacon Technologies, Inc." }, + { 0x1aa6, "eFortune Technology Corp." }, + { 0x1acb, "Salcomp Plc" }, + { 0x1ad1, "Desay Wire Co., Ltd." }, + { 0x1ae4, "ic-design Reinhard Gottinger GmbH" }, + { 0x1ae7, "X-TENSIONS" }, + { 0x1aed, "High Top Precision Electronic Co., Ltd." }, + { 0x1aef, "Conntech Electronic (Suzhou) Corporation" }, + { 0x1b04, "Meilhaus Electronic GmBH" }, + { 0x1b20, "MStar Semiconductor, Inc." }, + { 0x1b22, "WiLinx Corp." }, + { 0x1b26, "Cellex Power Products, Inc." }, + { 0x1b27, "Current Electronics Inc." }, + { 0x1b28, "NAVIsis Inc." }, + { 0x1b32, "Ugobe Life Forms, Inc." }, + { 0x1b36, "ViXS Systems, Inc." }, + { 0x1b3b, "iPassion Technology Inc." }, + { 0x1b3f, "Generalplus Technology Inc." }, + { 0x1b47, "Energizer Holdings, Inc." }, + { 0x1b48, "Plastron Precision Co., Ltd." }, + { 0x1b59, "K.S. Terminals Inc." }, + { 0x1b5a, "Chao Zhou Kai Yuan Electric Co., Ltd." }, + { 0x1b65, "The Hong Kong Standards and Testing Centre Ltd." }, + { 0x1b72, "ATERGI TECHNOLOGY CO., LTD." }, + { 0x1b75, "Ovislink Corp." }, + { 0x1b76, "Legend Silicon Corp." }, + { 0x1b80, "Afatech" }, + { 0x1b86, "Dongguan Guanshang Electronics Co., Ltd." }, + { 0x1b88, "ShenMing Electron (Dong Guan) Co., Ltd." }, + { 0x1b8c, "Altium Limited" }, + { 0x1b8d, "e-MOVE Technology Co., Ltd." }, + { 0x1b8e, "Amlogic, Inc." }, + { 0x1b8f, "MA LABS, Inc." }, + { 0x1b96, "N-Trig" }, + { 0x1b98, "YMax Communications Corp." }, + { 0x1b99, "Shenzhen Yuanchuan Electronic" }, + { 0x1ba1, "JINQ CHERN ENTERPRISE CO., LTD." }, + { 0x1ba2, "Lite Metals & Plastic (Shenzhen) Co., Ltd." }, + { 0x1ba4, "Ember Corporation" }, + { 0x1ba6, "Abilis Systems" }, + { 0x1ba8, "China Telecommunication Technology Labs" }, + { 0x1bad, "Harmonix Music" }, + { 0x1bae, "Vuzix Corporation" }, + { 0x1bbb, "T & A Mobile Phones" }, + { 0x1bc4, "Ford Motor Co." }, + { 0x1bc5, "AVIXE Technology (China) Ltd." }, + { 0x1bce, "Contac Cable Industrial Limited" }, + { 0x1bcf, "Sunplus Innovation Technology Inc." }, + { 0x1bd0, "Hangzhou Riyue Electronic Co., Ltd." }, + { 0x1bde, "P-TWO INDUSTRIES, INC." }, + { 0x1bef, "Shenzhen Tongyuan Network-Communication Cables Co., Ltd" }, + { 0x1bf0, "RealVision Inc." }, + { 0x1bf5, "Extranet Systems Inc." }, + { 0x1bf6, "Orient Semiconductor Electronics, Ltd." }, + { 0x1bfd, "TouchPack" }, + { 0x1c02, "Kreton Corporation" }, + { 0x1c04, "QNAP System Inc." }, + { 0x1c0d, "Relm Wireless" }, + { 0x1c10, "Lanterra Industrial Co., Ltd." }, + { 0x1c13, "ALECTRONIC LIMITED" }, + { 0x1c1a, "Datel Electronics Ltd." }, + { 0x1c1b, "Volkswagen of America, Inc." }, + { 0x1c1f, "Goldvish S.A." }, + { 0x1c20, "Fuji Electric Device Technology Co., Ltd." }, + { 0x1c21, "ADDMM LLC" }, + { 0x1c22, "ZHONGSHAN CHIANG YU ELECTRIC CO., LTD." }, + { 0x1c26, "Shanghai Haiying Electronics Co., Ltd." }, + { 0x1c27, "HuiYang D & S Cable Co., Ltd." }, + { 0x1c31, "LS Cable Ltd." }, + { 0x1c34, "SpringCard" }, + { 0x1c37, "Authorizer Technologies, Inc." }, + { 0x1c3d, "NONIN MEDICAL INC." }, + { 0x1c3e, "Wep Peripherals" }, + { 0x1c49, "Cherng Weei Technology Corp." }, + { 0x1c4f, "SiGma Micro" }, + { 0x1c6b, "Philips & Lite-ON Digital Solutions Corporation" }, + { 0x1c6c, "Skydigital Inc." }, + { 0x1c73, "AMT" }, + { 0x1c77, "Kaetat Industrial Co., Ltd." }, + { 0x1c78, "Datascope Corp." }, + { 0x1c79, "Unigen Corporation" }, + { 0x1c7a, "LighTuning Technology Inc." }, + { 0x1c7b, "LUXSHARE PRECISION INDUSTRY (SHENZHEN) CO., LTD." }, + { 0x1c87, "2N TELEKOMUNIKACE a.s." }, + { 0x1c88, "Somagic, Inc." }, + { 0x1c89, "HONGKONG WEIDIDA ELECTRON LIMITED" }, + { 0x1c8e, "ASTRON INTERNATIONAL CORP." }, + { 0x1c98, "ALPINE ELECTRONICS, INC." }, + { 0x1ca0, "ACCARIO Inc." }, + { 0x1cac, "Kinstone" }, + { 0x1cb3, "Aces Electronic Co., Ltd." }, + { 0x1cb4, "OPEX CORPORATION" }, + { 0x1cbe, "Luminary Micro Inc." }, + { 0x1cbf, "FORTAT SKYMARK INDUSTRIAL COMPANY" }, + { 0x1cc0, "PlantSense" }, + { 0x1cca, "NextWave Broadband Inc." }, + { 0x1ccd, "Bodatong Technology (Shenzhen) Co., Ltd." }, + { 0x1cd4, "adp corporation" }, + { 0x1cd5, "Firecomms Ltd." }, + { 0x1cd6, "Antonio Precise Products Manufactory Ltd." }, + { 0x1cde, "Telecommunications Technology Association (TTA)" }, + { 0x1cdf, "WonTen Technology Co., Ltd." }, + { 0x1ce0, "EDIMAX TECHNOLOGY CO., LTD." }, + { 0x1ce1, "Amphenol KAE" }, + { 0x1cfc, "ANDES TECHNOLOGY CORPORATION" }, + { 0x1cfd, "Flextronics Digital Design Japan, LTD." }, + { 0x1d07, "Solid-Motion" }, + { 0x1d08, "NINGBO HENTEK DRAGON ELECTRONICS CO., LTD." }, + { 0x1d09, "TechFaith Wireless Technology Limited" }, + { 0x1d0a, "Johnson Controls, Inc. The Automotive Business Unit" }, + { 0x1d0b, "HAN HUA CABLE & WIRE TECHNOLOGY (J.X.) CO., LTD." }, + { 0x1d14, "ALPHA-SAT TECHNOLOGY LIMITED" }, + { 0x1d17, "C-Thru Music Ltd." }, + { 0x1d19, "Dexatek Technology Ltd." }, + { 0x1d1f, "Diostech Co., Ltd." }, + { 0x1d20, "SAMTACK INC." }, + { 0x1d4d, "PEGATRON CORPORATION" }, + { 0x1d50, "OpenMoko, Inc." }, + { 0x1d5b, "Smartronix, Inc." }, + { 0x1d6b, "Linux Foundation" }, + { 0x1e0e, "Qualcomm / Option" }, + { 0x1e10, "Point Grey Research, Inc." }, + { 0x1e1d, "Lumension Security" }, + { 0x1e1f, "INVIA" }, + { 0x1e29, "Festo AG & Co. KG" }, + { 0x1e41, "Cleverscope" }, + { 0x1e54, "TypeMatrix" }, + { 0x1e68, "TrekStor GmbH & Co. KG" }, + { 0x1e71, "NZXT" }, + { 0x1e74, "Coby Electronics Corporation" }, + { 0x1e7d, "ROCCAT" }, + { 0x1ebb, "NuCORE Technology, Inc." }, + { 0x1eda, "AirTies Wireless Networks" }, + { 0x1f28, "Cal-Comp" }, + { 0x1f4d, "G-Tek Electronics Group" }, + { 0x1f82, "TANDBERG" }, + { 0x1f84, "Inverness Medical Innovations, Inc." }, + { 0x1f87, "Stantum" }, + { 0x1fbd, "Delphin Technology AG" }, + { 0x1fe7, "Vertex Wireless Co., Ltd." }, + { 0x2001, "D-Link Corp." }, + { 0x2013, "Unknown (Pinnacle?)" }, + { 0x2019, "PLANEX" }, + { 0x2040, "Hauppauge" }, + { 0x2047, "Texas Instruments" }, + { 0x2087, "Cando" }, + { 0x20b1, "XMOS Ltd" }, + { 0x20df, "Simtec Electronics" }, + { 0x2101, "ActionStar" }, + { 0x2162, "Creative (?)" }, + { 0x21d6, "Agecodagis SARL" }, + { 0x2222, "MacAlly" }, + { 0x2227, "SAMWOO Enterprise" }, + { 0x2233, "RadioShack Corporation" }, + { 0x2237, "Kobo Inc." }, + { 0x22a6, "Pie Digital, Inc." }, + { 0x22b8, "Motorola PCS" }, + { 0x22b9, "eTurboTouch Technology, Inc." }, + { 0x22ba, "Technology Innovation Holdings, Ltd" }, + { 0x2304, "Pinnacle Systems, Inc." }, + { 0x2318, "Shining Technologies, Inc. [hex]" }, + { 0x2375, "Digit@lway, Inc." }, + { 0x2406, "SANHO Digital Electronics Co., Ltd." }, + { 0x2478, "Tripp-Lite" }, + { 0x2632, "TwinMOS" }, + { 0x2650, "Electronics For Imaging, Inc. [hex]" }, + { 0x2730, "Citizen" }, + { 0x2735, "DigitalWay" }, + { 0x2770, "NHJ, Ltd" }, + { 0x2821, "Unknown" }, + { 0x2899, "Toptronic Industrial Co., Ltd" }, + { 0x2c02, "Planex Communications" }, + { 0x2fb2, "Fujitsu, Ltd" }, + { 0x3125, "Eagletron" }, + { 0x3176, "Whanam Electronics Co., Ltd" }, + { 0x3275, "VidzMedia Pte Ltd" }, + { 0x3334, "AEI" }, + { 0x3340, "Yakumo" }, + { 0x3504, "Micro Star" }, + { 0x3538, "Power Quotient International Co., Ltd" }, + { 0x3579, "DIVA" }, + { 0x3636, "InVibro" }, + { 0x3838, "WEM" }, + { 0x3923, "National Instruments Corp." }, + { 0x40bb, "I-O Data" }, + { 0x4101, "i-rocks" }, + { 0x4102, "iRiver, Ltd." }, + { 0x413c, "Dell Computer Corp." }, + { 0x4146, "USBest Technology" }, + { 0x4242, "USB Design by Example" }, + { 0x4317, "Broadcom Corp." }, + { 0x4348, "WinChipHead" }, + { 0x4572, "Shuttle, Inc." }, + { 0x4586, "Panram" }, + { 0x4670, "EMS Production" }, + { 0x4752, "Miditech" }, + { 0x4766, "Aceeca" }, + { 0x4855, "Memorex" }, + { 0x4971, "SimpleTech" }, + { 0x5032, "Grandtec" }, + { 0x5041, "Linksys (?)" }, + { 0x50c2, "Averatec (?)" }, + { 0x5173, "Sweex" }, + { 0x5219, "I-Tetra" }, + { 0x5345, "Owon" }, + { 0x544d, "Transmeta Corp." }, + { 0x5543, "UC-Logic Technology Corp." }, + { 0x5555, "Epiphan Systems Inc." }, + { 0x55aa, "OnSpec Electronic, Inc." }, + { 0x5656, "Uni-Trend Group Limited" }, + { 0x595a, "IRTOUCHSYSTEMS Co. Ltd." }, + { 0x5986, "Acer, Inc" }, + { 0x5a57, "Zinwell" }, + { 0x6189, "Sitecom" }, + { 0x6253, "TwinHan Technology Co., Ltd" }, + { 0x636c, "CoreLogic, Inc." }, + { 0x6472, "Unknown (Sony?)" }, + { 0x6547, "Arkmicro Technologies Inc." }, + { 0x6615, "IRTOUCHSYSTEMS Co. Ltd." }, + { 0x6666, "Prototype product Vendor ID" }, + { 0x6677, "WiseGroup, Ltd." }, + { 0x6891, "3Com" }, + { 0x695c, "Opera1" }, + { 0x6993, "Yealink Network Technology Co., Ltd." }, + { 0x6a75, "Shanghai Jujo Electronics Co., Ltd" }, + { 0x7104, "CME (Central Music Co.)" }, + { 0x726c, "StackFoundry LLC" }, + { 0x734c, "TBS Technologies China" }, + { 0x7392, "Edimax Technology Co., Ltd" }, + { 0x8086, "Intel Corp." }, + { 0x8087, "Intel Corp." }, + { 0x80ee, "VirtualBox" }, + { 0x8282, "Keio" }, + { 0x8341, "EGO Systems, Inc." }, + { 0x9016, "Sitecom" }, + { 0x9022, "TeVii Technology Ltd." }, + { 0x9148, "GeoLab, Ltd" }, + { 0x9710, "MosChip Semiconductor" }, + { 0x99fa, "Grandtec" }, + { 0xa128, "AnMo Electronics Corp. / Dino-Lite (?)" }, + { 0xa168, "AnMo Electronics Corporation" }, + { 0xa600, "Asix" }, + { 0xa727, "3Com" }, + { 0xabcd, "Unknown" }, + { 0xc251, "Keil Software, Inc." }, + { 0xcace, "CACE Technologies Inc." }, + { 0xd209, "Ultimarc" }, + { 0xe4e4, "Xorcom Ltd." }, + { 0xeb03, "MakingThings" }, + { 0xeb1a, "eMPIA Technology, Inc." }, + { 0xeb2a, "KWorld" }, + { 0xf003, "Hewlett Packard" }, +}; + +const char* LIBWDI_API wdi_get_vendor_name(unsigned short vid) +{ + int i; + + for(i=0; i/dev/null || { echo "wget command not found. Aborting." >&2; exit 1; } +type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; } + +# Download the latest version (overwrite previous if newer) +wget -m -nd http://www.linux-usb.org/usb.ids + +# Create the sed command file +cat > cmd.sed <<\_EOF +# Header, part 1 +s^#.*List of USB.*/*\ + * USB vendors, by VID\ + * based on http://www.linux-usb.org/usb.ids by Stephen J. Gowdy\ + *\ + *\ + * This library is free software; you can redistribute it and/or\ + * modify it under the terms of the GNU Lesser General Public\ + * License as published by the Free Software Foundation; either\ + * version 2.1 of the License, or (at your option) any later version.\ + *\ + * This library is distributed in the hope that it will be useful,\ + * but WITHOUT ANY WARRANTY; without even the implied warranty of\ + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\ + * Lesser General Public License for more details.\ + *\ + * You should have received a copy of the GNU Lesser General Public\ + * License along with this library; if not, write to the Free Software\ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\ + */\ +\ +#include \ +#include "libwdi.h"\ +\ +struct vendor_name \{\ + unsigned short vid;\ + const char* name;\ +\};\ +\ +/*\ + * http://www.linux-usb.org/usb.idsp + +# Header part 2, version +s|# Version:| * Version:| +/ \* Version:/p + +# Header Part 3 +s|^#.*Date:.*| \*/\ +struct vendor_name usb_vendor[] = \{|p + +# Footer +$a\ +\};\ +\ +const char* LIBWDI_API wdi_get_vendor_name(unsigned short vid)\ +\{\ + int i;\ +\ + for(i=0; i vid_data.c +rm cmd.sed +echo Done. \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/winusb.inf.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/winusb.inf.in new file mode 100644 index 0000000..6ac9507 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/winusb.inf.in @@ -0,0 +1,91 @@ +; #INF_FILENAME# +; Copyright (c) 2010 libusb (GNU LGPL) +[Strings] +DeviceName = "#DEVICE_DESCRIPTION#" +VendorName = "#DEVICE_MANUFACTURER#" +SourceName = "#DEVICE_DESCRIPTION# Install Disk" +DeviceID = "#DEVICE_HARDWARE_ID#" +DeviceGUID = "#DEVICE_INTERFACE_GUID#" + +[Version] +Signature = "$Windows NT$" +Class = "libusb (WinUSB) devices" +ClassGuid = {78a1c341-4539-11d3-b88d-00c04fad5171} +Provider = "libusb.org" +CatalogFile = #CAT_FILENAME# +DriverVer = #DRIVER_DATE#, #DRIVER_VERSION# + +[ClassInstall32] +Addreg = WinUSBDeviceClassReg + +[WinUSBDeviceClassReg] +HKR,,,0,"libusb (WinUSB) devices" +HKR,,Icon,,-20 + +[Manufacturer] +%VendorName% = libusbDevice_WinUSB,NTx86,NTamd64,NTia64 + +[libusbDevice_WinUSB.NTx86] +%DeviceName% = USB_Install, USB\%DeviceID% + +[libusbDevice_WinUSB.NTamd64] +%DeviceName% = USB_Install, USB\%DeviceID% + +[libusbDevice_WinUSB.NTia64] +%DeviceName% = USB_Install, USB\%DeviceID% + +[USB_Install] +Include = winusb.inf +Needs = WINUSB.NT + +[USB_Install.Services] +Include = winusb.inf +AddService = WinUSB,0x00000002,WinUSB_ServiceInstall + +[WinUSB_ServiceInstall] +DisplayName = "WinUSB - Kernel Driver #DRIVER_DATE# #DRIVER_VERSION#" +ServiceType = 1 +StartType = 3 +ErrorControl = 1 +ServiceBinary = %12%\WinUSB.sys + +[USB_Install.Wdf] +KmdfService = WINUSB, WinUsb_Install + +[WinUSB_Install] +KmdfLibraryVersion = 1.9 + +[USB_Install.HW] +AddReg = Dev_AddReg + +[Dev_AddReg] +HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID% + +[USB_Install.CoInstallers] +AddReg = CoInstallers_AddReg +CopyFiles = CoInstallers_CopyFiles + +[CoInstallers_AddReg] +HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll" + +[CoInstallers_CopyFiles] +WinUSBCoInstaller2.dll +WdfCoInstaller01009.dll + +[DestinationDirs] +CoInstallers_CopyFiles = 11 + +[SourceDisksNames] +1 = %SourceName% + +[SourceDisksFiles.x86] +WinUSBCoInstaller2.dll = 1,x86 +WdfCoInstaller01009.dll = 1,x86 + +[SourceDisksFiles.amd64] +WinUSBCoInstaller2.dll = 1,amd64 +WdfCoInstaller01009.dll = 1,amd64 + +[SourceDisksFiles.ia64] +WinUSBCoInstaller2.dll = 1,ia64 +WdfCoInstaller01009.dll = 1,ia64 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi_2008.sln b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi_2008.sln new file mode 100644 index 0000000..9c5743a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi_2008.sln @@ -0,0 +1,117 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwdi (static)", "libwdi\libwdi_static_2008.vcproj", "{9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}" + ProjectSection(ProjectDependencies) = postProject + {9B1C561E-F95B-4849-A7AA-A4350E227C20} = {9B1C561E-F95B-4849-A7AA-A4350E227C20} + {792D44D5-28A7-4EB3-B84B-8021FE3189F9} = {792D44D5-28A7-4EB3-B84B-8021FE3189F9} + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} = {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "embedder", "libwdi\embedder_2008.vcproj", "{792D44D5-28A7-4EB3-B84B-8021FE3189F9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadic", "examples\zadic_2008.vcproj", "{F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}" + ProjectSection(ProjectDependencies) = postProject + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} = {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} = {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zadig", "examples\zadig_2008.vcproj", "{F7F7842F-2912-454E-ADF5-0B22987946E2}" + ProjectSection(ProjectDependencies) = postProject + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} = {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} + {2945B0AC-AB99-483F-9FDC-CF76613E3034} = {2945B0AC-AB99-483F-9FDC-CF76613E3034} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwdi (dll)", "libwdi\libwdi_dll_2008.vcproj", "{79275348-41A4-4D07-8990-4068C9594A2C}" + ProjectSection(ProjectDependencies) = postProject + {9B1C561E-F95B-4849-A7AA-A4350E227C20} = {9B1C561E-F95B-4849-A7AA-A4350E227C20} + {792D44D5-28A7-4EB3-B84B-8021FE3189F9} = {792D44D5-28A7-4EB3-B84B-8021FE3189F9} + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} = {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer_x86", "libwdi\installer_x86_2008.vcproj", "{9B1C561E-F95B-4849-A7AA-A4350E227C20}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer_x64", "libwdi\installer_x64_2008.vcproj", "{E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "examples\libconfig\libconfig.vcproj", "{2945B0AC-AB99-483F-9FDC-CF76613E3034}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "getopt", "examples\getopt\getopt.vcproj", "{AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Win32.ActiveCfg = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Win32.Build.0 = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|x64.ActiveCfg = Debug|x64 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|x64.Build.0 = Debug|x64 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Win32.ActiveCfg = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Win32.Build.0 = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|x64.ActiveCfg = Release|x64 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|x64.Build.0 = Release|x64 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Win32.Build.0 = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|x64.ActiveCfg = Debug|x64 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|x64.Build.0 = Debug|x64 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Win32.ActiveCfg = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Win32.Build.0 = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|x64.ActiveCfg = Release|x64 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|x64.Build.0 = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.ActiveCfg = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|Win32.Build.0 = Debug|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.ActiveCfg = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Debug|x64.Build.0 = Debug|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.ActiveCfg = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|Win32.Build.0 = Release|Win32 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.ActiveCfg = Release|x64 + {F4938DB0-3DE7-4737-9C5A-EAD1BE819F87}.Release|x64.Build.0 = Release|x64 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Debug|Win32.ActiveCfg = Debug|Win32 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Debug|Win32.Build.0 = Debug|Win32 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Debug|x64.ActiveCfg = Debug|x64 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Debug|x64.Build.0 = Debug|x64 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Release|Win32.ActiveCfg = Release|Win32 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Release|Win32.Build.0 = Release|Win32 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Release|x64.ActiveCfg = Release|x64 + {F7F7842F-2912-454E-ADF5-0B22987946E2}.Release|x64.Build.0 = Release|x64 + {79275348-41A4-4D07-8990-4068C9594A2C}.Debug|Win32.ActiveCfg = Debug|Win32 + {79275348-41A4-4D07-8990-4068C9594A2C}.Debug|x64.ActiveCfg = Debug|x64 + {79275348-41A4-4D07-8990-4068C9594A2C}.Release|Win32.ActiveCfg = Release|Win32 + {79275348-41A4-4D07-8990-4068C9594A2C}.Release|x64.ActiveCfg = Release|x64 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Win32.Build.0 = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|x64.ActiveCfg = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Win32.ActiveCfg = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Win32.Build.0 = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|x64.ActiveCfg = Release|Win32 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Win32.ActiveCfg = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Win32.Build.0 = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|x64.ActiveCfg = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|x64.Build.0 = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|Win32.ActiveCfg = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|Win32.Build.0 = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|x64.ActiveCfg = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|x64.Build.0 = Release|x64 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Debug|Win32.ActiveCfg = Debug|Win32 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Debug|Win32.Build.0 = Debug|Win32 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Debug|x64.ActiveCfg = Debug|x64 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Debug|x64.Build.0 = Debug|x64 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Release|Win32.ActiveCfg = Release|Win32 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Release|Win32.Build.0 = Release|Win32 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Release|x64.ActiveCfg = Release|x64 + {2945B0AC-AB99-483F-9FDC-CF76613E3034}.Release|x64.Build.0 = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.ActiveCfg = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|Win32.Build.0 = Debug|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.ActiveCfg = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Debug|x64.Build.0 = Debug|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.ActiveCfg = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|Win32.Build.0 = Release|Win32 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.ActiveCfg = Release|x64 + {AE83E1B4-CE06-47EE-B7A3-C3A1D7C2D71E}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/config.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/config.h new file mode 100644 index 0000000..b229281 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/config.h @@ -0,0 +1,50 @@ +/* config.h. Manual config for MSVC. */ + +#ifdef _MSC_VER + +/* embed WinUSB driver files from the following DDK location */ +#ifndef DDK_DIR +// #define DDK_DIR "E:/WinDDK/7600.16385.0" +#endif + +/* embed libusb0 driver files from the following location */ +#ifndef LIBUSB0_DIR +// #define LIBUSB0_DIR "D:/libusb-win32" +#endif + +/* embed user defined driver files from the following location */ +#if !defined(USER_DIR) && !defined(LIBUSB0_DIR) && !defined(DDK_DIR) + #define USER_DIR "" +#endif + +/* DDK WDF coinstaller version (string) */ +#define WDF_VER "01009" + +/* 32 bit support */ +//#define OPT_M32 + +/* 64 bit support */ +//#define OPT_M64 + +/* embed IA64 driver files */ +//#define OPT_IA64 + +#else // end of MSVC defaults + + +#endif + +// MSVC and GCC defaults +#if defined(DBG) || defined(DEBUG) || defined(_DEBUG) + /* Debug message logging */ + #define ENABLE_DEBUG_LOGGING + + /* Debug message logging (toggable) */ + #define INCLUDE_DEBUG_LOGGING + + /* Message logging */ + #define ENABLE_LOGGING 1 + + /* Output log message to a debug window/DebugView */ + #define LOG_OUTPUT_DEBUGWINDOW +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/inttypes.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/inttypes.h new file mode 100644 index 0000000..0282d2b --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/inttypes.h @@ -0,0 +1,299 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was original part of the w64 mingw-runtime package. + */ + +/* + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +/* 7.8 Format conversion of integer types */ + +#ifndef _INTTYPES_H_ +#define _INTTYPES_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + intmax_t quot; + intmax_t rem; + } imaxdiv_t; + + +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) + +/* 7.8.1 Macros for format specifiers + * + * MS runtime does not yet understand C9x standard "ll" + * length specifier. It appears to treat "ll" as "l". + * The non-standard I64 length specifier causes warning in GCC, + * but understood by MS runtime functions. + */ + +/* fprintf macros for signed types */ +#define PRId8 "d" +#define PRId16 "d" +#define PRId32 "d" +#define PRId64 "I64d" + +#define PRIdLEAST8 "d" +#define PRIdLEAST16 "d" +#define PRIdLEAST32 "d" +#define PRIdLEAST64 "I64d" + +#define PRIdFAST8 "d" +#define PRIdFAST16 "d" +#define PRIdFAST32 "d" +#define PRIdFAST64 "I64d" + +#define PRIdMAX "I64d" + +#define PRIi8 "i" +#define PRIi16 "i" +#define PRIi32 "i" +#define PRIi64 "I64i" + +#define PRIiLEAST8 "i" +#define PRIiLEAST16 "i" +#define PRIiLEAST32 "i" +#define PRIiLEAST64 "I64i" + +#define PRIiFAST8 "i" +#define PRIiFAST16 "i" +#define PRIiFAST32 "i" +#define PRIiFAST64 "I64i" + +#define PRIiMAX "I64i" + +#define PRIo8 "o" +#define PRIo16 "o" +#define PRIo32 "o" +#define PRIo64 "I64o" + +#define PRIoLEAST8 "o" +#define PRIoLEAST16 "o" +#define PRIoLEAST32 "o" +#define PRIoLEAST64 "I64o" + +#define PRIoFAST8 "o" +#define PRIoFAST16 "o" +#define PRIoFAST32 "o" +#define PRIoFAST64 "I64o" + +#define PRIoMAX "I64o" + +/* fprintf macros for unsigned types */ +#define PRIu8 "u" +#define PRIu16 "u" +#define PRIu32 "u" +#define PRIu64 "I64u" + + +#define PRIuLEAST8 "u" +#define PRIuLEAST16 "u" +#define PRIuLEAST32 "u" +#define PRIuLEAST64 "I64u" + +#define PRIuFAST8 "u" +#define PRIuFAST16 "u" +#define PRIuFAST32 "u" +#define PRIuFAST64 "I64u" + +#define PRIuMAX "I64u" + +#define PRIx8 "x" +#define PRIx16 "x" +#define PRIx32 "x" +#define PRIx64 "I64x" + +#define PRIxLEAST8 "x" +#define PRIxLEAST16 "x" +#define PRIxLEAST32 "x" +#define PRIxLEAST64 "I64x" + +#define PRIxFAST8 "x" +#define PRIxFAST16 "x" +#define PRIxFAST32 "x" +#define PRIxFAST64 "I64x" + +#define PRIxMAX "I64x" + +#define PRIX8 "X" +#define PRIX16 "X" +#define PRIX32 "X" +#define PRIX64 "I64X" + +#define PRIXLEAST8 "X" +#define PRIXLEAST16 "X" +#define PRIXLEAST32 "X" +#define PRIXLEAST64 "I64X" + +#define PRIXFAST8 "X" +#define PRIXFAST16 "X" +#define PRIXFAST32 "X" +#define PRIXFAST64 "I64X" + +#define PRIXMAX "I64X" + +/* + * fscanf macros for signed int types + * NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t + * (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have + * no length identifiers + */ + +#define SCNd16 "hd" +#define SCNd32 "d" +#define SCNd64 "I64d" + +#define SCNdLEAST16 "hd" +#define SCNdLEAST32 "d" +#define SCNdLEAST64 "I64d" + +#define SCNdFAST16 "hd" +#define SCNdFAST32 "d" +#define SCNdFAST64 "I64d" + +#define SCNdMAX "I64d" + +#define SCNi16 "hi" +#define SCNi32 "i" +#define SCNi64 "I64i" + +#define SCNiLEAST16 "hi" +#define SCNiLEAST32 "i" +#define SCNiLEAST64 "I64i" + +#define SCNiFAST16 "hi" +#define SCNiFAST32 "i" +#define SCNiFAST64 "I64i" + +#define SCNiMAX "I64i" + +#define SCNo16 "ho" +#define SCNo32 "o" +#define SCNo64 "I64o" + +#define SCNoLEAST16 "ho" +#define SCNoLEAST32 "o" +#define SCNoLEAST64 "I64o" + +#define SCNoFAST16 "ho" +#define SCNoFAST32 "o" +#define SCNoFAST64 "I64o" + +#define SCNoMAX "I64o" + +#define SCNx16 "hx" +#define SCNx32 "x" +#define SCNx64 "I64x" + +#define SCNxLEAST16 "hx" +#define SCNxLEAST32 "x" +#define SCNxLEAST64 "I64x" + +#define SCNxFAST16 "hx" +#define SCNxFAST32 "x" +#define SCNxFAST64 "I64x" + +#define SCNxMAX "I64x" + +/* fscanf macros for unsigned int types */ + +#define SCNu16 "hu" +#define SCNu32 "u" +#define SCNu64 "I64u" + +#define SCNuLEAST16 "hu" +#define SCNuLEAST32 "u" +#define SCNuLEAST64 "I64u" + +#define SCNuFAST16 "hu" +#define SCNuFAST32 "u" +#define SCNuFAST64 "I64u" + +#define SCNuMAX "I64u" + +#ifdef _WIN64 +#define PRIdPTR "I64d" +#define PRIiPTR "I64i" +#define PRIoPTR "I64o" +#define PRIuPTR "I64u" +#define PRIxPTR "I64x" +#define PRIXPTR "I64X" +#define SCNdPTR "I64d" +#define SCNiPTR "I64i" +#define SCNoPTR "I64o" +#define SCNxPTR "I64x" +#define SCNuPTR "I64u" +#else +#define PRIdPTR "d" +#define PRIiPTR "i" +#define PRIoPTR "o" +#define PRIuPTR "u" +#define PRIxPTR "x" +#define PRIXPTR "X" +#define SCNdPTR "d" +#define SCNiPTR "i" +#define SCNoPTR "o" +#define SCNxPTR "x" + #define SCNuPTR "u" +#endif + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +/* + * no length modifier for char types prior to C9x + * MS runtime scanf appears to treat "hh" as "h" + */ + +/* signed char */ +#define SCNd8 "hhd" +#define SCNdLEAST8 "hhd" +#define SCNdFAST8 "hhd" + +#define SCNi8 "hhi" +#define SCNiLEAST8 "hhi" +#define SCNiFAST8 "hhi" + +#define SCNo8 "hho" +#define SCNoLEAST8 "hho" +#define SCNoFAST8 "hho" + +#define SCNx8 "hhx" +#define SCNxLEAST8 "hhx" +#define SCNxFAST8 "hhx" + +/* unsigned char */ +#define SCNu8 "hhu" +#define SCNuLEAST8 "hhu" +#define SCNuFAST8 "hhu" +#endif /* __STDC_VERSION__ >= 199901 */ + +#endif /* !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) */ + + +#ifdef __cplusplus +} +#endif + +#endif /* ndef _INTTYPES_H */ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/stdint.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/stdint.h new file mode 100644 index 0000000..5d5329a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/msvc/stdint.h @@ -0,0 +1,273 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file was originally part of the w64 mingw-runtime package. + */ + +/* ISO C9x 7.18 Integer types + * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794) + * + * THIS SOFTWARE IS NOT COPYRIGHTED + * + * Contributor: Danny Smith + * Modified for libusb/MSVC: Pete Batard + * + * This source code is offered for use in the public domain. You may + * use, modify or distribute it freely. + * + * This code is distributed in the hope that it will be useful but + * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY + * DISCLAIMED. This includes but is not limited to warranties of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * Date: 2010-04-02 + */ + +#ifndef _MSC_VER +#error This header should only be used with Microsoft compilers +#endif + +#ifndef _STDINT_H +#define _STDINT_H + +/* from stddef.h and _mingw.h */ +#ifndef _SSIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#undef ssize_t +#ifdef _WIN64 + typedef __int64 ssize_t; +#else + typedef int ssize_t; +#endif /* _WIN64 */ +#endif /* _SSIZE_T_DEFINED */ + +#ifndef _INTPTR_T_DEFINED +#define _INTPTR_T_DEFINED +#ifndef __intptr_t_defined +#define __intptr_t_defined +#undef intptr_t +#ifdef _WIN64 + typedef __int64 intptr_t; +#else + typedef int intptr_t; +#endif /* _WIN64 */ +#endif /* __intptr_t_defined */ +#endif /* _INTPTR_T_DEFINED */ + +#ifndef _UINTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#ifndef __uintptr_t_defined +#define __uintptr_t_defined +#undef uintptr_t +#ifdef _WIN64 + typedef unsigned __int64 uintptr_t; +#else + typedef unsigned int uintptr_t; +#endif /* _WIN64 */ +#endif /* __uintptr_t_defined */ +#endif /* _UINTPTR_T_DEFINED */ + +#ifndef _PTRDIFF_T_DEFINED +#define _PTRDIFF_T_DEFINED +#ifndef _PTRDIFF_T_ +#define _PTRDIFF_T_ +#undef ptrdiff_t +#ifdef _WIN64 + typedef __int64 ptrdiff_t; +#else + typedef int ptrdiff_t; +#endif /* _WIN64 */ +#endif /* _PTRDIFF_T_ */ +#endif /* _PTRDIFF_T_DEFINED */ + +#ifndef _WCHAR_T_DEFINED +#define _WCHAR_T_DEFINED +#ifndef __cplusplus + typedef unsigned short wchar_t; +#endif /* C++ */ +#endif /* _WCHAR_T_DEFINED */ + +#ifndef _WCTYPE_T_DEFINED +#define _WCTYPE_T_DEFINED +#ifndef _WINT_T +#define _WINT_T + typedef unsigned short wint_t; + typedef unsigned short wctype_t; +#endif /* _WINT_T */ +#endif /* _WCTYPE_T_DEFINED */ + +/* 7.18.1.1 Exact-width integer types */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned uint32_t; +typedef long long int64_t; +typedef unsigned long long uint64_t; + +/* 7.18.1.2 Minimum-width integer types */ +typedef signed char int_least8_t; +typedef unsigned char uint_least8_t; +typedef short int_least16_t; +typedef unsigned short uint_least16_t; +typedef int int_least32_t; +typedef unsigned uint_least32_t; +typedef long long int_least64_t; +typedef unsigned long long uint_least64_t; + +/* 7.18.1.3 Fastest minimum-width integer types + * Not actually guaranteed to be fastest for all purposes + * Here we use the exact-width types for 8 and 16-bit ints. + */ +typedef signed char int_fast8_t; +typedef unsigned char uint_fast8_t; +typedef short int_fast16_t; +typedef unsigned short uint_fast16_t; +typedef int int_fast32_t; +typedef unsigned int uint_fast32_t; +typedef long long int_fast64_t; +typedef unsigned long long uint_fast64_t; + +/* 7.18.1.5 Greatest-width integer types */ +typedef long long intmax_t; +typedef unsigned long long uintmax_t; + +/* 7.18.2 Limits of specified-width integer types */ +#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) + +/* 7.18.2.1 Limits of exact-width integer types */ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 255 +#define UINT16_MAX 65535 +#define UINT32_MAX 0xffffffffU /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + +/* 7.18.2.2 Limits of minimum-width integer types */ +#define INT_LEAST8_MIN INT8_MIN +#define INT_LEAST16_MIN INT16_MIN +#define INT_LEAST32_MIN INT32_MIN +#define INT_LEAST64_MIN INT64_MIN + +#define INT_LEAST8_MAX INT8_MAX +#define INT_LEAST16_MAX INT16_MAX +#define INT_LEAST32_MAX INT32_MAX +#define INT_LEAST64_MAX INT64_MAX + +#define UINT_LEAST8_MAX UINT8_MAX +#define UINT_LEAST16_MAX UINT16_MAX +#define UINT_LEAST32_MAX UINT32_MAX +#define UINT_LEAST64_MAX UINT64_MAX + +/* 7.18.2.3 Limits of fastest minimum-width integer types */ +#define INT_FAST8_MIN INT8_MIN +#define INT_FAST16_MIN INT16_MIN +#define INT_FAST32_MIN INT32_MIN +#define INT_FAST64_MIN INT64_MIN + +#define INT_FAST8_MAX INT8_MAX +#define INT_FAST16_MAX INT16_MAX +#define INT_FAST32_MAX INT32_MAX +#define INT_FAST64_MAX INT64_MAX + +#define UINT_FAST8_MAX UINT8_MAX +#define UINT_FAST16_MAX UINT16_MAX +#define UINT_FAST32_MAX UINT32_MAX +#define UINT_FAST64_MAX UINT64_MAX + +/* 7.18.2.4 Limits of integer types capable of holding + object pointers */ +#ifdef _WIN64 +#define INTPTR_MIN INT64_MIN +#define INTPTR_MAX INT64_MAX +#define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif + +/* 7.18.2.5 Limits of greatest-width integer types */ +#define INTMAX_MIN INT64_MIN +#define INTMAX_MAX INT64_MAX +#define UINTMAX_MAX UINT64_MAX + +/* 7.18.3 Limits of other integer types */ +#ifdef _WIN64 +#define PTRDIFF_MIN INT64_MIN +#define PTRDIFF_MAX INT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#endif + +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX + +#ifndef SIZE_MAX +#ifdef _WIN64 +#define SIZE_MAX UINT64_MAX +#else +#define SIZE_MAX UINT32_MAX +#endif +#endif + +#ifndef WCHAR_MIN /* also in wchar.h */ +#define WCHAR_MIN 0U +#define WCHAR_MAX 0xffffU +#endif + +/* + * wint_t is unsigned short for compatibility with MS runtime + */ +#define WINT_MIN 0U +#define WINT_MAX 0xffffU + +#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ + + +/* 7.18.4 Macros for integer constants */ +#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS) + +/* 7.18.4.1 Macros for minimum-width integer constants + + Accoding to Douglas Gwyn : + "This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC + 9899:1999 as initially published, the expansion was required + to be an integer constant of precisely matching type, which + is impossible to accomplish for the shorter types on most + platforms, because C99 provides no standard way to designate + an integer constant with width less than that of type int. + TC1 changed this to require just an integer constant + *expression* with *promoted* type." + + The trick used here is from Clive D W Feather. +*/ + +#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val)) +#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val)) +#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val)) +/* The 'trick' doesn't work in C89 for long long because, without + suffix, (val) will be evaluated as int, not intmax_t */ +#define INT64_C(val) val##LL + +#define UINT8_C(val) (val) +#define UINT16_C(val) (val) +#define UINT32_C(val) (val##U) +#define UINT64_C(val) val##ULL + +/* 7.18.4.2 Macros for greatest-width integer constants */ +#define INTMAX_C(val) val##LL +#define UINTMAX_C(val) val##ULL + +#endif /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */ + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/clean.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/clean.bat new file mode 100644 index 0000000..0281add --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/clean.bat @@ -0,0 +1,6 @@ +@ECHO OFF + +PUSHD %CD% +CD ..\ddk_make +CALL CMD /C make.cmd clean 2>NUL>NUL +POPD diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcproj new file mode 100644 index 0000000..6a0ebec --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcproj @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj new file mode 100644 index 0000000..eab23df --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj @@ -0,0 +1,140 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {040945A3-5236-4F2E-A726-58FB98576E7B} + infwizard + + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + MachineX86 + + + + + MaxSpeed + true + ..\src;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + true + true + MachineX86 + + + false + + + + + + + + + + + + + + + + + + {9aa0e745-1a0a-4700-8ecb-6a6de9dbf8b9} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.filters new file mode 100644 index 0000000..90f7c01 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.filters @@ -0,0 +1,40 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcproj new file mode 100644 index 0000000..8f5eb6d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcproj @@ -0,0 +1,415 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj new file mode 100644 index 0000000..1fce720 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj @@ -0,0 +1,245 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {0EABF109-6EC7-4478-9985-8357D3237873} + installfilterwin + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + .\additional;$(ReferencePath) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;..\src\driver;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + MachineX86 + + + + + MaxSpeed + true + ..\src;..\src\driver;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + true + true + MachineX86 + + + false + + + + + X64 + + + Disabled + ..\src;..\src\driver;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0501;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + MachineX64 + + + + + X64 + + + MaxSpeed + true + ..\src;..\src\driver;.\additional\libwdi\libwdi;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0501;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";_WIN32_WINNT=0x0500;EMBEDDED_LIBUSB_WIN32;%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + comctl32.lib;newdev.lib;setupapi.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + %(AdditionalLibraryDirectories) + false + %(IgnoreSpecificDefaultLibraries) + + + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.filters new file mode 100644 index 0000000..31f7fdd --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.filters @@ -0,0 +1,52 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcproj new file mode 100644 index 0000000..c5c9312 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcproj @@ -0,0 +1,404 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj new file mode 100644 index 0000000..44cd391 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj @@ -0,0 +1,224 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {ED3B338F-9A7E-4136-A98D-E00771622E7B} + installfilter + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;TARGETTYPE=PROGRAMconsole;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib + %(AdditionalLibraryDirectories) + AsInvoker + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0501;TARGETTYPE=PROGRAMconsole;LOG_APPNAME="$(ProjectName)";LOG_STYLE_SHORT;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_AMD64.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib + %(AdditionalLibraryDirectories) + AsInvoker + true + MachineX64 + + + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;TARGETTYPE=PROGRAMconsole;LOG_APPNAME="$(ProjectName)";LOG_STYLE_SHORT;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib + %(AdditionalLibraryDirectories) + AsInvoker + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0501;TARGETTYPE=PROGRAMconsole;LOG_APPNAME="$(ProjectName)";LOG_STYLE_SHORT;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_AMD64.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;user32.lib;gdi32.lib;advapi32.lib + %(AdditionalLibraryDirectories) + AsInvoker + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.filters new file mode 100644 index 0000000..19eff68 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.filters @@ -0,0 +1,53 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-539543e/install-filter-d526a705.ipch b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-539543e/install-filter-d526a705.ipch new file mode 100644 index 0000000..853c894 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-539543e/install-filter-d526a705.ipch differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcproj new file mode 100644 index 0000000..4a855e1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcproj @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj new file mode 100644 index 0000000..b054dca --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj @@ -0,0 +1,244 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + libusb0 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4} + libusbdll + + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";TARGETTYPE=DYNLINK;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_x86.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;advapi32.lib;user32.lib;shell32.lib;gdi32.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + false + ..\libusb0.def + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";TARGETTYPE=DYNLINK;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_x86.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;advapi32.lib;user32.lib;shell32.lib;gdi32.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + false + ..\libusb0.def + true + MachineX64 + + + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";TARGETTYPE=DYNLINK;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;advapi32.lib;user32.lib;shell32.lib;gdi32.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + false + ..\libusb0.def + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;..\src\driver;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";TARGETTYPE=DYNLINK;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + setupapi.lib;kernel32.lib;advapi32.lib;user32.lib;shell32.lib;gdi32.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + false + ..\libusb0.def + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.filters new file mode 100644 index 0000000..be240f1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.filters @@ -0,0 +1,64 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcproj new file mode 100644 index 0000000..a369bf2 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcproj @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj new file mode 100644 index 0000000..ef3056a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj @@ -0,0 +1,159 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547} + libusbdll + + + + Makefile + MultiByte + true + + + Makefile + MultiByte + + + Makefile + MultiByte + true + + + Makefile + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" "debugmode=true" + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" "debugmode=true" + + + TARGETTYPE=3;_X86_=1;i386=1;STD_CALL;CONDITION_HANDLING=1;NT_UP=1;NT_INST=0;WIN32=100;_NT1X_=100;WINNT=1;_WIN32_WINNT=0x0501;WINVER=0x0501;_WIN32_IE=0x0603;WIN32_LEAN_AND_MEAN=1;DEVL=1;__BUILDMACHINE__=WinDDK;FPO=0;NDEBUG;_DLL=1;MANIFEST_FILE="manifest_x86.xml";LOG_APPNAME="libusb0";NTDDI_VERSION=0x05010200;$(NMakePreprocessorDefinitions) + Z:\WinDDK\7600.16385.0\inc\api;Z:\WinDDK\7600.16385.0\incddk;Z:\WinDDK\7600.16385.0\inc\crt;..\src\driver;..\src;$(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" "debugmode=true" + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" "debugmode=true" + + + TARGETTYPE=3;_X86_=1;i386=1;STD_CALL;CONDITION_HANDLING=1;NT_UP=1;NT_INST=0;WIN32=100;_NT1X_=100;WINNT=1;_WIN32_WINNT=0x0501;WINVER=0x0501;_WIN32_IE=0x0603;WIN32_LEAN_AND_MEAN=1;DEVL=1;__BUILDMACHINE__=WinDDK;FPO=0;NDEBUG;_DLL=1;MANIFEST_FILE="manifest_x86.xml";LOG_APPNAME="libusb0";NTDDI_VERSION=0x05010200;$(NMakePreprocessorDefinitions) + Z:\WinDDK\7600.16385.0\inc\api;Z:\WinDDK\7600.16385.0\incddk;Z:\WinDDK\7600.16385.0\inc\crt;..\src\driver;..\src;$(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" + CD "$(ProjectDir)..\ddk_make" +ECHO $(CMDVAR_WINDDK_DIR) +CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" + + + TARGETTYPE=DRIVER;LOG_OUTPUT_TYPE=3;_X86_=1;i386=1;STD_CALL;CONDITION_HANDLING=1;NT_UP=1;NT_INST=0;WIN32=100;_NT1X_=100;WINNT=1;_WIN32_WINNT=0x0501;WINVER=0x0501;_WIN32_IE=0x0603;WIN32_LEAN_AND_MEAN=1;DEVL=1;__BUILDMACHINE__=WinDDK;FPO=0;NDEBUG;_DLL=1;MANIFEST_FILE="manifest_x86.xml";LOG_APPNAME="libusb0";NTDDI_VERSION=0x05010200;$(NMakePreprocessorDefinitions) + Z:\WinDDK\7600.16385.0\inc\api;Z:\WinDDK\7600.16385.0\incddk;Z:\WinDDK\7600.16385.0\inc\crt;..\src\driver;..\src;$(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + CD "$(ProjectDir)..\ddk_make" +CMD /C make.cmd "arch=x64" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" + CD "$(ProjectDir)..\ddk_make" +ECHO $(CMDVAR_WINDDK_DIR) +CMD /C make.cmd "arch=x64" "app=driver" "noclean=true" "outdir=$(OutDir)" "DIR_INTERMEDIATE=$(IntDir)" + + + TARGETTYPE=DRIVER;LOG_OUTPUT_TYPE=3;_X86_=1;i386=1;STD_CALL;CONDITION_HANDLING=1;NT_UP=1;NT_INST=0;WIN32=100;_NT1X_=100;WINNT=1;_WIN32_WINNT=0x0501;WINVER=0x0501;_WIN32_IE=0x0603;WIN32_LEAN_AND_MEAN=1;DEVL=1;__BUILDMACHINE__=WinDDK;FPO=0;NDEBUG;_DLL=1;MANIFEST_FILE="manifest_x86.xml";LOG_APPNAME="libusb0";NTDDI_VERSION=0x05010200;$(NMakePreprocessorDefinitions) + Z:\WinDDK\7600.16385.0\inc\api;Z:\WinDDK\7600.16385.0\incddk;Z:\WinDDK\7600.16385.0\inc\crt;..\src\driver;..\src;$(NMakeIncludeSearchPath) + $(NMakeForcedIncludes) + $(NMakeAssemblySearchPath) + $(NMakeForcedUsingAssemblies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.filters new file mode 100644 index 0000000..a20cf2a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.filters @@ -0,0 +1,117 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {8473ae89-4c8a-4908-ad4d-bed9d7cea35f} + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + ddk_make Files + + + ddk_make Files + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.bat b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.bat new file mode 100644 index 0000000..e9a2f86 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.bat @@ -0,0 +1,4 @@ +@ECHO OFF +CALL ..\ddk_make\make.cmd launchdevenv "%CD%\libusb-win32.sln" + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.sln b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.sln new file mode 100644 index 0000000..70093a4 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.sln @@ -0,0 +1,197 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libwdi", "libwdi", "{7D8B217B-7329-489D-A956-2EC3C39EE5B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install-filter", "install-filter.vcxproj", "{ED3B338F-9A7E-4136-A98D-E00771622E7B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb0", "libusb-dll.vcxproj", "{C52E6FA6-AFF5-468D-A82F-E9932E8203D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inf-wizard", "inf-wizard.vcxproj", "{040945A3-5236-4F2E-A726-58FB98576E7B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testlibusb-win", "testlibusb-win.vcxproj", "{A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testlibusb", "testlibusb.vcxproj", "{64992906-17FE-4EC7-BF72-AF41B0E826D0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libusb-sys", "libusb-sys.vcxproj", "{AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testbulk", "testbulk.vcxproj", "{F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Benchmark", "Benchmark.vcxproj", "{930C04F7-EA05-49D4-8741-5C6AC3B9D72A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "embedder", "additional\libwdi\libwdi\embedder_2008.vcxproj", "{792D44D5-28A7-4EB3-B84B-8021FE3189F9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer_x64", "additional\libwdi\libwdi\installer_x64_2008.vcxproj", "{E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer_x86", "additional\libwdi\libwdi\installer_x86_2008.vcxproj", "{9B1C561E-F95B-4849-A7AA-A4350E227C20}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libwdi (static)", "additional\libwdi\libwdi\libwdi_static_2008.vcxproj", "{9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "install-filter-win", "install-filter-win.vcxproj", "{0EABF109-6EC7-4478-9985-8357D3237873}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|Win32.ActiveCfg = Debug|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|Win32.Build.0 = Debug|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|x64.ActiveCfg = Debug|x64 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Debug|x64.Build.0 = Debug|x64 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|Mixed Platforms.Build.0 = Release|x64 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|Win32.ActiveCfg = Release|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|Win32.Build.0 = Release|Win32 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|x64.ActiveCfg = Release|x64 + {ED3B338F-9A7E-4136-A98D-E00771622E7B}.Release|x64.Build.0 = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|Win32.Build.0 = Debug|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|x64.ActiveCfg = Debug|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Debug|x64.Build.0 = Debug|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Mixed Platforms.Build.0 = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Win32.ActiveCfg = Release|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|Win32.Build.0 = Release|Win32 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|x64.ActiveCfg = Release|x64 + {C52E6FA6-AFF5-468D-A82F-E9932E8203D4}.Release|x64.Build.0 = Release|x64 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Debug|Win32.ActiveCfg = Debug|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Debug|Win32.Build.0 = Debug|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Debug|x64.ActiveCfg = Debug|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Release|Mixed Platforms.Build.0 = Release|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Release|Win32.ActiveCfg = Release|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Release|Win32.Build.0 = Release|Win32 + {040945A3-5236-4F2E-A726-58FB98576E7B}.Release|x64.ActiveCfg = Release|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|Win32.ActiveCfg = Debug|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|Win32.Build.0 = Debug|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|x64.ActiveCfg = Debug|x64 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Debug|x64.Build.0 = Debug|x64 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|Mixed Platforms.Build.0 = Release|x64 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|Win32.ActiveCfg = Release|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|Win32.Build.0 = Release|Win32 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|x64.ActiveCfg = Release|x64 + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E}.Release|x64.Build.0 = Release|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|Win32.ActiveCfg = Debug|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|Win32.Build.0 = Debug|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|x64.ActiveCfg = Debug|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Debug|x64.Build.0 = Debug|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|Mixed Platforms.Build.0 = Release|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|Win32.ActiveCfg = Release|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|Win32.Build.0 = Release|Win32 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|x64.ActiveCfg = Release|x64 + {64992906-17FE-4EC7-BF72-AF41B0E826D0}.Release|x64.Build.0 = Release|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|Win32.Build.0 = Debug|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|x64.ActiveCfg = Debug|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Debug|x64.Build.0 = Debug|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|Mixed Platforms.Build.0 = Release|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|Win32.ActiveCfg = Release|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|Win32.Build.0 = Release|Win32 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|x64.ActiveCfg = Release|x64 + {AD3F6DB8-DA1A-4C27-8CBB-FC7F4B836547}.Release|x64.Build.0 = Release|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|Win32.ActiveCfg = Debug|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|Win32.Build.0 = Debug|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|x64.ActiveCfg = Debug|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Debug|x64.Build.0 = Debug|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|Mixed Platforms.Build.0 = Release|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|Win32.ActiveCfg = Release|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|Win32.Build.0 = Release|Win32 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|x64.ActiveCfg = Release|x64 + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E}.Release|x64.Build.0 = Release|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|Win32.ActiveCfg = Debug|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|Win32.Build.0 = Debug|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|x64.ActiveCfg = Debug|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Debug|x64.Build.0 = Debug|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|Mixed Platforms.Build.0 = Release|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|Win32.ActiveCfg = Release|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|Win32.Build.0 = Release|Win32 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|x64.ActiveCfg = Release|x64 + {930C04F7-EA05-49D4-8741-5C6AC3B9D72A}.Release|x64.Build.0 = Release|x64 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|Win32.Build.0 = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Debug|x64.ActiveCfg = Debug|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Win32.ActiveCfg = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|Win32.Build.0 = Release|Win32 + {792D44D5-28A7-4EB3-B84B-8021FE3189F9}.Release|x64.ActiveCfg = Release|Win32 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Win32.ActiveCfg = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|Win32.Build.0 = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|x64.ActiveCfg = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Debug|x64.Build.0 = Debug|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|Mixed Platforms.ActiveCfg = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|Mixed Platforms.Build.0 = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|Win32.ActiveCfg = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|x64.ActiveCfg = Release|x64 + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26}.Release|x64.Build.0 = Release|x64 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Win32.ActiveCfg = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|Win32.Build.0 = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Debug|x64.ActiveCfg = Debug|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Mixed Platforms.Build.0 = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Win32.ActiveCfg = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|Win32.Build.0 = Release|Win32 + {9B1C561E-F95B-4849-A7AA-A4350E227C20}.Release|x64.ActiveCfg = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Win32.ActiveCfg = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|Win32.Build.0 = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Debug|x64.ActiveCfg = Debug|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Win32.ActiveCfg = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|Win32.Build.0 = Release|Win32 + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9}.Release|x64.ActiveCfg = Release|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Debug|Win32.ActiveCfg = Debug|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Debug|Win32.Build.0 = Debug|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Debug|x64.ActiveCfg = Debug|x64 + {0EABF109-6EC7-4478-9985-8357D3237873}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Release|Mixed Platforms.Build.0 = Release|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Release|Win32.ActiveCfg = Release|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Release|Win32.Build.0 = Release|Win32 + {0EABF109-6EC7-4478-9985-8357D3237873}.Release|x64.ActiveCfg = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {792D44D5-28A7-4EB3-B84B-8021FE3189F9} = {7D8B217B-7329-489D-A956-2EC3C39EE5B8} + {E5A56EE0-182F-470F-8CDC-8C1B7B86EE26} = {7D8B217B-7329-489D-A956-2EC3C39EE5B8} + {9B1C561E-F95B-4849-A7AA-A4350E227C20} = {7D8B217B-7329-489D-A956-2EC3C39EE5B8} + {9AA0E745-1A0A-4700-8ECB-6A6DE9DBF8B9} = {7D8B217B-7329-489D-A956-2EC3C39EE5B8} + EndGlobalSection +EndGlobal diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo new file mode 100644 index 0000000..47b4559 Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcproj new file mode 100644 index 0000000..2980870 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcproj @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj new file mode 100644 index 0000000..b318e0d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj @@ -0,0 +1,225 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {F1A067D0-AE24-43F2-ACD6-6545F41CEA2E} + testbulk + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX64 + + + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + {c52e6fa6-aff5-468d-a82f-e9932e8203d4} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.filters new file mode 100644 index 0000000..4faa765 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcproj new file mode 100644 index 0000000..9f2cc0c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcproj @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj new file mode 100644 index 0000000..a477ffa --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj @@ -0,0 +1,238 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {A1CCD5D1-6FB5-424E-B987-8DA81F16D14E} + testlibusbwin + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + AsInvoker + false + + + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_AMD64.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;setupapi.lib;%(AdditionalDependencies) + $(OutDir)$(ProjectName).exe + %(AdditionalLibraryDirectories) + false + AsInvoker + false + + + true + MachineX64 + + + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + AsInvoker + false + + + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_AMD64.xml";%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";MANIFEST_FILE="..\\manifest_AMD64.xml";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;user32.lib;gdi32.lib;advapi32.lib;setupapi.lib;%(AdditionalDependencies) + %(AdditionalLibraryDirectories) + false + AsInvoker + false + + + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + {c52e6fa6-aff5-468d-a82f-e9932e8203d4} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.filters new file mode 100644 index 0000000..59829be --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcproj new file mode 100644 index 0000000..a3f7943 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcproj @@ -0,0 +1,380 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj new file mode 100644 index 0000000..9c5c59c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj @@ -0,0 +1,225 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {64992906-17FE-4EC7-BF72-AF41B0E826D0} + testlibusb + + + + Application + MultiByte + true + + + Application + MultiByte + + + Application + MultiByte + true + + + Application + MultiByte + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + EditAndContinue + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX86 + + + + + X64 + + + Disabled + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + MachineX64 + + + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX86 + + + false + + + + + X64 + + + MaxSpeed + true + ..\src;%(AdditionalIncludeDirectories) + _WIN32_WINNT=0x0500;LOG_APPNAME="$(ProjectName)";snprintf=_snprintf;%(PreprocessorDefinitions) + MultiThreaded + true + Level3 + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + + + LOG_APPNAME="$(ProjectName)";%(PreprocessorDefinitions) + ..\src;%(AdditionalIncludeDirectories) + + + kernel32.lib;advapi32.lib;user32.lib;setupapi.lib + %(AdditionalLibraryDirectories) + false + AsInvoker + true + true + true + MachineX64 + + + false + + + + + + + + + + + + + + {c52e6fa6-aff5-468d-a82f-e9932e8203d4} + false + + + + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.filters b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.filters new file mode 100644 index 0000000..66a4a71 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + + + Source Files + + + + + Header Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest new file mode 100644 index 0000000..ad29edc --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest new file mode 100644 index 0000000..8d2ef29 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/descriptors.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/descriptors.c new file mode 100644 index 0000000..f367172 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/descriptors.c @@ -0,0 +1,572 @@ +/* + * Parses descriptors + * + * Copyright (c) 2001 Johannes Erdfelt + * + * This library is covered by the LGPL, read LICENSE for details. + */ + +#include +#include +#include "usbi.h" + +int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, void *buf, int size) +{ + memset(buf, 0, size); + + return usb_control_msg(udev, ep | USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (type << 8) + index, 0, buf, size, 1000); +} + +int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size) +{ + memset(buf, 0, size); + + return usb_control_msg(udev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (type << 8) + index, 0, buf, size, 1000); +} + +int usb_parse_descriptor(unsigned char *source, char *description, void *dest) +{ + unsigned char *sp = source, *dp = dest; + uint16_t w; + uint32_t d; + char *cp; + + for (cp = description; *cp; cp++) + { + switch (*cp) + { + case 'b': /* 8-bit byte */ + *dp++ = *sp++; + break; + case 'w': /* 16-bit word, convert from little endian to CPU */ + w = (sp[1] << 8) | sp[0]; + sp += 2; + //dp += ((unsigned long)dp & 1); /* Align to word boundary */ + *((uint16_t *)dp) = w; + dp += 2; + break; + case 'd': /* 32-bit dword, convert from little endian to CPU */ + d = (sp[3] << 24) | (sp[2] << 16) | (sp[1] << 8) | sp[0]; + sp += 4; + //dp += ((unsigned long)dp & 2); /* Align to dword boundary */ + *((uint32_t *)dp) = d; + dp += 4; + break; + /* These two characters are undocumented and just a hack for Linux */ + case 'W': /* 16-bit word, keep CPU endianess */ + //dp += ((unsigned long)dp & 1); /* Align to word boundary */ + memcpy(dp, sp, 2); + sp += 2; + dp += 2; + break; + case 'D': /* 32-bit dword, keep CPU endianess */ + //dp += ((unsigned long)dp & 2); /* Align to dword boundary */ + memcpy(dp, sp, 4); + sp += 4; + dp += 4; + break; + } + } + + return (int)(sp - source); +} + +/* + * This code looks surprisingly similar to the code I wrote for the Linux + * kernel. It's not a coincidence :) + */ + +static int usb_parse_endpoint(struct usb_endpoint_descriptor *endpoint, unsigned char *buffer, int size) +{ + struct usb_descriptor_header header; + unsigned char *begin; + int parsed = 0, len, numskipped; + + usb_parse_descriptor(buffer, "bb", &header); + + /* Everything should be fine being passed into here, but we sanity */ + /* check JIC */ + if (header.bLength > size) + { + if (usb_debug >= 1) + fprintf(stderr, "ran out of descriptors parsing\n"); + return -1; + } + + if (header.bDescriptorType != USB_DT_ENDPOINT) + { + if (usb_debug >= 2) + fprintf(stderr, "unexpected descriptor 0x%X, expecting endpoint descriptor, type 0x%X\n", + header.bDescriptorType, USB_DT_ENDPOINT); + return parsed; + } + + if (header.bLength >= ENDPOINT_AUDIO_DESC_LENGTH) + usb_parse_descriptor(buffer, "bbbbwbbb", endpoint); + else if (header.bLength >= ENDPOINT_DESC_LENGTH) + usb_parse_descriptor(buffer, "bbbbwb", endpoint); + + buffer += header.bLength; + size -= header.bLength; + parsed += header.bLength; + + /* Skip over the rest of the Class Specific or Vendor Specific */ + /* descriptors */ + begin = buffer; + numskipped = 0; + while (size >= DESC_HEADER_LENGTH) + { + usb_parse_descriptor(buffer, "bb", &header); + + if (header.bLength < 2) + { + if (usb_debug >= 1) + fprintf(stderr, "invalid descriptor length of %d\n", header.bLength); + return -1; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == USB_DT_ENDPOINT) || + (header.bDescriptorType == USB_DT_INTERFACE) || + (header.bDescriptorType == USB_DT_CONFIG) || + (header.bDescriptorType == USB_DT_DEVICE)) + break; + + if (usb_debug >= 1) + fprintf(stderr, "skipping descriptor 0x%X\n", header.bDescriptorType); + numskipped++; + + buffer += header.bLength; + size -= header.bLength; + parsed += header.bLength; + } + + if (numskipped && usb_debug >= 2) + fprintf(stderr, "skipped %d class/vendor specific endpoint descriptors\n", numskipped); + + /* Copy any unknown descriptors into a storage area for drivers */ + /* to later parse */ + len = (int)(buffer - begin); + if (!len) + { + endpoint->extra = NULL; + endpoint->extralen = 0; + return parsed; + } + + endpoint->extra = malloc(len); + if (!endpoint->extra) + { + if (usb_debug >= 1) + fprintf(stderr, "couldn't allocate memory for endpoint extra descriptors\n"); + endpoint->extralen = 0; + return parsed; + } + + memcpy(endpoint->extra, begin, len); + endpoint->extralen = len; + + return parsed; +} + +static int usb_parse_interface(struct usb_interface *interface, + unsigned char *buffer, int size) +{ + int i, len, numskipped, retval, parsed = 0; + struct usb_descriptor_header header; + struct usb_interface_descriptor *ifp; + unsigned char *begin; + + interface->num_altsetting = 0; + + while (size >= INTERFACE_DESC_LENGTH) + { + interface->altsetting = realloc(interface->altsetting, sizeof(struct usb_interface_descriptor) * (interface->num_altsetting + 1)); + if (!interface->altsetting) + { + if (usb_debug >= 1) + fprintf(stderr, "couldn't malloc interface->altsetting\n"); + return -1; + } + + ifp = interface->altsetting + interface->num_altsetting; + interface->num_altsetting++; + + usb_parse_descriptor(buffer, "bbbbbbbbb", ifp); + + /* Skip over the interface */ + buffer += ifp->bLength; + parsed += ifp->bLength; + size -= ifp->bLength; + + begin = buffer; + numskipped = 0; + + /* Skip over any interface, class or vendor descriptors */ + while (size >= DESC_HEADER_LENGTH) + { + usb_parse_descriptor(buffer, "bb", &header); + + if (header.bLength < 2) + { + if (usb_debug >= 1) + fprintf(stderr, "invalid descriptor length of %d\n", header.bLength); + return -1; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == USB_DT_INTERFACE) || + (header.bDescriptorType == USB_DT_ENDPOINT) || + (header.bDescriptorType == USB_DT_CONFIG) || + (header.bDescriptorType == USB_DT_DEVICE)) + break; + + numskipped++; + + buffer += header.bLength; + parsed += header.bLength; + size -= header.bLength; + } + + if (numskipped && usb_debug >= 2) + fprintf(stderr, "skipped %d class/vendor specific interface descriptors\n", numskipped); + + /* Copy any unknown descriptors into a storage area for */ + /* drivers to later parse */ + len = (int)(buffer - begin); + if (!len) + { + ifp->extra = NULL; + ifp->extralen = 0; + } + else + { + ifp->extra = malloc(len); + if (!ifp->extra) + { + if (usb_debug >= 1) + fprintf(stderr, "couldn't allocate memory for interface extra descriptors\n"); + ifp->extralen = 0; + return -1; + } + memcpy(ifp->extra, begin, len); + ifp->extralen = len; + } + + /* Did we hit an unexpected descriptor? */ + usb_parse_descriptor(buffer, "bb", &header); + if ((size >= DESC_HEADER_LENGTH) && + ((header.bDescriptorType == USB_DT_CONFIG) || + (header.bDescriptorType == USB_DT_DEVICE))) + return parsed; + + if (ifp->bNumEndpoints > USB_MAXENDPOINTS) + { + if (usb_debug >= 1) + fprintf(stderr, "too many endpoints\n"); + return -1; + } + + if (ifp->bNumEndpoints > 0) + { + ifp->endpoint = (struct usb_endpoint_descriptor *) + malloc(ifp->bNumEndpoints * + sizeof(struct usb_endpoint_descriptor)); + if (!ifp->endpoint) + { + if (usb_debug >= 1) + fprintf(stderr, "couldn't allocate memory for ifp->endpoint\n"); + return -1; + } + + memset(ifp->endpoint, 0, ifp->bNumEndpoints * + sizeof(struct usb_endpoint_descriptor)); + + for (i = 0; i < ifp->bNumEndpoints; i++) + { + usb_parse_descriptor(buffer, "bb", &header); + + if (header.bLength > size) + { + if (usb_debug >= 1) + fprintf(stderr, "ran out of descriptors parsing\n"); + return -1; + } + + retval = usb_parse_endpoint(ifp->endpoint + i, buffer, size); + if (retval < 0) + return retval; + + buffer += retval; + parsed += retval; + size -= retval; + } + } + else + ifp->endpoint = NULL; + + /* We check to see if it's an alternate to this one */ + ifp = (struct usb_interface_descriptor *)buffer; + if (size < USB_DT_INTERFACE_SIZE || + ifp->bDescriptorType != USB_DT_INTERFACE || + !ifp->bAlternateSetting) + return parsed; + } + + return parsed; +} + +int usb_parse_configuration(struct usb_config_descriptor *config, + unsigned char *buffer) +{ + int i, retval, size; + struct usb_descriptor_header header; + + usb_parse_descriptor(buffer, "bbwbbbbb", config); + size = config->wTotalLength; + + if (config->bNumInterfaces > USB_MAXINTERFACES) + { + if (usb_debug >= 1) + fprintf(stderr, "too many interfaces\n"); + return -1; + } + + config->interface = (struct usb_interface *) + malloc(config->bNumInterfaces * + sizeof(struct usb_interface)); + if (!config->interface) + { + if (usb_debug >= 1) + fprintf(stderr, "out of memory\n"); + return -1; + } + + memset(config->interface, 0, config->bNumInterfaces * sizeof(struct usb_interface)); + + buffer += config->bLength; + size -= config->bLength; + + config->extra = NULL; + config->extralen = 0; + + for (i = 0; i < config->bNumInterfaces; i++) + { + int numskipped, len; + unsigned char *begin; + + /* Skip over the rest of the Class Specific or Vendor */ + /* Specific descriptors */ + begin = buffer; + numskipped = 0; + while (size >= DESC_HEADER_LENGTH) + { + usb_parse_descriptor(buffer, "bb", &header); + + if ((header.bLength > size) || (header.bLength < DESC_HEADER_LENGTH)) + { + if (usb_debug >= 1) + fprintf(stderr, "invalid descriptor length of %d\n", header.bLength); + return -1; + } + + /* If we find another "proper" descriptor then we're done */ + if ((header.bDescriptorType == USB_DT_ENDPOINT) || + (header.bDescriptorType == USB_DT_INTERFACE) || + (header.bDescriptorType == USB_DT_CONFIG) || + (header.bDescriptorType == USB_DT_DEVICE)) + break; + + if (usb_debug >= 2) + fprintf(stderr, "skipping descriptor 0x%X\n", header.bDescriptorType); + numskipped++; + + buffer += header.bLength; + size -= header.bLength; + } + + if (numskipped && usb_debug >= 2) + fprintf(stderr, "skipped %d class/vendor specific endpoint descriptors\n", numskipped); + + /* Copy any unknown descriptors into a storage area for */ + /* drivers to later parse */ + len = (int)(buffer - begin); + if (len) + { + /* FIXME: We should realloc and append here */ + if (!config->extralen) + { + config->extra = malloc(len); + if (!config->extra) + { + if (usb_debug >= 1) + fprintf(stderr, "couldn't allocate memory for config extra descriptors\n"); + config->extralen = 0; + return -1; + } + + memcpy(config->extra, begin, len); + config->extralen = len; + } + } + + retval = usb_parse_interface(config->interface + i, buffer, size); + if (retval < 0) + return retval; + + buffer += retval; + size -= retval; + } + + return size; +} + +void usb_destroy_configuration(struct usb_device *dev) +{ + int c, i, j, k; + + if (!dev->config) + return; + + for (c = 0; c < dev->descriptor.bNumConfigurations; c++) + { + struct usb_config_descriptor *cf = &dev->config[c]; + + if (!cf->interface) + continue; + + for (i = 0; i < cf->bNumInterfaces; i++) + { + struct usb_interface *ifp = &cf->interface[i]; + + if (!ifp->altsetting) + continue; + + for (j = 0; j < ifp->num_altsetting; j++) + { + struct usb_interface_descriptor *as = &ifp->altsetting[j]; + + if (as->extra) + free(as->extra); + + if (!as->endpoint) + continue; + + for (k = 0; k < as->bNumEndpoints; k++) + { + if (as->endpoint[k].extra) + free(as->endpoint[k].extra); + } + free(as->endpoint); + } + + free(ifp->altsetting); + } + + free(cf->interface); + } + + free(dev->config); +} + +void usb_fetch_and_parse_descriptors(usb_dev_handle *udev) +{ + struct usb_device *dev = udev->device; + int i; + + if (dev->descriptor.bNumConfigurations > USB_MAXCONFIG) + { + if (usb_debug >= 1) + fprintf(stderr, "Too many configurations (%d > %d)\n", dev->descriptor.bNumConfigurations, USB_MAXCONFIG); + return; + } + + if (dev->descriptor.bNumConfigurations < 1) + { + if (usb_debug >= 1) + fprintf(stderr, "Not enough configurations (%d < %d)\n", dev->descriptor.bNumConfigurations, 1); + return; + } + + dev->config = (struct usb_config_descriptor *)malloc(dev->descriptor.bNumConfigurations * sizeof(struct usb_config_descriptor)); + if (!dev->config) + { + if (usb_debug >= 1) + fprintf(stderr, "Unable to allocate memory for config descriptor\n"); + return; + } + + memset(dev->config, 0, dev->descriptor.bNumConfigurations * + sizeof(struct usb_config_descriptor)); + + for (i = 0; i < dev->descriptor.bNumConfigurations; i++) + { + unsigned char buffer[USB_DT_CONFIG_SIZE], *bigbuffer; + struct usb_config_descriptor config; + int res; + + /* Get the first 8 bytes so we can figure out what the total length is */ + res = usb_get_descriptor(udev, USB_DT_CONFIG, (unsigned char)i, buffer, USB_DT_CONFIG_SIZE); + if (res < USB_DT_CONFIG_SIZE) + { + if (usb_debug >= 1) + { + if (res < 0) + fprintf(stderr, "Unable to get descriptor (%d)\n", res); + else + fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", USB_DT_CONFIG_SIZE, res); + } + + goto err; + } + + usb_parse_descriptor(buffer, "bbw", &config); + + bigbuffer = malloc(config.wTotalLength); + if (!bigbuffer) + { + if (usb_debug >= 1) + fprintf(stderr, "Unable to allocate memory for descriptors\n"); + goto err; + } + + res = usb_get_descriptor(udev, USB_DT_CONFIG, (unsigned char)i, bigbuffer, + config.wTotalLength); + if (res < config.wTotalLength) + { + if (usb_debug >= 1) + { + if (res < 0) + fprintf(stderr, "Unable to get descriptor (%d)\n", res); + else + fprintf(stderr, "Config descriptor too short (expected %d, got %d)\n", config.wTotalLength, res); + } + + free(bigbuffer); + goto err; + } + + res = usb_parse_configuration(&dev->config[i], bigbuffer); + if (usb_debug >= 2) + { + if (res > 0) + fprintf(stderr, "Descriptor data still left\n"); + else if (res < 0) + fprintf(stderr, "Unable to parse descriptors\n"); + } + + free(bigbuffer); + } + + return; + +err: + free(dev->config); + + dev->config = NULL; +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/abort_endpoint.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/abort_endpoint.c new file mode 100644 index 0000000..580046a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/abort_endpoint.c @@ -0,0 +1,56 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS abort_endpoint(libusb_device_t *dev, int endpoint, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("endpoint: 0x%02x timeout: %d\n", endpoint, timeout); + + memset(&urb, 0, sizeof(struct _URB_PIPE_REQUEST)); + + if (!dev->config.value) + { + USBERR0("invalid configuration 0\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + if (!get_pipe_handle(dev, endpoint, &urb.UrbPipeRequest.PipeHandle)) + { + USBERR0("getting endpoint pipe failed\n"); + return STATUS_INVALID_PARAMETER; + } + + urb.UrbHeader.Length = (USHORT) sizeof(struct _URB_PIPE_REQUEST); + urb.UrbHeader.Function = URB_FUNCTION_ABORT_PIPE; + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("request failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/claim_interface.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/claim_interface.c new file mode 100644 index 0000000..7d43032 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/claim_interface.c @@ -0,0 +1,63 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + +#include "libusb_driver.h" + + + +NTSTATUS claim_interface(libusb_device_t *dev, FILE_OBJECT *file_object, + int interface) +{ + USBMSG("interface %d\n", interface); + + if (!dev->config.value) + { + USBERR0("device is not configured\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + if (interface >= LIBUSB_MAX_NUMBER_OF_INTERFACES) + { + USBERR("interface number %d too high\n", + interface); + return STATUS_INVALID_PARAMETER; + } + + if (!dev->config.interfaces[interface].valid) + { + USBERR("interface %d does not exist\n", interface); + return STATUS_INVALID_PARAMETER; + } + + if (dev->config.interfaces[interface].file_object == file_object) + { + return STATUS_SUCCESS; + } + + if (dev->config.interfaces[interface].file_object) + { + USBERR("could not claim interface %d, interface is already claimed\n", interface); + return STATUS_DEVICE_BUSY; + } + + dev->config.interfaces[interface].file_object = file_object; + + return STATUS_SUCCESS; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/clear_feature.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/clear_feature.c new file mode 100644 index 0000000..de9d76a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/clear_feature.c @@ -0,0 +1,64 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + +NTSTATUS clear_feature(libusb_device_t *dev, + int recipient, int index, int feature, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("recipient: %02d index: %04d feature: %04d timeout: %d\n", + recipient,index,feature,timeout); + + memset(&urb, 0, sizeof(struct _URB_CONTROL_FEATURE_REQUEST)); + + switch (recipient) + { + case USB_RECIP_DEVICE: + urb.UrbHeader.Function = URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE; + break; + case USB_RECIP_INTERFACE: + urb.UrbHeader.Function = URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + urb.UrbHeader.Function = URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT; + break; + case USB_RECIP_OTHER: + urb.UrbHeader.Function = URB_FUNCTION_CLEAR_FEATURE_TO_OTHER; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_FEATURE_REQUEST); + urb.UrbControlFeatureRequest.FeatureSelector = (USHORT)feature; + urb.UrbControlFeatureRequest.Index = (USHORT)index; + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("clearing feature failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/dispatch.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/dispatch.c new file mode 100644 index 0000000..6bf7ed1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/dispatch.c @@ -0,0 +1,99 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + +NTSTATUS DDKAPI dispatch(DEVICE_OBJECT *device_object, IRP *irp) +{ + libusb_device_t *dev = device_object->DeviceExtension; + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + + switch (stack_location->MajorFunction) + { + case IRP_MJ_PNP: + return dispatch_pnp(dev, irp); + + case IRP_MJ_POWER: + // ID: 2960644 (farthen) + // You can't set the power state if the device is not handled at all + if(!dev->next_stack_device) + { + return complete_irp(irp, STATUS_INVALID_DEVICE_STATE, 0); + } + return dispatch_power(dev, irp); + } + + /* since this driver may run as an upper filter we have to check whether */ + /* the IRP is sent to this device object or to the lower one */ + if (accept_irp(dev, irp)) + { + switch (stack_location->MajorFunction) + { + case IRP_MJ_DEVICE_CONTROL: + + if (dev->is_started) + { + return dispatch_ioctl(dev, irp); + } + else /* not started yet */ + { + return complete_irp(irp, STATUS_INVALID_DEVICE_STATE, 0); + } + + case IRP_MJ_CREATE: + + if (dev->is_started) + { + // only one driver can act as power policy owner and + // power_set_device_state() can only be issued by the PPO. + // disallow_power_control is set to true for drivers which + // we know cause a BSOD on any attempt to request power irps. + if (dev->power_state.DeviceState != PowerDeviceD0 && !dev->disallow_power_control) + { + /* power up the device, block until the call */ + /* completes */ + power_set_device_state(dev, PowerDeviceD0, TRUE); + } + return complete_irp(irp, STATUS_SUCCESS, 0); + } + else /* not started yet */ + { + return complete_irp(irp, STATUS_INVALID_DEVICE_STATE, 0); + } + + case IRP_MJ_CLOSE: + + /* release all interfaces bound to this file object */ + release_all_interfaces(dev, stack_location->FileObject); + return complete_irp(irp, STATUS_SUCCESS, 0); + + case IRP_MJ_CLEANUP: + + return complete_irp(irp, STATUS_SUCCESS, 0); + + default: + return complete_irp(irp, STATUS_NOT_SUPPORTED, 0); + } + } + else /* the IRP is for the lower device object */ + { + return pass_irp_down(dev, irp, NULL, NULL); + } +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_api.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_api.h new file mode 100644 index 0000000..6b2d3c9 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_api.h @@ -0,0 +1,227 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#ifndef __DRIVER_API_H__ +#define __DRIVER_API_H__ + +enum +{ + LIBUSB_DEBUG_OFF, + LIBUSB_DEBUG_ERR, + LIBUSB_DEBUG_WRN, + LIBUSB_DEBUG_MSG, + + LIBUSB_DEBUG_MAX = 0xff, +}; + + +/* 64k */ +#define LIBUSB_MAX_READ_WRITE 0x10000 + +#define LIBUSB_MAX_NUMBER_OF_DEVICES 256 +#define LIBUSB_MAX_NUMBER_OF_CHILDREN 32 + +#define LIBUSB_IOCTL_SET_CONFIGURATION CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x801, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_CONFIGURATION CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x802, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_SET_INTERFACE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x803, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_INTERFACE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x804, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_SET_FEATURE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x805, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_CLEAR_FEATURE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x806, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_STATUS CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x807, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_SET_DESCRIPTOR CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x808, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_DESCRIPTOR CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x809, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80A, METHOD_IN_DIRECT, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80B, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_VENDOR_WRITE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80C, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_VENDOR_READ CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80D, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_RESET_ENDPOINT CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80E, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_ABORT_ENDPOINT CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x80F, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_RESET_DEVICE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x810, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_SET_DEBUG_LEVEL CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x811, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_VERSION CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x812, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_ISOCHRONOUS_WRITE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x813, METHOD_IN_DIRECT, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_ISOCHRONOUS_READ CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x814, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_CLAIM_INTERFACE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x815, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_RELEASE_INTERFACE CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x816, METHOD_BUFFERED, FILE_ANY_ACCESS) + +///////////////////////////////////////////////////////////////////////////// +// supported after 0.1.12.2 +///////////////////////////////////////////////////////////////////////////// + +// [trobinso] adds support for querying device properties +#define LIBUSB_IOCTL_GET_DEVICE_PROPERTY CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x900, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define LIBUSB_IOCTL_GET_CUSTOM_REG_PROPERTY CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x901, METHOD_BUFFERED, FILE_ANY_ACCESS) + +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// supported after 1.2.0.0 +///////////////////////////////////////////////////////////////////////////// +#define LIBUSB_IOCTL_GET_CACHED_CONFIGURATION CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x902, METHOD_BUFFERED, FILE_ANY_ACCESS) +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// supported after 1.2.2.0 +///////////////////////////////////////////////////////////////////////////// +#define LIBUSB_IOCTL_GET_OBJECT_NAME CTL_CODE(FILE_DEVICE_UNKNOWN,\ +0x8FF, METHOD_BUFFERED, FILE_ANY_ACCESS) +///////////////////////////////////////////////////////////////////////////// + + +#include + +enum LIBUSB0_TRANSFER_FLAGS +{ + TRANSFER_FLAGS_SHORT_NOT_OK = 1 << 0, + TRANSFER_FLAGS_ISO_SET_START_FRAME = 1 << 30, + TRANSFER_FLAGS_ISO_ADD_LATENCY = 1 << 31, +}; + +typedef struct +{ + unsigned int timeout; + union + { + struct + { + unsigned int configuration; + } configuration; + struct + { + unsigned int interface; + unsigned int altsetting; + } interface; + struct + { + unsigned int endpoint; + unsigned int packet_size; + + // TODO: max_transfer_size, short transfer not ok, use iso_start_frame + unsigned int max_transfer_size; + unsigned int transfer_flags; + unsigned int iso_start_frame_latency; + } endpoint; + struct + { + unsigned int type; + unsigned int recipient; + unsigned int request; + unsigned int value; + unsigned int index; + } vendor; + struct + { + unsigned int recipient; + unsigned int feature; + unsigned int index; + } feature; + struct + { + unsigned int recipient; + unsigned int index; + unsigned int status; + } status; + struct + { + unsigned int type; + unsigned int index; + unsigned int language_id; + unsigned int recipient; + } descriptor; + struct + { + unsigned int level; + } debug; + struct + { + unsigned int major; + unsigned int minor; + unsigned int micro; + unsigned int nano; + unsigned int mod_value; + } version; + struct + { + unsigned int property; + } device_property; + struct + { + unsigned int key_type; + unsigned int name_offset; + unsigned int value_offset; + unsigned int value_length; + } device_registry_key; + struct + { + // 0 - device plug and play registry key pathname + unsigned int objname_index; + } objname; + }; +} libusb_request; + +#include + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.c new file mode 100644 index 0000000..57af8fa --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.c @@ -0,0 +1,75 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" +#include +#include + +int debug_level = LIBUSB_DEBUG_MSG; + +void DEBUG_PRINT_NL() +{ +#ifdef DBG + if (debug_level >= LIBUSB_DEBUG_MSG) + DbgPrint(("\n")); +#endif +} + +void DEBUG_SET_LEVEL(int level) +{ +#ifdef DBG + debug_level = level; +#endif +} + +void DEBUG_MESSAGE(const char *format, ...) +{ +#ifdef DBG + + char tmp[256]; + + if (debug_level >= LIBUSB_DEBUG_MSG) + { + va_list args; + va_start(args, format); + _vsnprintf(tmp, sizeof(tmp) - 1, format, args); + va_end(args); + + DbgPrint("LIBUSB-DRIVER - %s", tmp); + } +#endif +} + +void DEBUG_ERROR(const char *format, ...) +{ +#ifdef DBG + + char tmp[256]; + + if (debug_level >= LIBUSB_DEBUG_ERR) + { + va_list args; + va_start(args, format); + _vsnprintf(tmp, sizeof(tmp) - 1, format, args); + va_end(args); + + DbgPrint("LIBUSB-DRIVER - %s", tmp); + } +#endif +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.h new file mode 100644 index 0000000..add74ac --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_debug.h @@ -0,0 +1,30 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#ifndef __LIBUSB_DEBUG_H__ +#define __LIBUSB_DEBUG_H__ + + +void DEBUG_PRINT_NL(); +void DEBUG_SET_LEVEL(int level); +void DEBUG_MESSAGE(const char *format, ...); +void DEBUG_ERROR(const char *format, ...); + + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_registry.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_registry.c new file mode 100644 index 0000000..6dd4bae --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/driver_registry.c @@ -0,0 +1,275 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + +/* missing in mingw's ddk headers */ +#ifndef PLUGPLAY_REGKEY_DEVICE +#define PLUGPLAY_REGKEY_DEVICE 1 +#endif + +#define LIBUSB_REG_SURPRISE_REMOVAL_OK L"SurpriseRemovalOK" +#define LIBUSB_REG_INITIAL_CONFIG_VALUE L"InitialConfigValue" + +static bool_t reg_get_property(DEVICE_OBJECT *physical_device_object, + int property, char *data, int size); + +static bool_t reg_get_property(DEVICE_OBJECT *physical_device_object, + int property, char *data, int size) +{ + WCHAR tmp[512]; + ULONG ret; + ULONG i; + + if (!physical_device_object || !data || !size) + { + return FALSE; + } + + memset(data, 0, size); + memset(tmp, 0, sizeof(tmp)); + + if (NT_SUCCESS(IoGetDeviceProperty(physical_device_object, + property, + sizeof(tmp) - 2, + tmp, + &ret)) && ret) + { + /* convert unicode string to normal character string */ + for (i = 0; (i < ret/2) && (i < ((ULONG)size - 1)); i++) + { + data[i] = (char)tmp[i]; + } + + _strlwr(data); + + return TRUE; + } + + return FALSE; +} + + +bool_t reg_get_properties(libusb_device_t *dev) +{ + HANDLE key = NULL; + PVOID keyObject = NULL; + NTSTATUS status; + UNICODE_STRING surprise_removal_ok_name; + UNICODE_STRING initial_config_value_name; + KEY_VALUE_FULL_INFORMATION *info; + ULONG pool_length; + ULONG length; + ULONG val; + + if (!dev->physical_device_object) + { + return FALSE; + } + + /* default settings */ + dev->surprise_removal_ok = FALSE; + dev->is_filter = TRUE; + dev->initial_config_value = SET_CONFIG_ACTIVE_CONFIG; + + status = IoOpenDeviceRegistryKey(dev->physical_device_object, + PLUGPLAY_REGKEY_DEVICE, + STANDARD_RIGHTS_ALL, + &key); + if (NT_SUCCESS(status)) + { + RtlInitUnicodeString(&surprise_removal_ok_name, + LIBUSB_REG_SURPRISE_REMOVAL_OK); + + RtlInitUnicodeString(&initial_config_value_name, + LIBUSB_REG_INITIAL_CONFIG_VALUE); + + pool_length = sizeof(KEY_VALUE_FULL_INFORMATION) + 512; + + info = ExAllocatePool(NonPagedPool, pool_length); + if (!info) + { + ZwClose(key); + USBERR("ExAllocatePool failed allocating %d bytes\n", pool_length); + return FALSE; + } + + + // get surprise_removal_ok + // get is_filter + length = pool_length; + memset(info, 0, length); + + status = ZwQueryValueKey(key, &surprise_removal_ok_name, + KeyValueFullInformation, info, length, &length); + + if (NT_SUCCESS(status) && (info->Type == REG_DWORD)) + { + val = *((ULONG *)(((char *)info) + info->DataOffset)); + + dev->surprise_removal_ok = val ? TRUE : FALSE; + dev->is_filter = FALSE; + } + + // get initial_config_value + length = pool_length; + memset(info, 0, length); + + status = ZwQueryValueKey(key, &initial_config_value_name, + KeyValueFullInformation, info, length, &length); + + if (NT_SUCCESS(status) && (info->Type == REG_DWORD)) + { + val = *((ULONG *)(((char *)info) + info->DataOffset)); + dev->initial_config_value = (int)val; + } + + status = ObReferenceObjectByHandle(key, KEY_READ, NULL, KernelMode, &keyObject, NULL); + if (NT_SUCCESS(status)) + { + length = pool_length; + memset(info, 0, length); + status = ObQueryNameString(keyObject, (POBJECT_NAME_INFORMATION)info, length, &length); + if (NT_SUCCESS(status)) + { + PWSTR nameW =((POBJECT_NAME_INFORMATION)info)->Name.Buffer; + PSTR nameA = dev->objname_plugplay_registry_key; + + val=0; + while (nameW[val] && val < (length/2)) + { + *nameA=(char)nameW[val]; + nameA++; + val++; + } + *nameA='\0'; + + USBDBG("reg-key-name=%s\n",dev->objname_plugplay_registry_key); + } + else + { + USBERR("ObQueryNameString failed. status=%Xh\n",status); + } + + ObDereferenceObject(keyObject); + } + else + { + USBERR("ObReferenceObjectByHandle failed. status=%Xh\n",status); + } + ExFreePool(info); + + ZwClose(key); + } + + return TRUE; +} + +bool_t reg_get_hardware_id(DEVICE_OBJECT *physical_device_object, + char *data, int size) +{ + if (!physical_device_object || !data || !size) + { + return FALSE; + } + + return reg_get_property(physical_device_object, DevicePropertyHardwareID, + data, size); +} + +bool_t reg_get_compatible_id(DEVICE_OBJECT *physical_device_object, + char *data, int size) +{ + if (!physical_device_object || !data || !size) + { + return FALSE; + } + + return reg_get_property(physical_device_object, DevicePropertyCompatibleIDs, + data, size); +} +/* +Gets a device property for the device_object. + +Returns: NTSTATUS code from IoGetDeviceProperty + STATUS_INVALID_PARAMETER +*/ +NTSTATUS reg_get_device_property(PDEVICE_OBJECT device_object, + int property, + char* data_buffer, + int data_length, + int* actual_length) +{ + NTSTATUS status = STATUS_INVALID_PARAMETER; + + if (!device_object || !data_buffer || !data_length || !actual_length) + return status; + + // clear data + memset(data_buffer, 0, data_length); + *actual_length=0; + + // get device property + status = IoGetDeviceProperty( + device_object, property, data_length, data_buffer, (PULONG)actual_length); + + return status; +} + +/* +Gets a property from the device registry key of the device_object. + +Returns: NTSTATUS from ZwQueryValueKey + NTSTATUS from IoOpenDeviceRegistryKey if the device registry + key could not be opened. +*/ +NTSTATUS reg_get_custom_property(PDEVICE_OBJECT device_object, + char *data_buffer, + unsigned int data_length, + unsigned int name_offset, + int* actual_length) +{ + HANDLE key = NULL; + NTSTATUS status; + UNICODE_STRING name; + KEY_VALUE_FULL_INFORMATION *info; + ULONG length; + + status = IoOpenDeviceRegistryKey(device_object, PLUGPLAY_REGKEY_DEVICE, KEY_READ, &key); + if (NT_SUCCESS(status)) + { + RtlInitUnicodeString(&name, (WCHAR*)(&data_buffer[name_offset])); + length = sizeof(KEY_VALUE_FULL_INFORMATION) + name.MaximumLength + data_length; + info = ExAllocatePool(NonPagedPool, length); + if (info) + { + memset(info, 0, length); + status = ZwQueryValueKey(key, &name, KeyValueFullInformation, info, length, &length); + if (NT_SUCCESS(status)) + { + data_length = (info->DataLength > data_length) ? data_length : info->DataLength; + memcpy(data_buffer, (((char *)info) + info->DataOffset),data_length); + *actual_length=data_length; + } + ExFreePool(info); + } + ZwClose(key); + } + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_configuration.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_configuration.c new file mode 100644 index 0000000..f4e7f6e --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_configuration.c @@ -0,0 +1,56 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + +NTSTATUS get_configuration(libusb_device_t *dev, + unsigned char *configuration, int *ret, + int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("timeout: %d\n", timeout); + + memset(&urb, 0, sizeof(URB)); + + urb.UrbHeader.Function = URB_FUNCTION_GET_CONFIGURATION; + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_CONFIGURATION_REQUEST); + urb.UrbControlGetConfigurationRequest.TransferBufferLength = 1; + urb.UrbControlGetConfigurationRequest.TransferBuffer = configuration; + + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("getting configuration failed: status: 0x%x, urb-status: 0x%x\n", + status, urb.UrbHeader.Status); + *ret = 0; + } + else + { + USBMSG("current configuration is: %d\n", + *configuration); + *ret = urb.UrbControlGetConfigurationRequest.TransferBufferLength; + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_descriptor.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_descriptor.c new file mode 100644 index 0000000..6946f7c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_descriptor.c @@ -0,0 +1,161 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS get_descriptor(libusb_device_t *dev, + void *buffer, int size, int type, int recipient, + int index, int language_id, int *received, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("buffer size: %d type: %04d recipient: %04d index: %04d language id: %04d timeout: %d\n", + size, type, recipient, index, language_id, timeout); + + memset(&urb, 0, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST)); + + switch (recipient) + { + case USB_RECIP_DEVICE: + urb.UrbHeader.Function = URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE; + break; + case USB_RECIP_INTERFACE: + urb.UrbHeader.Function = URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + urb.UrbHeader.Function = URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST); + urb.UrbControlDescriptorRequest.TransferBufferLength = size; + urb.UrbControlDescriptorRequest.TransferBuffer = buffer; + urb.UrbControlDescriptorRequest.DescriptorType = (UCHAR)type; + urb.UrbControlDescriptorRequest.Index = (UCHAR)index; + urb.UrbControlDescriptorRequest.LanguageId = (USHORT)language_id; + + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("getting descriptor failed: status: 0x%x, urb-status: 0x%x\n", + status, urb.UrbHeader.Status); + *received = 0; + } + else + { + *received = urb.UrbControlDescriptorRequest.TransferBufferLength; + } + + return status; +} + +PUSB_CONFIGURATION_DESCRIPTOR get_config_descriptor( + libusb_device_t *dev, + int value, + int *size, + int* index) +{ + NTSTATUS status; + USB_CONFIGURATION_DESCRIPTOR *desc = NULL; + USB_DEVICE_DESCRIPTOR device_descriptor; + int i; + volatile int desc_size; + + *index = 0; + + status = get_descriptor(dev, &device_descriptor, + sizeof(USB_DEVICE_DESCRIPTOR), + USB_DEVICE_DESCRIPTOR_TYPE, + USB_RECIP_DEVICE, + 0, 0, size, LIBUSB_DEFAULT_TIMEOUT); + + if (!NT_SUCCESS(status) || *size != sizeof(USB_DEVICE_DESCRIPTOR)) + { + USBERR0("getting device descriptor failed\n"); + return NULL; + } + + if (!(desc = ExAllocatePool(NonPagedPool, + sizeof(USB_CONFIGURATION_DESCRIPTOR)))) + { + USBERR0("memory allocation error\n"); + return NULL; + } + + for (i = 0; i < device_descriptor.bNumConfigurations; i++) + { + + if (!NT_SUCCESS(get_descriptor(dev, desc, + sizeof(USB_CONFIGURATION_DESCRIPTOR), + USB_CONFIGURATION_DESCRIPTOR_TYPE, + USB_RECIP_DEVICE, + i, 0, size, LIBUSB_DEFAULT_TIMEOUT))) + { + USBERR0("getting configuration descriptor failed\n"); + break; + } + + // if value is negative, get the descriptor by index + // if positive, get it by value. + if ((value > 0 && desc->bConfigurationValue == value) || + (value < 0 && -(i+1) == (value))) + { + desc_size = desc->wTotalLength; + ExFreePool(desc); + + if (!(desc = ExAllocatePool(NonPagedPool, desc_size))) + { + USBERR0("memory allocation error\n"); + break; + } + + if (!NT_SUCCESS(get_descriptor(dev, desc, desc_size, + USB_CONFIGURATION_DESCRIPTOR_TYPE, + USB_RECIP_DEVICE, + i, 0, size, LIBUSB_DEFAULT_TIMEOUT))) + { + USBERR0("getting configuration descriptor failed\n"); + break; + } + else + { + *index = i+1; + } + + return desc; + } + } + + if (desc) + { + ExFreePool(desc); + } + + return NULL; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_interface.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_interface.c new file mode 100644 index 0000000..3684838 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_interface.c @@ -0,0 +1,64 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS get_interface(libusb_device_t *dev, + int interface, unsigned char *altsetting, + int *ret, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("interface: %d timeout: %d\n", interface, timeout); + + if (!dev->config.value) + { + USBERR0("invalid configuration 0\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + memset(&urb, 0, sizeof(URB)); + + urb.UrbHeader.Function = URB_FUNCTION_GET_INTERFACE; + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_INTERFACE_REQUEST); + urb.UrbControlGetInterfaceRequest.TransferBufferLength = 1; + urb.UrbControlGetInterfaceRequest.TransferBuffer = altsetting; + urb.UrbControlGetInterfaceRequest.Interface = (USHORT)interface; + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("getting interface failed: status: 0x%x, urb-status: 0x%x\n", + status, urb.UrbHeader.Status); + *ret = 0; + } + else + { + *ret = urb.UrbControlGetInterfaceRequest.TransferBufferLength; + USBMSG("current altsetting is %d\n", *altsetting); + } + + return status; +} + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_status.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_status.c new file mode 100644 index 0000000..882cea5 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/get_status.c @@ -0,0 +1,74 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS get_status(libusb_device_t *dev, int recipient, + int index, char *status, int *ret, int timeout) +{ + NTSTATUS _status = STATUS_SUCCESS; + URB urb; + + USBMSG("recipient: %02d index: %04d timeout: %d\n", + recipient, index, timeout); + + memset(&urb, 0, sizeof(URB)); + + switch (recipient) + { + case USB_RECIP_DEVICE: + urb.UrbHeader.Function = URB_FUNCTION_GET_STATUS_FROM_DEVICE; + break; + case USB_RECIP_INTERFACE: + urb.UrbHeader.Function = URB_FUNCTION_GET_STATUS_FROM_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + urb.UrbHeader.Function = URB_FUNCTION_GET_STATUS_FROM_ENDPOINT; + break; + case USB_RECIP_OTHER: + urb.UrbHeader.Function = URB_FUNCTION_GET_STATUS_FROM_OTHER; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_STATUS_REQUEST); + urb.UrbControlGetStatusRequest.TransferBufferLength = 2; + urb.UrbControlGetStatusRequest.TransferBuffer = status; + urb.UrbControlGetStatusRequest.Index = (USHORT)index; + + _status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(_status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("getting status failed: status: 0x%x, urb-status: 0x%x\n", + _status, urb.UrbHeader.Status); + *ret = 0; + } + else + { + *ret = urb.UrbControlGetStatusRequest.TransferBufferLength; + } + + return _status; +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/ioctl.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/ioctl.c new file mode 100644 index 0000000..3cdf6ae --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/ioctl.c @@ -0,0 +1,566 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2010 Travis Robinson + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" +#include "libusb-win32_version.h" + +// used but all transfer functions to get a valid libusb_endpoint_t * +// for the request. +// +#define TRANSFER_IOCTL_GET_PIPEINFO() \ + /* check if the pipe exists and get the pipe information */ \ + if (!get_pipe_info(dev, request->endpoint.endpoint,&pipe_info)) \ + { \ + USBERR("%s: failed getting pipe info for endpoint: %02Xh\n", \ + dispCtlCode, request->endpoint.endpoint); \ + status = STATUS_INVALID_PARAMETER; \ + goto IOCTL_Done; \ + } + +// warns if receive buffer is not an interval of the maximum packet size. +#define TRANSFER_IOCTL_CHECK_READ_BUFFER() \ + /* read buffer lengthd must be equal to or an interval of the max */ \ + /* packet size */ \ + if (!pipe_info->maximum_packet_size) \ + { \ + USBWRN("%s: wMaxPacketSize=0 for endpoint %02Xh.\n", \ + dispCtlCode, request->endpoint.endpoint); \ + status = STATUS_INVALID_PARAMETER; \ + goto IOCTL_Done; \ + } \ + else if (transfer_buffer_length % pipe_info->maximum_packet_size) \ + { \ + USBWRN("%s: buffer length %d is not an interval wMaxPacketSize " \ + "for endpoint %02Xh.\n", \ + dispCtlCode, transfer_buffer_length, request->endpoint.endpoint); \ + } + +// validates the urb function and direction against libusb_endpoint_t +#define TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION() \ + if (urbFunction != UrbFunctionFromEndpoint(pipe_info) || \ + usbdDirection != UsbdDirectionFromEndpoint(pipe_info)) \ + { \ + USBERR("%s: not compatible with endpoint %02Xh\n", \ + dispCtlCode, pipe_info->address); \ + status = STATUS_INVALID_PARAMETER; \ + goto IOCTL_Done; \ + } + +// calls the transfer function and returns NTSTATUS +#define TRANSFER_IOCTL_EXECUTE() \ + if (transfer_buffer_length > (ULONG)(maxTransferSize)) \ + /* split large transfers */ \ + return large_transfer(dev, irp, \ + usbdDirection, \ + urbFunction, \ + pipe_info, \ + request->endpoint.packet_size, \ + maxTransferSize, \ + request->endpoint.transfer_flags, \ + request->endpoint.iso_start_frame_latency, \ + transfer_buffer_mdl, \ + transfer_buffer_length); \ + else \ + /* normal transfer */ \ + return transfer(dev, irp, \ + usbdDirection, \ + urbFunction, \ + pipe_info, \ + request->endpoint.packet_size, \ + maxTransferSize, \ + request->endpoint.transfer_flags, \ + request->endpoint.iso_start_frame_latency, \ + transfer_buffer_mdl, \ + transfer_buffer_length); + +NTSTATUS dispatch_ioctl(libusb_device_t *dev, IRP *irp) +{ + int maxTransferSize; + int ret = 0; + NTSTATUS status = STATUS_SUCCESS; + + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + + ULONG control_code = stack_location->Parameters.DeviceIoControl.IoControlCode; + + ULONG input_buffer_length = stack_location->Parameters.DeviceIoControl.InputBufferLength; + ULONG output_buffer_length = stack_location->Parameters.DeviceIoControl.OutputBufferLength; + ULONG transfer_buffer_length = stack_location->Parameters.DeviceIoControl.OutputBufferLength; + + libusb_request *request = (libusb_request *)irp->AssociatedIrp.SystemBuffer; + char *output_buffer = (char *)irp->AssociatedIrp.SystemBuffer; + char *input_buffer = (char *)irp->AssociatedIrp.SystemBuffer; + MDL *transfer_buffer_mdl = irp->MdlAddress; + libusb_endpoint_t* pipe_info = NULL; + const char* dispCtlCode = NULL; + int urbFunction = -1; + int usbdDirection = -1; + + status = remove_lock_acquire(dev); + + if (!NT_SUCCESS(status)) + { + status = complete_irp(irp, status, 0); + remove_lock_release(dev); + return status; + } + + /////////////////////////////////// + // DIRECT control codes // + /////////////////////////////////// + switch(control_code) + { + case LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ: + + dispCtlCode = "INTERRUPT_OR_BULK_READ"; + + // check if the request and buffer is valid + if (!request || !transfer_buffer_mdl || input_buffer_length < sizeof(libusb_request)) + { + USBERR("%s: invalid transfer request\n", + dispCtlCode); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + // check if the pipe exists and get the pipe information + TRANSFER_IOCTL_GET_PIPEINFO(); + + // must be a bulk or interrupt pipe + if (!IS_BULK_PIPE(pipe_info) && !IS_INTR_PIPE(pipe_info)) + { + USBERR("%s: incorrect pipe type: %02Xh\n", + dispCtlCode, pipe_info->pipe_type); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + // read buffer length must be equal to or an interval of the max packet size + TRANSFER_IOCTL_CHECK_READ_BUFFER(); + + urbFunction = URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER; + usbdDirection = USBD_TRANSFER_DIRECTION_IN; + maxTransferSize = GetMaxTransferSize(pipe_info, request->endpoint.max_transfer_size); + + // ensure that the urb function and direction we set matches the + // pipe information + // + TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION(); + + // calls the transfer function and returns NTSTATUS + TRANSFER_IOCTL_EXECUTE(); + + case LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE: + + dispCtlCode = "INTERRUPT_OR_BULK_WRITE"; + + /* we don't check 'transfer_buffer_mdl' here because it might be NULL */ + /* if the DLL requests to send a zero-length packet */ + if (!request || input_buffer_length < sizeof(libusb_request)) + { + USBERR("%s: invalid transfer request\n", dispCtlCode); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + // check if the pipe exists and get the pipe information + TRANSFER_IOCTL_GET_PIPEINFO(); + + // must be a bulk or interrupt pipe + if (!IS_BULK_PIPE(pipe_info) && !IS_INTR_PIPE(pipe_info)) + { + USBERR("%s: incorrect pipe type: %02Xh\n", + dispCtlCode, pipe_info->pipe_type); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + urbFunction = URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER; + usbdDirection = USBD_TRANSFER_DIRECTION_OUT; + maxTransferSize = GetMaxTransferSize(pipe_info, request->endpoint.max_transfer_size); + + // ensure that the urb function and direction we set matches the + // pipe information + // + TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION(); + + // calls the transfer function and returns NTSTATUS + TRANSFER_IOCTL_EXECUTE(); + + case LIBUSB_IOCTL_ISOCHRONOUS_READ: + + dispCtlCode = "ISOCHRONOUS_READ"; + + // check if the request and buffer is valid + if (!request || !transfer_buffer_mdl || input_buffer_length < sizeof(libusb_request)) + { + USBERR("%s: invalid transfer request\n", dispCtlCode); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + // check if the pipe exists and get the pipe information + TRANSFER_IOCTL_GET_PIPEINFO(); + + // read buffer length must be equal to or an interval of the max packet size + TRANSFER_IOCTL_CHECK_READ_BUFFER(); + + // must be an isochronous endpoint + if (!IS_ISOC_PIPE(pipe_info)) + { + USBERR("%s: incorrect pipe type: %02Xh\n", + dispCtlCode, pipe_info->pipe_type); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + urbFunction = URB_FUNCTION_ISOCH_TRANSFER; + usbdDirection = USBD_TRANSFER_DIRECTION_IN; + maxTransferSize = GetMaxTransferSize(pipe_info, request->endpoint.max_transfer_size); + + // ensure that the urb function and direction we set matches the + // pipe information + // + TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION(); + + // calls the transfer function and returns NTSTATUS + TRANSFER_IOCTL_EXECUTE(); + + case LIBUSB_IOCTL_ISOCHRONOUS_WRITE: + + dispCtlCode = "ISOCHRONOUS_WRITE"; + + // check if the request and buffer is valid + if (!transfer_buffer_mdl || !request || input_buffer_length < sizeof(libusb_request)) + { + USBERR("%s: invalid transfer request\n", dispCtlCode); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + // check if the pipe exists and get the pipe information + TRANSFER_IOCTL_GET_PIPEINFO(); + + // must be an isochronous endpoint + if (!IS_ISOC_PIPE(pipe_info)) + { + USBERR("%s: incorrect pipe type: %02Xh\n", + dispCtlCode, pipe_info->pipe_type); + status = STATUS_INVALID_PARAMETER; + goto IOCTL_Done; + } + + urbFunction = URB_FUNCTION_ISOCH_TRANSFER; + usbdDirection = USBD_TRANSFER_DIRECTION_OUT; + TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION(); + + maxTransferSize = GetMaxTransferSize(pipe_info, request->endpoint.max_transfer_size); + + // ensure that the urb function and direction we set matches the + // pipe information + // + TRANSFER_IOCTL_CHECK_FUNCTION_AND_DIRECTION(); + + TRANSFER_IOCTL_EXECUTE(); + } + + /////////////////////////////////// + // METHOD_BUFFERED control codes // + /////////////////////////////////// + if (!request || input_buffer_length < sizeof(libusb_request) + || input_buffer_length > LIBUSB_MAX_READ_WRITE + || output_buffer_length > LIBUSB_MAX_READ_WRITE + || transfer_buffer_length > LIBUSB_MAX_READ_WRITE) + { + USBERR0("invalid input or output buffer\n"); + + status = complete_irp(irp, STATUS_INVALID_PARAMETER, 0); + remove_lock_release(dev); + return status; + } + + switch(control_code) + { + case LIBUSB_IOCTL_SET_CONFIGURATION: + + status = set_configuration(dev, + request->configuration.configuration, + request->timeout); + break; + + case LIBUSB_IOCTL_GET_CACHED_CONFIGURATION: + case LIBUSB_IOCTL_GET_CONFIGURATION: + + if (!output_buffer || output_buffer_length < 1) + { + USBERR0("get_configuration: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + if (control_code == LIBUSB_IOCTL_GET_CACHED_CONFIGURATION) + { + ret = 0; + if (dev->config.value >= 0) + { + *output_buffer = (char)dev->config.value; + ret = 1; + } + status = STATUS_SUCCESS; + } + else + { + status = get_configuration(dev, output_buffer, &ret, request->timeout); + } + break; + + case LIBUSB_IOCTL_SET_INTERFACE: + + status = set_interface(dev, request->interface.interface, + request->interface.altsetting, request->timeout); + break; + + case LIBUSB_IOCTL_GET_INTERFACE: + + if (!output_buffer || output_buffer_length < 1) + { + USBERR0("get_interface: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + status = get_interface(dev, request->interface.interface, + output_buffer, &ret, request->timeout); + break; + + case LIBUSB_IOCTL_SET_FEATURE: + + status = set_feature(dev, request->feature.recipient, + request->feature.index, request->feature.feature, + request->timeout); + + break; + + case LIBUSB_IOCTL_CLEAR_FEATURE: + + status = clear_feature(dev, request->feature.recipient, + request->feature.index, request->feature.feature, + request->timeout); + + break; + + case LIBUSB_IOCTL_GET_STATUS: + + if (!output_buffer || output_buffer_length < 2) + { + USBERR0("get_status: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + status = get_status(dev, request->status.recipient, + request->status.index, output_buffer, + &ret, request->timeout); + + break; + + case LIBUSB_IOCTL_SET_DESCRIPTOR: + + if (input_buffer_length <= sizeof(libusb_request)) + { + USBERR0("set_descriptor: invalid input buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + status = set_descriptor(dev, + input_buffer + sizeof(libusb_request), + input_buffer_length - sizeof(libusb_request), + request->descriptor.type, + request->descriptor.recipient, + request->descriptor.index, + request->descriptor.language_id, + &ret, request->timeout); + + break; + + case LIBUSB_IOCTL_GET_DESCRIPTOR: + + if (!output_buffer || !output_buffer_length) + { + USBERR0("get_descriptor: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + status = get_descriptor(dev, output_buffer, + output_buffer_length, + request->descriptor.type, + request->descriptor.recipient, + request->descriptor.index, + request->descriptor.language_id, + &ret, request->timeout); + + break; + + case LIBUSB_IOCTL_VENDOR_READ: + + if (output_buffer_length && !output_buffer) + { + USBERR0("vendor_read: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + status = vendor_class_request(dev, + request->vendor.type, + request->vendor.recipient, + request->vendor.request, + request->vendor.value, + request->vendor.index, + output_buffer, + output_buffer_length, + USBD_TRANSFER_DIRECTION_IN, + &ret, request->timeout); + break; + + case LIBUSB_IOCTL_VENDOR_WRITE: + + status = + vendor_class_request(dev, + request->vendor.type, + request->vendor.recipient, + request->vendor.request, + request->vendor.value, + request->vendor.index, + input_buffer_length == sizeof(libusb_request) ? + NULL : input_buffer + sizeof(libusb_request), + input_buffer_length - sizeof(libusb_request), + USBD_TRANSFER_DIRECTION_OUT, + &ret, request->timeout); + break; + + case LIBUSB_IOCTL_RESET_ENDPOINT: + + status = reset_endpoint(dev, request->endpoint.endpoint, + request->timeout); + break; + + case LIBUSB_IOCTL_ABORT_ENDPOINT: + + status = abort_endpoint(dev, request->endpoint.endpoint, + request->timeout); + break; + + case LIBUSB_IOCTL_RESET_DEVICE: + + status = reset_device(dev, request->timeout); + break; + + case LIBUSB_IOCTL_SET_DEBUG_LEVEL: + usb_log_set_level(request->debug.level); + break; + + case LIBUSB_IOCTL_GET_VERSION: + + if (!request || output_buffer_length < sizeof(libusb_request)) + { + USBERR0("get_version: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + + request->version.major = VERSION_MAJOR; + request->version.minor = VERSION_MINOR; + request->version.micro = VERSION_MICRO; + request->version.nano = VERSION_NANO; + request->version.mod_value = 1; + + ret = sizeof(libusb_request); + break; + + case LIBUSB_IOCTL_CLAIM_INTERFACE: + status = claim_interface(dev, stack_location->FileObject, + request->interface.interface); + break; + + case LIBUSB_IOCTL_RELEASE_INTERFACE: + status = release_interface(dev, stack_location->FileObject, + request->interface.interface); + break; + + case LIBUSB_IOCTL_GET_DEVICE_PROPERTY: + if (!request || output_buffer_length < sizeof(libusb_request)) + { + USBERR0("get_device_property: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + status = reg_get_device_property( + dev->physical_device_object, + request->device_property.property, + output_buffer, + output_buffer_length, &ret); + break; + + case LIBUSB_IOCTL_GET_CUSTOM_REG_PROPERTY: + if (!input_buffer || (input_buffer_length < sizeof(libusb_request))) + { + USBERR0("get_custom_reg_property: invalid buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + status=reg_get_custom_property( + dev->physical_device_object, + input_buffer, + output_buffer_length, + request->device_registry_key.name_offset, + &ret); + break; + + case LIBUSB_IOCTL_GET_OBJECT_NAME: + if (!request || output_buffer_length < 2) + { + USBERR0("get_object_name: invalid output buffer\n"); + status = STATUS_INVALID_PARAMETER; + break; + } + switch (request->objname.objname_index) + { + case 0: + ret = (int)strlen(dev->objname_plugplay_registry_key)+1; + ret = ret > (int)output_buffer_length ? (int)output_buffer_length : ret; + RtlCopyMemory(output_buffer, dev->objname_plugplay_registry_key,(SIZE_T) (ret-1)); + output_buffer[ret-1]='\0'; + break; + default: + status = STATUS_INVALID_PARAMETER; + } + break; + + default: + + status = STATUS_INVALID_PARAMETER; + } +IOCTL_Done: + status = complete_irp(irp, status, ret); + remove_lock_release(dev); + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.c new file mode 100644 index 0000000..7edac44 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.c @@ -0,0 +1,748 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#define __LIBUSB_DRIVER_C__ + +#include "libusb_driver.h" +#include "libusb-win32_version.h" + +// Device objects with an attached device using the +// driver names listed here skipped in the add_device() routine. +// +const char* attached_driver_skip_list[] = +{ + "\\driver\\picopp", + "\\driver\\libusb0", + NULL +}; + +// Device objects with an attached device using the +// driver names listed here have wdf below them. Special +// restrictions apply to these devices. +// +const char* attached_driver_wdf_list[] = +{ + "\\driver\\winusb", + "\\driver\\wudfrd", + NULL +}; + +static bool_t match_driver(PDEVICE_OBJECT deviceObject, const char* driverString); + + +#ifdef DBG + +static void debug_show_devices(PDEVICE_OBJECT deviceObject, int index, bool_t showNextDevice) +{ + ANSI_STRING driverName; + + if (index > 16) return; + + if (deviceObject) + { + if (deviceObject->DriverObject) + { + if (NT_SUCCESS(RtlUnicodeStringToAnsiString(&driverName, &deviceObject->DriverObject->DriverName, TRUE))) + { + USBDBG("[%s #%d] %s\n", + (showNextDevice ? "NextDevice" : "AttachedDevice"), + index, driverName.Buffer); + RtlFreeAnsiString(&driverName); + } + } + if (deviceObject->AttachedDevice && !showNextDevice) + debug_show_devices(deviceObject->AttachedDevice, index+1, showNextDevice); + if (deviceObject->NextDevice && showNextDevice) + debug_show_devices(deviceObject->NextDevice, index+1, showNextDevice); + } +} +#endif + +static bool_t match_driver(PDEVICE_OBJECT deviceObject, const char* driverString) +{ + ANSI_STRING driverName; + bool_t ret = FALSE; + + if (deviceObject) + { + if (deviceObject->DriverObject) + { + if (NT_SUCCESS(RtlUnicodeStringToAnsiString(&driverName, &deviceObject->DriverObject->DriverName, TRUE))) + { + _strlwr(driverName.Buffer); + + if (strstr(driverName.Buffer,driverString)) + { + ret = TRUE; + } + RtlFreeAnsiString(&driverName); + } + } + } + + return ret; +} + +static void DDKAPI unload(DRIVER_OBJECT *driver_object); +static NTSTATUS DDKAPI on_usbd_complete(DEVICE_OBJECT *device_object, + IRP *irp, + void *context); + +NTSTATUS DDKAPI DriverEntry(DRIVER_OBJECT *driver_object, + UNICODE_STRING *registry_path) +{ + int i; + + USBMSG("[loading-driver] v%d.%d.%d.%d\n", + VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO, VERSION_NANO); + + /* initialize the driver object's dispatch table */ + for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) + { + driver_object->MajorFunction[i] = dispatch; + } + + driver_object->DriverExtension->AddDevice = add_device; + driver_object->DriverUnload = unload; + + return STATUS_SUCCESS; +} + +NTSTATUS DDKAPI add_device(DRIVER_OBJECT *driver_object, + DEVICE_OBJECT *physical_device_object) +{ + NTSTATUS status; + DEVICE_OBJECT *device_object = NULL; + libusb_device_t *dev; + ULONG device_type; + UNICODE_STRING nt_device_name; + UNICODE_STRING symbolic_link_name; + WCHAR tmp_name_0[128]; + WCHAR tmp_name_1[128]; + char id[256]; + char compat_id[256]; + int i; + DEVICE_OBJECT* attached_device; + bool_t has_wdf = FALSE; + + /* get the hardware ID from the registry */ + if (!reg_get_hardware_id(physical_device_object, id, sizeof(id))) + { + USBERR0("unable to read registry\n"); + return STATUS_SUCCESS; + } + + /* only attach the (filter) driver to USB devices, skip hubs */ + if (!strstr(id, "usb\\") || + strstr(id, "hub") || + !strstr(id, "vid_") || + !strstr(id, "pid_")) + { + USBDBG("skipping non-usb device or hub %s\n",id); + return STATUS_SUCCESS; + } + + if (!reg_get_compatible_id(physical_device_object, compat_id, sizeof(compat_id))) + { + USBERR0("unable to read registry\n"); + return STATUS_SUCCESS; + } + // Don't attach to usb device hubs + if (strstr(compat_id, "class_09")) + { + USBDBG("skipping usb device hub (%s) %s\n",compat_id, id); + return STATUS_SUCCESS; + } + +#ifdef DBG + debug_show_devices(physical_device_object->AttachedDevice, 0, FALSE); +#endif + + attached_device = physical_device_object->AttachedDevice; + while (attached_device) + { + // make sure this device isn't already using a driver that is + // incompatible with libusb-win32. + for (i=0; attached_driver_skip_list[i] != NULL; i++) + { + if (match_driver(attached_device, attached_driver_skip_list[i])) + { + USBDBG("skipping device %s\n", id); + return STATUS_SUCCESS; + } + } + + // look for wdf + for (i=0; attached_driver_wdf_list[i] != NULL; i++) + { + if (match_driver(attached_device, attached_driver_wdf_list[i])) + { + has_wdf = TRUE; + } + } + + attached_device=attached_device->AttachedDevice; + } + + device_object = IoGetAttachedDeviceReference(physical_device_object); + if (device_object) + { + device_type = device_object->DeviceType; + ObDereferenceObject(device_object); + } + else + { + device_type = FILE_DEVICE_UNKNOWN; + } + + /* try to create a new device object */ + for (i = 1; i < LIBUSB_MAX_NUMBER_OF_DEVICES; i++) + { + /* initialize some unicode strings */ + _snwprintf(tmp_name_0, sizeof(tmp_name_0)/sizeof(WCHAR), L"%s%04d", + LIBUSB_NT_DEVICE_NAME, i); + _snwprintf(tmp_name_1, sizeof(tmp_name_1)/sizeof(WCHAR), L"%s%04d", + LIBUSB_SYMBOLIC_LINK_NAME, i); + + RtlInitUnicodeString(&nt_device_name, tmp_name_0); + RtlInitUnicodeString(&symbolic_link_name, tmp_name_1); + + /* create the object */ + status = IoCreateDevice(driver_object, + sizeof(libusb_device_t), + &nt_device_name, device_type, 0, FALSE, + &device_object); + + if (NT_SUCCESS(status)) + { + USBMSG("device #%d created for %s\n", i, id); + break; + } + + device_object = NULL; + + /* continue until an unused device name is found */ + } + + if (!device_object) + { + USBERR0("creating device failed\n"); + return status; + } + + status = IoCreateSymbolicLink(&symbolic_link_name, &nt_device_name); + + if (!NT_SUCCESS(status)) + { + USBERR0("creating symbolic link failed\n"); + IoDeleteDevice(device_object); + return status; + } + + /* setup the "device object" */ + dev = device_object->DeviceExtension; + + memset(dev, 0, sizeof(libusb_device_t)); + + // [trobinso] See patch: 2873573 (Tim Green) + dev->self = device_object; + dev->physical_device_object = physical_device_object; + dev->id = i; + + // store the device id in the device extentions + RtlCopyMemory(dev->device_id, id, sizeof(dev->device_id)); + + /* set initial power states */ + dev->power_state.DeviceState = PowerDeviceD0; + dev->power_state.SystemState = PowerSystemWorking; + + dev->disallow_power_control = has_wdf; + + /* get device properties from the registry */ + if (!reg_get_properties(dev)) + { + USBERR0("getting device properties failed\n"); + IoDeleteSymbolicLink(&symbolic_link_name); + IoDeleteDevice(device_object); + return STATUS_SUCCESS; + } + + if (dev->is_filter && !physical_device_object->AttachedDevice) + { + USBWRN("[FILTER-MODE-MISMATCH] device is reporting itself as filter when there are no attached device(s).\n%s\n", id); + } + else if (!dev->is_filter && physical_device_object->AttachedDevice) + { + USBWRN("[FILTER-MODE-MISMATCH] device is reporting itself as normal when there are already attached device(s).\n%s\n", id); + //dev->is_filter = TRUE; + } + + clear_pipe_info(dev); + + remove_lock_initialize(dev); + + // make sure the the devices can't be removed + // before we are done adding it. + if (!NT_SUCCESS(remove_lock_acquire(dev))) + { + USBERR0("remove_lock_acquire failed\n"); + IoDeleteSymbolicLink(&symbolic_link_name); + IoDeleteDevice(device_object); + return STATUS_SUCCESS; + } + + /* attach the newly created device object to the stack */ + dev->next_stack_device = IoAttachDeviceToDeviceStack(device_object, physical_device_object); + + if (!dev->next_stack_device) + { + USBERR("attaching %s to device stack failed\n", id); + IoDeleteSymbolicLink(&symbolic_link_name); + IoDeleteDevice(device_object); + remove_lock_release(dev); // always release acquired locks + return STATUS_NO_SUCH_DEVICE; + } + + if (dev->is_filter) + { + USBDBG("[filter-mode] id=#%d %s\n",dev->id, dev->device_id); + + /* send all USB requests to the PDO in filter driver mode */ + dev->target_device = dev->physical_device_object; + + /* use the same flags as the underlying object */ + device_object->Flags |= dev->next_stack_device->Flags + & (DO_BUFFERED_IO | DO_DIRECT_IO | DO_POWER_PAGABLE); + + // use the same DeviceType as the underlying object + device_object->DeviceType = dev->next_stack_device->DeviceType; + + // use the same Characteristics as the underlying object + device_object->Characteristics = dev->next_stack_device->Characteristics; + } + else + { + USBDBG("[normal-mode] id=#%d %s\n",dev->id, dev->device_id); + + /* send all USB requests to the lower object in device driver mode */ + dev->target_device = dev->next_stack_device; + device_object->Flags |= DO_DIRECT_IO | DO_POWER_PAGABLE; + } + + device_object->Flags &= ~DO_DEVICE_INITIALIZING; + remove_lock_release(dev); + + USBMSG("complete status=%08X\n",status); + return status; +} + + +VOID DDKAPI unload(DRIVER_OBJECT *driver_object) +{ + USBMSG("[unloading-driver] v%d.%d.%d.%d\n", + VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO, VERSION_NANO); +} + +NTSTATUS complete_irp(IRP *irp, NTSTATUS status, ULONG info) +{ + irp->IoStatus.Status = status; + irp->IoStatus.Information = info; + IoCompleteRequest(irp, IO_NO_INCREMENT); + + return status; +} + +NTSTATUS call_usbd_ex(libusb_device_t *dev, void *urb, ULONG control_code, + int timeout, int max_timeout) +{ + KEVENT event; + NTSTATUS status; + IRP *irp; + IO_STACK_LOCATION *next_irp_stack; + LARGE_INTEGER _timeout; + IO_STATUS_BLOCK io_status; + + if (max_timeout > 0 && timeout > max_timeout) + { + timeout = max_timeout; + } + if (timeout <= 0) + timeout = LIBUSB_MAX_CONTROL_TRANSFER_TIMEOUT; + + KeInitializeEvent(&event, NotificationEvent, FALSE); + + irp = IoBuildDeviceIoControlRequest(control_code, dev->target_device, + NULL, 0, NULL, 0, TRUE, + NULL, &io_status); + + if (!irp) + { + return STATUS_NO_MEMORY; + } + + next_irp_stack = IoGetNextIrpStackLocation(irp); + next_irp_stack->Parameters.Others.Argument1 = urb; + next_irp_stack->Parameters.Others.Argument2 = NULL; + + IoSetCompletionRoutine(irp, on_usbd_complete, &event, TRUE, TRUE, TRUE); + + status = IoCallDriver(dev->target_device, irp); + if(status == STATUS_PENDING) + { + _timeout.QuadPart = -(timeout * 10000); + + if(KeWaitForSingleObject(&event, Executive, KernelMode, + FALSE, &_timeout) == STATUS_TIMEOUT) + { + USBERR0("request timed out\n"); + IoCancelIrp(irp); + } + } + + /* wait until completion routine is called */ + KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL); + + status = irp->IoStatus.Status; + + /* complete the request */ + IoCompleteRequest(irp, IO_NO_INCREMENT); + + USBDBG("status = %08Xh\n",status); + return status; +} + +static NTSTATUS DDKAPI on_usbd_complete(DEVICE_OBJECT *device_object, + IRP *irp, void *context) +{ + KeSetEvent((KEVENT *) context, IO_NO_INCREMENT, FALSE); + + return STATUS_MORE_PROCESSING_REQUIRED; +} + + +NTSTATUS pass_irp_down(libusb_device_t *dev, IRP *irp, + PIO_COMPLETION_ROUTINE completion_routine, + void *context) +{ + if (completion_routine) + { + IoCopyCurrentIrpStackLocationToNext(irp); + IoSetCompletionRoutine(irp, completion_routine, context, + TRUE, TRUE, TRUE); + } + else + { + IoSkipCurrentIrpStackLocation(irp); + } + + return IoCallDriver(dev->next_stack_device, irp); +} + +bool_t accept_irp(libusb_device_t *dev, IRP *irp) +{ + /* check if the IRP is sent to libusb's device object or to */ + /* the lower one. This check is neccassary since the device object */ + /* might be a filter */ + if (irp->Tail.Overlay.OriginalFileObject) + { + return irp->Tail.Overlay.OriginalFileObject->DeviceObject + == dev->self ? TRUE : FALSE; + } + + return FALSE; +} + +bool_t get_pipe_handle(libusb_device_t *dev, int endpoint_address, + USBD_PIPE_HANDLE *pipe_handle) +{ + int i, j; + + *pipe_handle = NULL; + + for (i = 0; i < LIBUSB_MAX_NUMBER_OF_INTERFACES; i++) + { + if (dev->config.interfaces[i].valid) + { + for (j = 0; j < LIBUSB_MAX_NUMBER_OF_ENDPOINTS; j++) + { + if (dev->config.interfaces[i].endpoints[j].address + == endpoint_address) + { + *pipe_handle = dev->config.interfaces[i].endpoints[j].handle; + + return !*pipe_handle ? FALSE : TRUE; + } + } + } + } + + return FALSE; +} + +bool_t get_pipe_info(libusb_device_t *dev, int endpoint_address, + libusb_endpoint_t** pipe_info) +{ + int i, j; + + *pipe_info = NULL; + + for (i = 0; i < LIBUSB_MAX_NUMBER_OF_INTERFACES; i++) + { + if (dev->config.interfaces[i].valid) + { + for (j = 0; j < LIBUSB_MAX_NUMBER_OF_ENDPOINTS; j++) + { + if (dev->config.interfaces[i].endpoints[j].address + == endpoint_address) + { + *pipe_info = &dev->config.interfaces[i].endpoints[j]; + + return !*pipe_info ? FALSE : TRUE; + } + } + } + } + + return FALSE; +} + +void clear_pipe_info(libusb_device_t *dev) +{ + memset(dev->config.interfaces, 0 , sizeof(dev->config.interfaces)); +} + +bool_t update_pipe_info(libusb_device_t *dev, + USBD_INTERFACE_INFORMATION *interface_info) +{ + int i; + int number; + int maxTransferSize; + int maxPacketSize; + + if (!interface_info) + { + return FALSE; + } + + number = interface_info->InterfaceNumber; + + if (interface_info->InterfaceNumber >= LIBUSB_MAX_NUMBER_OF_INTERFACES) + { + return FALSE; + } + + USBMSG("interface %d\n", number); + + dev->config.interfaces[number].valid = TRUE; + + for (i = 0; i < LIBUSB_MAX_NUMBER_OF_ENDPOINTS; i++) + { + dev->config.interfaces[number].endpoints[i].address = 0; + dev->config.interfaces[number].endpoints[i].handle = NULL; + } + + if (interface_info) + { + for (i = 0; i < (int)interface_info->NumberOfPipes + && i < LIBUSB_MAX_NUMBER_OF_ENDPOINTS; i++) + { + maxPacketSize = interface_info->Pipes[i].MaximumPacketSize; + maxTransferSize = interface_info->Pipes[i].MaximumTransferSize; + + USBMSG("EP%02Xh maximum-packet-size=%d maximum-transfer-size=%d\n", + interface_info->Pipes[i].EndpointAddress, + maxPacketSize, + maxTransferSize); + + dev->config.interfaces[number].endpoints[i].handle = interface_info->Pipes[i].PipeHandle; + dev->config.interfaces[number].endpoints[i].address = interface_info->Pipes[i].EndpointAddress; + dev->config.interfaces[number].endpoints[i].maximum_packet_size = maxPacketSize; + dev->config.interfaces[number].endpoints[i].interval = interface_info->Pipes[i].Interval; + dev->config.interfaces[number].endpoints[i].pipe_type = interface_info->Pipes[i].PipeType; + dev->config.interfaces[number].endpoints[i].pipe_flags = interface_info->Pipes[i].PipeFlags; + + if (maxPacketSize) + { + // set max the maximum transfer size default to an interval of max packet size. + maxTransferSize = maxTransferSize - (maxTransferSize % maxPacketSize); + if (maxTransferSize < maxPacketSize) + { + maxTransferSize = LIBUSB_MAX_READ_WRITE; + } + else if (maxTransferSize > LIBUSB_MAX_READ_WRITE) + { + maxTransferSize = LIBUSB_MAX_READ_WRITE - (LIBUSB_MAX_READ_WRITE % maxPacketSize); + } + + if (maxTransferSize != interface_info->Pipes[i].MaximumTransferSize) + { + USBWRN("overriding EP%02Xh maximum-transfer-size=%d\n", + dev->config.interfaces[number].endpoints[i].address, + maxTransferSize); + } + } + else + { + if (!maxTransferSize) + { + // use the libusb-win32 default + maxTransferSize = LIBUSB_MAX_READ_WRITE; + } + } + dev->config.interfaces[number].endpoints[i].maximum_transfer_size = maxTransferSize; + } + } + return TRUE; +} + + +void remove_lock_initialize(libusb_device_t *dev) +{ + KeInitializeEvent(&dev->remove_lock.event, NotificationEvent, FALSE); + dev->remove_lock.usage_count = 1; + dev->remove_lock.remove_pending = FALSE; +} + + +NTSTATUS remove_lock_acquire(libusb_device_t *dev) +{ + InterlockedIncrement(&dev->remove_lock.usage_count); + + if (dev->remove_lock.remove_pending) + { + if (InterlockedDecrement(&dev->remove_lock.usage_count) == 0) + { + KeSetEvent(&dev->remove_lock.event, 0, FALSE); + } + return STATUS_DELETE_PENDING; + } + return STATUS_SUCCESS; +} + + +void remove_lock_release(libusb_device_t *dev) +{ + if (InterlockedDecrement(&dev->remove_lock.usage_count) == 0) + { + KeSetEvent(&dev->remove_lock.event, 0, FALSE); + } +} + + +void remove_lock_release_and_wait(libusb_device_t *dev) +{ + dev->remove_lock.remove_pending = TRUE; + remove_lock_release(dev); + remove_lock_release(dev); + KeWaitForSingleObject(&dev->remove_lock.event, Executive, KernelMode, + FALSE, NULL); +} + + +USB_INTERFACE_DESCRIPTOR * +find_interface_desc(USB_CONFIGURATION_DESCRIPTOR *config_desc, + unsigned int size, int interface_number, int altsetting) +{ + usb_descriptor_header_t *desc = (usb_descriptor_header_t *)config_desc; + char *p = (char *)desc; + USB_INTERFACE_DESCRIPTOR *if_desc = NULL; + + if (!config_desc || (size < config_desc->wTotalLength)) + return NULL; + + while (size && desc->length <= size) + { + if (desc->type == USB_INTERFACE_DESCRIPTOR_TYPE) + { + if_desc = (USB_INTERFACE_DESCRIPTOR *)desc; + + if ((if_desc->bInterfaceNumber == (UCHAR)interface_number) + && (if_desc->bAlternateSetting == (UCHAR)altsetting)) + { + return if_desc; + } + } + + size -= desc->length; + p += desc->length; + desc = (usb_descriptor_header_t *)p; + } + + return NULL; +} +ULONG get_current_frame(IN PDEVICE_EXTENSION deviceExtension, IN PIRP Irp) +/*++ + +Routine Description: + + This routine send an irp/urb pair with + function code URB_FUNCTION_GET_CURRENT_FRAME_NUMBER + to fetch the current frame + +Arguments: + + DeviceObject - pointer to device object + PIRP - I/O request packet + +Return Value: + + Current frame + +--*/ +{ + KEVENT event; + PIO_STACK_LOCATION nextStack; + struct _URB_GET_CURRENT_FRAME_NUMBER urb; + + // + // initialize the urb + // + + urb.Hdr.Function = URB_FUNCTION_GET_CURRENT_FRAME_NUMBER; + urb.Hdr.Length = sizeof(urb); + urb.FrameNumber = (ULONG) -1; + + nextStack = IoGetNextIrpStackLocation(Irp); + nextStack->Parameters.Others.Argument1 = (PVOID) &urb; + nextStack->Parameters.DeviceIoControl.IoControlCode = + IOCTL_INTERNAL_USB_SUBMIT_URB; + nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; + + KeInitializeEvent(&event, + NotificationEvent, + FALSE); + + IoSetCompletionRoutine(Irp, + on_usbd_complete, + &event, + TRUE, + TRUE, + TRUE); + + + IoCallDriver(deviceExtension->target_device, Irp); + + KeWaitForSingleObject((PVOID) &event, + Executive, + KernelMode, + FALSE, + NULL); + + return urb.FrameNumber; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.h new file mode 100644 index 0000000..66047ff --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver.h @@ -0,0 +1,334 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#ifndef __LIBUSB_DRIVER_H__ +#define __LIBUSB_DRIVER_H__ + +//#define SKIP_CONFIGURE_NORMAL_DEVICES +//#define SKIP_DEVICES_WINUSB +//#define SKIP_DEVICES_PICOPP + +#ifdef __GNUC__ +#include +#include +#include +#include "usbdlib_gcc.h" +#else +#include +#include +#include "usbdi.h" +#include "usbdlib.h" +#endif + +#include +#include + +#undef interface + +#include "driver_debug.h" +#include "error.h" +#include "driver_api.h" + +/* some missing defines */ +#ifdef __GNUC__ + +#define USBD_TRANSFER_DIRECTION_OUT 0 +#define USBD_TRANSFER_DIRECTION_BIT 0 +#define USBD_TRANSFER_DIRECTION_IN (1 << USBD_TRANSFER_DIRECTION_BIT) +#define USBD_SHORT_TRANSFER_OK_BIT 1 +#define USBD_SHORT_TRANSFER_OK (1 << USBD_SHORT_TRANSFER_OK_BIT) +#define USBD_START_ISO_TRANSFER_ASAP_BIT 2 +#define USBD_START_ISO_TRANSFER_ASAP (1 << USBD_START_ISO_TRANSFER_ASAP_BIT) + +#endif + +#define SET_CONFIG_ACTIVE_CONFIG -258 + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +#define USB_TYPE_STANDARD 0x00 +#define USB_TYPE_CLASS 0x01 +#define USB_TYPE_VENDOR 0x02 + + +#define LIBUSB_NT_DEVICE_NAME L"\\Device\\libusb0" +#define LIBUSB_SYMBOLIC_LINK_NAME L"\\DosDevices\\libusb0-" + +#define LIBUSB_MAX_NUMBER_OF_ENDPOINTS 32 +#define LIBUSB_MAX_NUMBER_OF_INTERFACES 32 + + +#define LIBUSB_DEFAULT_TIMEOUT 5000 +#define LIBUSB_MAX_CONTROL_TRANSFER_TIMEOUT 5000 + + +#ifndef __GNUC__ +#define DDKAPI +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE (!(FALSE)) +#endif + +typedef int bool_t; + +#define IS_PIPE_TYPE(pipeInfo, pipeType) ((pipeInfo->pipe_type & 3)==pipeType) + +#define IS_CTRL_PIPE(pipeInfo) IS_PIPE_TYPE(pipeInfo,UsbdPipeTypeControl) +#define IS_ISOC_PIPE(pipeInfo) IS_PIPE_TYPE(pipeInfo,UsbdPipeTypeIsochronous) +#define IS_BULK_PIPE(pipeInfo) IS_PIPE_TYPE(pipeInfo,UsbdPipeTypeBulk) +#define IS_INTR_PIPE(pipeInfo) IS_PIPE_TYPE(pipeInfo,UsbdPipeTypeInterrupt) + +#define GetMaxTransferSize(pipeInfo, reqMaxTransferSize) ((reqMaxTransferSize) ? reqMaxTransferSize : pipeInfo->maximum_transfer_size) + +#define UrbFunctionFromEndpoint(PipeInfo) ((IS_ISOC_PIPE(PipeInfo)) ? URB_FUNCTION_ISOCH_TRANSFER : URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) +#define UsbdDirectionFromEndpoint(PipeInfo) ((PipeInfo->address & 0x80) ? USBD_TRANSFER_DIRECTION_IN : USBD_TRANSFER_DIRECTION_OUT) + +#include + +typedef struct +{ + unsigned char length; + unsigned char type; +} usb_descriptor_header_t; + +#include + + +typedef struct +{ + long usage_count; + int remove_pending; + KEVENT event; +} libusb_remove_lock_t; + +typedef struct +{ + int address; + USBD_PIPE_HANDLE handle; + int maximum_packet_size; // Maximum packet size for this pipe + int interval; // Polling interval in ms if interrupt pipe + USBD_PIPE_TYPE pipe_type; // PipeType identifies type of transfer valid for this pipe + + // + // INPUT + // These fields are filled in by the client driver + // + int maximum_transfer_size; // Maximum size for a single request + // in bytes. + int pipe_flags; +} libusb_endpoint_t; + +typedef struct +{ + bool_t valid; + FILE_OBJECT *file_object; /* file object this interface is bound to */ + libusb_endpoint_t endpoints[LIBUSB_MAX_NUMBER_OF_ENDPOINTS]; + +} libusb_interface_t; + + +typedef struct +{ + DEVICE_OBJECT *self; + DEVICE_OBJECT *physical_device_object; + DEVICE_OBJECT *next_stack_device; + DEVICE_OBJECT *target_device; + libusb_remove_lock_t remove_lock; + bool_t is_filter; + bool_t is_started; + bool_t surprise_removal_ok; + int id; + struct + { + USBD_CONFIGURATION_HANDLE handle; + int value; + int index; + libusb_interface_t interfaces[LIBUSB_MAX_NUMBER_OF_INTERFACES]; + } config; + POWER_STATE power_state; + DEVICE_POWER_STATE device_power_states[PowerSystemMaximum]; + int initial_config_value; + char device_id[256]; + bool_t disallow_power_control; + char objname_plugplay_registry_key[512]; + +} libusb_device_t, DEVICE_EXTENSION, *PDEVICE_EXTENSION; + + +NTSTATUS DDKAPI add_device(DRIVER_OBJECT *driver_object, + DEVICE_OBJECT *physical_device_object); + +NTSTATUS DDKAPI dispatch(DEVICE_OBJECT *device_object, IRP *irp); +NTSTATUS dispatch_pnp(libusb_device_t *dev, IRP *irp); +NTSTATUS dispatch_power(libusb_device_t *dev, IRP *irp); +NTSTATUS dispatch_ioctl(libusb_device_t *dev, IRP *irp); + +NTSTATUS complete_irp(IRP *irp, NTSTATUS status, ULONG info); + +#define call_usbd(dev, urb, control_code, timeout) \ + call_usbd_ex(dev, urb, control_code, timeout, LIBUSB_MAX_CONTROL_TRANSFER_TIMEOUT) + +NTSTATUS call_usbd_ex(libusb_device_t *dev, + void *urb, + ULONG control_code, + int timeout, + int max_timeout); + +NTSTATUS pass_irp_down(libusb_device_t *dev, IRP *irp, + PIO_COMPLETION_ROUTINE completion_routine, + void *context); + +bool_t accept_irp(libusb_device_t *dev, IRP *irp); + +bool_t get_pipe_handle(libusb_device_t *dev, int endpoint_address, + USBD_PIPE_HANDLE *pipe_handle); + +bool_t get_pipe_info(libusb_device_t *dev, int endpoint_address, + libusb_endpoint_t** pipe_info); + +void clear_pipe_info(libusb_device_t *dev); +bool_t update_pipe_info(libusb_device_t *dev, + USBD_INTERFACE_INFORMATION *interface_info); + +void remove_lock_initialize(libusb_device_t *dev); +NTSTATUS remove_lock_acquire(libusb_device_t *dev); +void remove_lock_release(libusb_device_t *dev); +void remove_lock_release_and_wait(libusb_device_t *dev); + +NTSTATUS set_configuration(libusb_device_t *dev, + int configuration, int timeout); +NTSTATUS auto_configure(libusb_device_t *dev); + +NTSTATUS get_configuration(libusb_device_t *dev, + unsigned char *configuration, int *ret, + int timeout); + + +NTSTATUS set_interface(libusb_device_t *dev, + int interface, int altsetting, int timeout); +NTSTATUS get_interface(libusb_device_t *dev, + int interface, unsigned char *altsetting, + int *ret, int timeout); +NTSTATUS set_feature(libusb_device_t *dev, + int recipient, int index, int feature, int timeout); +NTSTATUS clear_feature(libusb_device_t *dev, + int recipient, int index, int feature, int timeout); +NTSTATUS get_status(libusb_device_t *dev, int recipient, + int index, char *status, int *ret, int timeout); +NTSTATUS set_descriptor(libusb_device_t *dev, + void *buffer, int size, + int type, int recipient, int index, int language_id, + int *sent, int timeout); +NTSTATUS get_descriptor(libusb_device_t *dev, void *buffer, int size, + int type, int recipient, int index, int language_id, + int *received, int timeout); + +PUSB_CONFIGURATION_DESCRIPTOR get_config_descriptor( + libusb_device_t *dev, + int value, + int *size, + int* index); + +NTSTATUS vendor_class_request(libusb_device_t *dev, + int type, int recipient, + int request, int value, int index, + void *buffer, int size, int direction, + int *ret, int timeout); + +NTSTATUS abort_endpoint(libusb_device_t *dev, int endpoint, int timeout); +NTSTATUS reset_endpoint(libusb_device_t *dev, int endpoint, int timeout); +NTSTATUS reset_device(libusb_device_t *dev, int timeout); + +NTSTATUS claim_interface(libusb_device_t *dev, FILE_OBJECT *file_object, + int interface); +NTSTATUS release_interface(libusb_device_t *dev, FILE_OBJECT *file_object, + int interface); +NTSTATUS release_all_interfaces(libusb_device_t *dev, + FILE_OBJECT *file_object); + + +bool_t reg_get_hardware_id(DEVICE_OBJECT *physical_device_object, + char *data, int size); +bool_t reg_get_compatible_id(DEVICE_OBJECT *physical_device_object, + char *data, int size); + +bool_t reg_get_properties(libusb_device_t *dev); + + +void power_set_device_state(libusb_device_t *dev, + DEVICE_POWER_STATE device_state, bool_t block); + +USB_INTERFACE_DESCRIPTOR * +find_interface_desc(USB_CONFIGURATION_DESCRIPTOR *config_desc, + unsigned int size, int interface_number, int altsetting); + +/* +Gets a device property for the device_object. + +Returns: NTSTATUS code from IoGetDeviceProperty + STATUS_INVALID_PARAMETER +*/ +NTSTATUS reg_get_device_property(PDEVICE_OBJECT device_object, + int property, + char* data_buffer, + int data_length, + int* actual_length); + +NTSTATUS reg_get_custom_property(PDEVICE_OBJECT device_object, + char *data_buffer, + unsigned int data_length, + unsigned int name_offset, + int* actual_length); + + +NTSTATUS transfer(libusb_device_t* dev, + IN PIRP irp, + IN int direction, + IN int urbFunction, + IN libusb_endpoint_t* endpoint, + IN int packetSize, + IN int maxTransferSize, + IN int transferFlags, + IN int isoLatency, + IN PMDL mdlAddress, + IN int totalLength); + +NTSTATUS large_transfer(IN libusb_device_t* dev, + IN PIRP irp, + IN int direction, + IN int urbFunction, + IN libusb_endpoint_t* endpoint, + IN int packetSize, + IN int maxTransferSize, + IN int transferFlags, + IN int isoLatency, + IN PMDL mdlAddress, + IN int totalLength); + +ULONG get_current_frame(IN PDEVICE_EXTENSION dev, IN PIRP Irp); + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver_rc.rc new file mode 100644 index 0000000..91099ec --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/libusb_driver_rc.rc @@ -0,0 +1,25 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define RC_FILE_TYPE VFT_DRV +#define RC_FILE_SUB_TYPE VFT2_DRV_SYSTEM +#define RC_PRODUCT_STR "LibUSB-Win32 - Kernel Driver" +#define RC_FILE_NAME_STR "libusb0.sys" + +#include "libusb-win32_version.rc" + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/pnp.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/pnp.c new file mode 100644 index 0000000..e3decae --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/pnp.c @@ -0,0 +1,263 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +static NTSTATUS DDKAPI +on_start_complete(DEVICE_OBJECT *device_object, IRP *irp, + void *context); + +static NTSTATUS DDKAPI +on_device_usage_notification_complete(DEVICE_OBJECT *device_object, + IRP *irp, void *context); + +static NTSTATUS DDKAPI +on_query_capabilities_complete(DEVICE_OBJECT *device_object, + IRP *irp, void *context); + + +NTSTATUS dispatch_pnp(libusb_device_t *dev, IRP *irp) +{ + NTSTATUS status = STATUS_SUCCESS; + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + UNICODE_STRING symbolic_link_name; + WCHAR tmp_name[128]; + + status = remove_lock_acquire(dev); + + if (!NT_SUCCESS(status)) + { + USBDBG("device %s is pending removal\n",dev->device_id); + return complete_irp(irp, status, 0); + } + + switch (stack_location->MinorFunction) + { + case IRP_MN_REMOVE_DEVICE: + + dev->is_started = FALSE; + + USBMSG("IRP_MN_REMOVE_DEVICE: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + + /* wait until all outstanding requests are finished */ + remove_lock_release_and_wait(dev); + + status = pass_irp_down(dev, irp, NULL, NULL); + + USBMSG("deleting device #%d %s\n", dev->id, dev->device_id); + + _snwprintf(tmp_name, sizeof(tmp_name)/sizeof(WCHAR), L"%s%04d", + LIBUSB_SYMBOLIC_LINK_NAME, dev->id); + + /* delete the symbolic link */ + RtlInitUnicodeString(&symbolic_link_name, tmp_name); + IoDeleteSymbolicLink(&symbolic_link_name); + + /* delete the device object */ + IoDetachDevice(dev->next_stack_device); + IoDeleteDevice(dev->self); + + return status; + + case IRP_MN_SURPRISE_REMOVAL: + + dev->is_started = FALSE; + USBMSG("IRP_MN_SURPRISE_REMOVAL: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + break; + + case IRP_MN_START_DEVICE: + USBMSG("IRP_MN_START_DEVICE: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + + // A driver calls this routine after receiving a device set-power + // request and before calling PoStartNextPowerIrp. When handling a + // PnP IRP_MN_START_DEVICE request, the driver should call + // PoSetPowerState to notify the power manager that the device is + // in the D0 state. + // + PoSetPowerState(dev->self, DevicePowerState, dev->power_state); + + return pass_irp_down(dev, irp, on_start_complete, NULL); + + case IRP_MN_STOP_DEVICE: + dev->is_started = FALSE; + USBDBG("IRP_MN_STOP_DEVICE: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + break; + + case IRP_MN_DEVICE_USAGE_NOTIFICATION: + USBDBG("IRP_MN_DEVICE_USAGE_NOTIFICATION: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + + if (!dev->self->AttachedDevice + || (dev->self->AttachedDevice->Flags & DO_POWER_PAGABLE)) + { + dev->self->Flags |= DO_POWER_PAGABLE; + } + + return pass_irp_down(dev, irp, on_device_usage_notification_complete, NULL); + + case IRP_MN_QUERY_CAPABILITIES: + USBDBG("IRP_MN_QUERY_CAPABILITIES: is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + + if (!dev->is_filter) + { + /* apply registry setting */ + stack_location->Parameters.DeviceCapabilities.Capabilities->SurpriseRemovalOK = dev->surprise_removal_ok; + } + + return pass_irp_down(dev, irp, on_query_capabilities_complete, NULL); + + default: + break; + + } + + remove_lock_release(dev); + return pass_irp_down(dev, irp, NULL, NULL); +} + +static NTSTATUS DDKAPI +on_start_complete(DEVICE_OBJECT *device_object, IRP *irp, void *context) +{ + libusb_device_t *dev = device_object->DeviceExtension; + + if (irp->PendingReturned) + { + IoMarkIrpPending(irp); + } + + USBDBG("is-filter=%c %s\n", + dev->is_filter ? 'Y' : 'N', + dev->device_id); + + if (dev->next_stack_device->Characteristics & FILE_REMOVABLE_MEDIA) + { + device_object->Characteristics |= FILE_REMOVABLE_MEDIA; + } +#ifndef SKIP_CONFIGURE_NORMAL_DEVICES + // select initial configuration if not a filter + if (!dev->is_filter && !dev->is_started) + { + // optionally, the initial configuration value can be specified + // in the inf file. See reg_get_properties() + // HKR,,"InitialConfigValue",0x00010001, + + // If initial_config_value is negative, the configuration will + // only be set if the device is not already configured. + if (dev->initial_config_value) + { + if (dev->initial_config_value == SET_CONFIG_ACTIVE_CONFIG) + { + USBDBG("applying active configuration for %s\n", + dev->device_id); + } + else + { + USBDBG("applying InitialConfigValue %d for %s\n", + dev->initial_config_value, dev->device_id); + } + + if(!NT_SUCCESS(set_configuration(dev, dev->initial_config_value, LIBUSB_DEFAULT_TIMEOUT))) + { + // we should always be able to apply the active configuration, + // even in the case of composite devices. + if (dev->initial_config_value == SET_CONFIG_ACTIVE_CONFIG) + { + USBERR("failed applying active configuration for %s\n", + dev->device_id); + } + else + { + USBERR("failed applying InitialConfigValue %d for %s\n", + dev->initial_config_value, dev->device_id); + } + } + } + } +#endif + dev->is_started = TRUE; + remove_lock_release(dev); + + return STATUS_SUCCESS; +} + +static NTSTATUS DDKAPI +on_device_usage_notification_complete(DEVICE_OBJECT *device_object, + IRP *irp, void *context) +{ + libusb_device_t *dev = device_object->DeviceExtension; + + if (irp->PendingReturned) + { + IoMarkIrpPending(irp); + } + + if (!(dev->next_stack_device->Flags & DO_POWER_PAGABLE)) + { + device_object->Flags &= ~DO_POWER_PAGABLE; + } + + remove_lock_release(dev); + + return STATUS_SUCCESS; +} + +static NTSTATUS DDKAPI +on_query_capabilities_complete(DEVICE_OBJECT *device_object, + IRP *irp, void *context) +{ + libusb_device_t *dev = device_object->DeviceExtension; + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + + if (irp->PendingReturned) + { + IoMarkIrpPending(irp); + } + + if (NT_SUCCESS(irp->IoStatus.Status)) + { + if (!dev->is_filter) + { + /* apply registry setting */ + stack_location->Parameters.DeviceCapabilities.Capabilities + ->SurpriseRemovalOK = dev->surprise_removal_ok; + } + + /* save supported device power states */ + memcpy(dev->device_power_states, stack_location + ->Parameters.DeviceCapabilities.Capabilities->DeviceState, + sizeof(dev->device_power_states)); + } + + remove_lock_release(dev); + + return STATUS_SUCCESS; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/power.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/power.c new file mode 100644 index 0000000..c5d8f9d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/power.c @@ -0,0 +1,269 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + +static NTSTATUS DDKAPI +on_power_state_complete(DEVICE_OBJECT *device_object, + IRP *irp, + void *context); + +static NTSTATUS DDKAPI +on_filter_power_state_complete(DEVICE_OBJECT *device_object, + IRP *irp, + void *context); + +static void DDKAPI +on_power_set_device_state_complete(DEVICE_OBJECT *device_object, + UCHAR minor_function, + POWER_STATE power_state, + void *context, + IO_STATUS_BLOCK *io_status); + +/* [trobinso MOD 4/16/2010] + * If running as a filter, do not act as power policy owner. + */ +NTSTATUS dispatch_power(libusb_device_t *dev, IRP *irp) +{ + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + POWER_STATE power_state; + NTSTATUS status; + + status = remove_lock_acquire(dev); + + if (!NT_SUCCESS(status)) + { + irp->IoStatus.Status = status; + PoStartNextPowerIrp(irp); + IoCompleteRequest(irp, IO_NO_INCREMENT); + return status; + } + + if (stack_location->MinorFunction == IRP_MN_SET_POWER) + { + power_state = stack_location->Parameters.Power.State; + + if (stack_location->Parameters.Power.Type == SystemPowerState) + { + USBMSG("IRP_MN_SET_POWER: S%d %s\n", + power_state.SystemState - PowerSystemWorking, dev->device_id); + } + else + { + USBMSG("IRP_MN_SET_POWER: D%d %s\n", + power_state.DeviceState - PowerDeviceD0, dev->device_id); + + if (power_state.DeviceState > dev->power_state.DeviceState) + { + /* device is powered down, report device state to the */ + /* Power Manager before sending the IRP down */ + /* (power up is handled by the completion routine) */ + PoSetPowerState(dev->self, DevicePowerState, power_state); + } + } + + /* TODO: should PoStartNextPowerIrp() be called here or from the */ + /* completion routine? */ + PoStartNextPowerIrp(irp); + + IoCopyCurrentIrpStackLocationToNext(irp); + if (!dev->is_filter && !dev->disallow_power_control) + { + IoSetCompletionRoutine(irp, + on_power_state_complete, + dev, + TRUE, /* on success */ + TRUE, /* on error */ + TRUE);/* on cancel */ + } + else + { + IoSetCompletionRoutine(irp, + on_filter_power_state_complete, + dev, + TRUE, /* on success */ + TRUE, /* on error */ + TRUE);/* on cancel */ + } + + return PoCallDriver(dev->next_stack_device, irp); + } + else + { + /* pass all other power IRPs down without setting a completion routine */ + PoStartNextPowerIrp(irp); + IoSkipCurrentIrpStackLocation(irp); + status = PoCallDriver(dev->next_stack_device, irp); + remove_lock_release(dev); + + return status; + } +} + + +static NTSTATUS DDKAPI +on_power_state_complete(DEVICE_OBJECT *device_object, + IRP *irp, + void *context) +{ + libusb_device_t *dev = context; + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + POWER_STATE power_state = stack_location->Parameters.Power.State; + DEVICE_POWER_STATE dev_power_state; + + if (irp->PendingReturned) + { + IoMarkIrpPending(irp); + } + + if (NT_SUCCESS(irp->IoStatus.Status)) + { + if (stack_location->Parameters.Power.Type == SystemPowerState) + { + USBMSG("S%d %s\n", + power_state.SystemState - PowerSystemWorking, dev->device_id); + + /* save current system state */ + dev->power_state.SystemState = power_state.SystemState; + + /* get supported device power state from the array reported by */ + /* IRP_MN_QUERY_CAPABILITIES */ + dev_power_state = dev->device_power_states[power_state.SystemState]; + + /* set the device power state, but don't block the thread */ + power_set_device_state(dev, dev_power_state, FALSE); + } + else /* DevicePowerState */ + { + USBMSG("D%d %s\n", + power_state.DeviceState - PowerDeviceD0, dev->device_id); + + if (power_state.DeviceState <= dev->power_state.DeviceState) + { + /* device is powered up, */ + /* report device state to Power Manager */ + PoSetPowerState(dev->self, DevicePowerState, power_state); + } + /* save current device state */ + dev->power_state.DeviceState = power_state.DeviceState; + } + } + else + { + USBMSG0("failed\n"); + } + + remove_lock_release(dev); + + return STATUS_SUCCESS; +} + +static NTSTATUS DDKAPI +on_filter_power_state_complete(DEVICE_OBJECT *device_object, + IRP *irp, + void *context) +{ + libusb_device_t *dev = context; + IO_STACK_LOCATION *stack_location = IoGetCurrentIrpStackLocation(irp); + POWER_STATE power_state = stack_location->Parameters.Power.State; + + if (NT_SUCCESS(irp->IoStatus.Status)) + { + if (stack_location->Parameters.Power.Type == SystemPowerState) + { + USBMSG("S%d\n", + power_state.SystemState - PowerSystemWorking); + + /* save current system state */ + dev->power_state.SystemState = power_state.SystemState; + + + } + else /* DevicePowerState */ + { + USBMSG("D%d\n", + power_state.DeviceState - PowerDeviceD0); + + if (power_state.DeviceState <= dev->power_state.DeviceState) + { + /* device is powered up, */ + /* report device state to Power Manager */ + PoSetPowerState(dev->self, DevicePowerState, power_state); + } + + /* save current device state */ + dev->power_state.DeviceState = power_state.DeviceState; + } + } + else + { + USBMSG0("failed\n"); + } + + remove_lock_release(dev); + + return STATUS_SUCCESS; +} + +static void DDKAPI +on_power_set_device_state_complete(DEVICE_OBJECT *device_object, + UCHAR minor_function, + POWER_STATE power_state, + void *context, + IO_STATUS_BLOCK *io_status) +{ + KeSetEvent((KEVENT *)context, EVENT_INCREMENT, FALSE); +} + + +void power_set_device_state(libusb_device_t *dev, + DEVICE_POWER_STATE device_state, bool_t block) +{ + NTSTATUS status; + KEVENT event; + POWER_STATE power_state; + + power_state.DeviceState = device_state; + + USBMSG("setting device power state to D%d %s\n", + power_state.DeviceState - PowerDeviceD0, dev->device_id); + + if (block) /* wait for IRP to complete */ + { + KeInitializeEvent(&event, NotificationEvent, FALSE); + + /* set the device power state and wait for completion */ + status = PoRequestPowerIrp(dev->physical_device_object, + IRP_MN_SET_POWER, + power_state, + on_power_set_device_state_complete, + &event, NULL); + + if (status == STATUS_PENDING) + { + KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL); + } + } + else + { + PoRequestPowerIrp(dev->physical_device_object, IRP_MN_SET_POWER, + power_state, NULL, NULL, NULL); + } +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/release_interface.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/release_interface.c new file mode 100644 index 0000000..0466894 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/release_interface.c @@ -0,0 +1,80 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS release_interface(libusb_device_t *dev, FILE_OBJECT *file_object, + int interface) +{ + USBMSG("interface %d\n", interface); + + if (!dev->config.value) + { + USBERR0("device is not configured\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + if (interface >= LIBUSB_MAX_NUMBER_OF_INTERFACES) + { + USBERR("interface number %d too high\n", + interface); + return STATUS_INVALID_PARAMETER; + } + + if (!dev->config.interfaces[interface].valid) + { + USBERR("invalid interface %02d\n", interface); + return STATUS_INVALID_PARAMETER; + } + + if (!dev->config.interfaces[interface].file_object) + { + USBERR("could not release interface %d, interface is not claimed\n", interface); + return STATUS_INVALID_DEVICE_STATE; + } + + if (dev->config.interfaces[interface].file_object != file_object) + { + USBERR("could not release interface %d, interface is not bound to this file object\n", interface); + return STATUS_DEVICE_BUSY; + } + + dev->config.interfaces[interface].file_object = NULL; + + return STATUS_SUCCESS; +} + +NTSTATUS release_all_interfaces(libusb_device_t *dev, FILE_OBJECT *file_object) +{ + int i; + + USBMSG("releasing all interfaces bound to file object 0x%x\n", file_object); + + for (i = 0; i < LIBUSB_MAX_NUMBER_OF_INTERFACES; i++) + { + if (dev->config.interfaces[i].file_object == file_object) + { + dev->config.interfaces[i].file_object = NULL; + } + } + + return STATUS_SUCCESS; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_device.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_device.c new file mode 100644 index 0000000..5f83d65 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_device.c @@ -0,0 +1,44 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + +NTSTATUS reset_device(libusb_device_t *dev, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + + USBMSG0("resetting device\n"); + + status = call_usbd(dev, NULL, IOCTL_INTERNAL_USB_RESET_PORT, timeout); + + if (!NT_SUCCESS(status)) + { + USBERR("IOCTL_INTERNAL_USB_RESET_PORT failed: status: 0x%x\n", status); + } + + status = call_usbd(dev, NULL, IOCTL_INTERNAL_USB_CYCLE_PORT, timeout); + + if (!NT_SUCCESS(status)) + { + USBERR("IOCTL_INTERNAL_USB_CYCLE_PORT failed: status: 0x%x\n", status); + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_endpoint.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_endpoint.c new file mode 100644 index 0000000..e2c472a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/reset_endpoint.c @@ -0,0 +1,56 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS reset_endpoint(libusb_device_t *dev, int endpoint, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("endpoint: 0x%02x timeout: %d\n", endpoint, timeout); + + if (!dev->config.value) + { + USBERR0("invalid configuration 0\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + memset(&urb, 0, sizeof(struct _URB_PIPE_REQUEST)); + + urb.UrbHeader.Length = (USHORT) sizeof(struct _URB_PIPE_REQUEST); + urb.UrbHeader.Function = URB_FUNCTION_RESET_PIPE; + + if (!get_pipe_handle(dev, endpoint, &urb.UrbPipeRequest.PipeHandle)) + { + USBERR0("getting endpoint pipe failed\n"); + return STATUS_INVALID_PARAMETER; + } + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("request failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_configuration.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_configuration.c new file mode 100644 index 0000000..f3f4e40 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_configuration.c @@ -0,0 +1,197 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" +#include + + +NTSTATUS set_configuration(libusb_device_t *dev, + int configuration, + int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb, *urb_ptr = NULL; + USB_CONFIGURATION_DESCRIPTOR *configuration_descriptor = NULL; + USB_INTERFACE_DESCRIPTOR *interface_descriptor = NULL; + USBD_INTERFACE_LIST_ENTRY *interfaces = NULL; + int i, j, interface_number, desc_size, config_index, ret; + + // check if this config value is already set + if ((configuration > 0) && dev->config.value == configuration) + { + return STATUS_SUCCESS; + } + + // check if this config index is already set + if ((configuration < 0) && dev->config.value && dev->config.index == (abs(configuration)-1)) + { + return STATUS_SUCCESS; + } + + memset(&urb, 0, sizeof(URB)); + + if (configuration == 0) + { + urb.UrbHeader.Function = URB_FUNCTION_SELECT_CONFIGURATION; + urb.UrbHeader.Length = sizeof(struct _URB_SELECT_CONFIGURATION); + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("setting configuration %d failed: status: 0x%x, urb-status: 0x%x\n", + configuration, status, urb.UrbHeader.Status); + return status; + } + + dev->config.handle = urb.UrbSelectConfiguration.ConfigurationHandle; + dev->config.value = 0; + + clear_pipe_info(dev); + + return status; + } + + if (configuration <= SET_CONFIG_ACTIVE_CONFIG) + { + // note: as of v1.2.4.0, the active/default configuration is + // always the first configuration the device returns. (index 0) + configuration=-1; + } + + USBMSG("setting configuration %s %d timeout=%d", + (configuration < 0) ? "index" : "value", + (configuration < 0) ? abs(configuration) - 1 : configuration, + timeout); + + + // If configuration is negative, it is retrieved by index. + // + configuration_descriptor = get_config_descriptor(dev, configuration, + &desc_size, &config_index); + if (!configuration_descriptor) + { + USBERR0("getting configuration descriptor failed"); + return STATUS_INVALID_PARAMETER; + } + + // if we passed an index in we can check here to see + // if the device is already configured with this value + if (dev->config.value == configuration_descriptor->bConfigurationValue) + { + status = STATUS_SUCCESS; + goto SetConfigurationDone; + } + + // MEMORY ALLOCATION BEGINS + interfaces = + ExAllocatePool(NonPagedPool,(configuration_descriptor->bNumInterfaces + 1) + * sizeof(USBD_INTERFACE_LIST_ENTRY)); + + if (!interfaces) + { + USBERR0("memory allocation failed\n"); + status = STATUS_NO_MEMORY; + goto SetConfigurationDone; + } + + memset(interfaces, 0, (configuration_descriptor->bNumInterfaces + 1) + * sizeof(USBD_INTERFACE_LIST_ENTRY)); + + interface_number = 0; + + for (i = 0; i < configuration_descriptor->bNumInterfaces; i++) + { + for (j = interface_number; j < LIBUSB_MAX_NUMBER_OF_INTERFACES; j++) + { + interface_descriptor = + find_interface_desc(configuration_descriptor, desc_size, j, 0); + if (interface_descriptor) + { + interface_number = ++j; + break; + } + } + + if (!interface_descriptor) + { + USBERR("unable to find interface descriptor at index %d\n", i); + status = STATUS_INVALID_PARAMETER; + goto SetConfigurationDone; + } + else + { + USBMSG("found interface %d\n", + interface_descriptor->bInterfaceNumber); + interfaces[i].InterfaceDescriptor = interface_descriptor; + } + } + + urb_ptr = USBD_CreateConfigurationRequestEx(configuration_descriptor, interfaces); + if (!urb_ptr) + { + USBERR0("memory allocation failed\n"); + status = STATUS_NO_MEMORY; + goto SetConfigurationDone; + } + + for (i = 0; i < configuration_descriptor->bNumInterfaces; i++) + { + for (j = 0; j < (int)interfaces[i].Interface->NumberOfPipes; j++) + { + interfaces[i].Interface->Pipes[j].MaximumTransferSize = LIBUSB_MAX_READ_WRITE; + } + } + + USBDBG("#%d %s passing configuration request to target-device.", + dev->id, dev->device_id); + + status = call_usbd(dev, urb_ptr, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb_ptr->UrbHeader.Status)) + { + USBERR("setting configuration %d failed: status: 0x%x, urb-status: 0x%x\n", + configuration, status, urb_ptr->UrbHeader.Status); + if (NT_SUCCESS(status)) status = urb_ptr->UrbHeader.Status; + goto SetConfigurationDone; + } + + dev->config.handle = urb_ptr->UrbSelectConfiguration.ConfigurationHandle; + dev->config.value = configuration_descriptor->bConfigurationValue; + dev->config.index = config_index; + + clear_pipe_info(dev); + + for (i = 0; i < configuration_descriptor->bNumInterfaces; i++) + { + update_pipe_info(dev, interfaces[i].Interface); + } + +SetConfigurationDone: + if (interfaces) + ExFreePool(interfaces); + + if (urb_ptr) + ExFreePool(urb_ptr); + + if (configuration_descriptor) + ExFreePool(configuration_descriptor); + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_descriptor.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_descriptor.c new file mode 100644 index 0000000..df4dacc --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_descriptor.c @@ -0,0 +1,71 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS set_descriptor(libusb_device_t *dev, + void *buffer, int size, int type, int recipient, + int index, int language_id, int *sent, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("buffer size: %d type: %04d recipient: %04d index: %04d language id: %04d timeout: %d\n", + size,type,recipient,index,language_id,timeout); + + memset(&urb, 0, sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST)); + + + switch (recipient) + { + case USB_RECIP_DEVICE: + urb.UrbHeader.Function = URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE; + break; + case USB_RECIP_INTERFACE: + urb.UrbHeader.Function = URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + urb.UrbHeader.Function = URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_DESCRIPTOR_REQUEST); + urb.UrbControlDescriptorRequest.TransferBufferLength = size; + urb.UrbControlDescriptorRequest.TransferBuffer = buffer; + urb.UrbControlDescriptorRequest.DescriptorType = (UCHAR)type; + urb.UrbControlDescriptorRequest.Index = (UCHAR)index; + urb.UrbControlDescriptorRequest.LanguageId = (USHORT)language_id; + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("setting descriptor failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + else + { + *sent = urb.UrbControlDescriptorRequest.TransferBufferLength; + } + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_feature.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_feature.c new file mode 100644 index 0000000..2e20569 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_feature.c @@ -0,0 +1,67 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + + +NTSTATUS set_feature(libusb_device_t *dev, int recipient, int index, + int feature, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + USBMSG("recipient: %02d index: %04d feature %04d timeout: %d\n", + recipient,index,feature,timeout); + + memset(&urb, 0, sizeof(struct _URB_CONTROL_FEATURE_REQUEST)); + + switch (recipient) + { + case USB_RECIP_DEVICE: + urb.UrbHeader.Function = URB_FUNCTION_SET_FEATURE_TO_DEVICE; + break; + case USB_RECIP_INTERFACE: + urb.UrbHeader.Function = URB_FUNCTION_SET_FEATURE_TO_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + urb.UrbHeader.Function = URB_FUNCTION_SET_FEATURE_TO_ENDPOINT; + break; + case USB_RECIP_OTHER: + urb.UrbHeader.Function = URB_FUNCTION_SET_FEATURE_TO_OTHER; + urb.UrbControlFeatureRequest.Index = 0; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_FEATURE_REQUEST); + urb.UrbControlFeatureRequest.FeatureSelector = (USHORT)feature; + urb.UrbControlFeatureRequest.Index = (USHORT)index; + + status = call_usbd(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("setting feature failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + + return status; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_interface.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_interface.c new file mode 100644 index 0000000..787c768 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/set_interface.c @@ -0,0 +1,113 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + +NTSTATUS set_interface(libusb_device_t *dev, int interface, int altsetting, + int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB *urb; + int i, config_size, config_index, tmp_size; + + USB_CONFIGURATION_DESCRIPTOR *configuration_descriptor = NULL; + USB_INTERFACE_DESCRIPTOR *interface_descriptor = NULL; + USBD_INTERFACE_INFORMATION *interface_information = NULL; + + USBMSG("interface %d altsetting %d timeout %d\n", + interface,altsetting,timeout); + + if (!dev->config.value) + { + USBERR0("device is not configured\n"); + return STATUS_INVALID_DEVICE_STATE; + } + + configuration_descriptor = get_config_descriptor(dev, dev->config.value, + &config_size, &config_index); + if (!configuration_descriptor) + { + USBERR0("memory_allocation error\n"); + return STATUS_NO_MEMORY; + } + + interface_descriptor = + find_interface_desc(configuration_descriptor, config_size, + interface, altsetting); + + if (!interface_descriptor) + { + USBERR("interface %d or altsetting %d invalid\n", + interface, altsetting); + ExFreePool(configuration_descriptor); + return STATUS_UNSUCCESSFUL; + } + + tmp_size = sizeof(struct _URB_SELECT_INTERFACE) + interface_descriptor->bNumEndpoints * sizeof(USBD_PIPE_INFORMATION); + + + urb = ExAllocatePool(NonPagedPool, tmp_size); + + if (!urb) + { + USBERR0("memory_allocation error\n"); + ExFreePool(configuration_descriptor); + return STATUS_NO_MEMORY; + } + + memset(urb, 0, tmp_size); + + urb->UrbHeader.Function = URB_FUNCTION_SELECT_INTERFACE; + urb->UrbHeader.Length = (USHORT)tmp_size; + + urb->UrbSelectInterface.ConfigurationHandle = dev->config.handle; + urb->UrbSelectInterface.Interface.Length = sizeof(struct _USBD_INTERFACE_INFORMATION); + urb->UrbSelectInterface.Interface.NumberOfPipes = interface_descriptor->bNumEndpoints; + urb->UrbSelectInterface.Interface.Length += interface_descriptor->bNumEndpoints * sizeof(struct _USBD_PIPE_INFORMATION); + + urb->UrbSelectInterface.Interface.InterfaceNumber = (UCHAR)interface; + urb->UrbSelectInterface.Interface.AlternateSetting = (UCHAR)altsetting; + + interface_information = &urb->UrbSelectInterface.Interface; + + for (i = 0; i < interface_descriptor->bNumEndpoints; i++) + { + interface_information->Pipes[i].MaximumTransferSize = LIBUSB_MAX_READ_WRITE; + } + + status = call_usbd(dev, urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout); + + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb->UrbHeader.Status)) + { + USBERR("setting interface failed: status: 0x%x, urb-status: 0x%x\n", status, urb->UrbHeader.Status); + ExFreePool(configuration_descriptor); + ExFreePool(urb); + return STATUS_UNSUCCESSFUL; + } + + update_pipe_info(dev, interface_information); + + ExFreePool(configuration_descriptor); + ExFreePool(urb); + + return status; +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/transfer.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/transfer.c new file mode 100644 index 0000000..be656e1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/transfer.c @@ -0,0 +1,1430 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2010 Travis Robinson +* Copyright (c) 2002-2005 Stephan Meyer +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include "libusb_driver.h" + +typedef struct +{ + URB *urb; + int sequence; +} context_t; + +static LONG sequence = 0; + +static const char* read_pipe_display_names[] = {"ctrl-read", "iso-read", "bulk-read", "int-read"}; +static const char* write_pipe_display_names[] = {"ctrl-write","iso-write","bulk-write","int-write"}; + + +typedef struct _MAIN_REQUEST_CONTEXT +{ + // List of all sub requests (SUB_REQUEST_CONTEXT structures) that + // are allocated to handle the original main request irp. + // + LIST_ENTRY SubRequestList; + LONG sequenceID; + const char* dispTransfer; +} MAIN_REQUEST_CONTEXT, *PMAIN_REQUEST_CONTEXT; + +// The MAIN_REQUEST_CONTEXT structure is overlaid on top of the main +// request irp Tail.Overlay.DriverContext structure instead of being +// allocated separately. Make sure it fits! +// +C_ASSERT(sizeof(MAIN_REQUEST_CONTEXT) <= sizeof(((PIRP)0)->Tail.Overlay.DriverContext)); + +typedef struct _SUB_REQUEST_CONTEXT +{ + // Main request irp that caused this sub request to be allocated. + // + PIRP MainIrp; + + // List entry that links this sub request into the main request irp + // context SubRequestList. The sub request will be inserted into + // the list as long as the sub request is outstanding. The sub + // request is only removed from the list by the sub request + // completion routine. + // + LIST_ENTRY ListEntry; + + // List entry that is used only by the main request irp cancel + // routine to build a list of all currently outstanding sub + // requests in order to cancel them. + // + LIST_ENTRY CancelListEntry; + + // Reference count incremented (set to one) before calling the sub + // request down the driver stack, decremented by the sub request + // completion routine, and incremented/decremented by the main + // request irp cancl routine. This is used to prevent the sub + // request from being freed by either the sub request completion + // routine or the main request irp cancel routine while the sub + // request is simultaneously being accessed by the other routine. + // The sub request is freed by the routine that last accesses the + // sub request and decrements the reference count to zero. + // + LONG ReferenceCount; + + // irp, Urb, and Mdl allocated to send the sub request down the + // driver stack. + // + PIRP SubIrp; + PURB SubUrb; + PMDL SubMdl; + + ULONG startOffset; + +} SUB_REQUEST_CONTEXT, *PSUB_REQUEST_CONTEXT; + +static const char* GetPipeDisplayName(libusb_endpoint_t* endpoint); + +NTSTATUS DDKAPI transfer_complete(DEVICE_OBJECT* device_object, + IRP *irp, + void *context); + +static NTSTATUS create_urb(libusb_device_t *dev, + URB **urb, + int direction, + int urbFunction, + libusb_endpoint_t* endpoint, + int packetSize, + MDL *buffer, + int size); + +VOID large_transfer_cancel_routine(IN PDEVICE_OBJECT DeviceObject, IN PIRP irp); +VOID large_transfer_cancel(IN PIRP irp, BOOLEAN releaseCancelSpinlock); + +NTSTATUS large_transfer_complete(IN PDEVICE_OBJECT DeviceObjectIsNULL, + IN PIRP irp, + IN PVOID Context); + +static int get_iso_stagesize(int totalLength, int packetSize, int maxTransferSize); + +static NTSTATUS allocate_suburb(USHORT urbFunction, + int stageSize, + int packetSize, + ULONG* nPackets, + PURB* subUrbRef); + +void set_urb_transfer_flags(libusb_device_t* dev, + PIRP irp, + PURB subUrb, + int transfer_flags, + int isoLatency); + +NTSTATUS transfer(libusb_device_t* dev, + IN PIRP irp, + IN int direction, + IN int urbFunction, + IN libusb_endpoint_t* endpoint, + IN int packetSize, + IN int maxTransferSize, + IN int transferFlags, + IN int isoLatency, + IN PMDL mdlAddress, + IN int totalLength) +{ + IO_STACK_LOCATION *stack_location = NULL; + context_t *context; + NTSTATUS status = STATUS_SUCCESS; + int sequenceID = InterlockedIncrement(&sequence); + const char* dispTransfer = GetPipeDisplayName(endpoint); + + // TODO: reset pipe flag + // status = reset_endpoint(dev,endpoint->address, LIBUSB_DEFAULT_TIMEOUT); + // + + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + USBMSG("[%s #%d] EP%02Xh packet-size=%d length=%d reset-status=%08Xh\n", + dispTransfer, sequenceID, endpoint->address, packetSize, totalLength, status); + } + else + { + USBMSG("[%s #%d] EP%02Xh length %d\n", + dispTransfer, sequenceID, endpoint->address, totalLength); + } + context = ExAllocatePool(NonPagedPool, sizeof(context_t)); + + if (!context) + { + remove_lock_release(dev); + return complete_irp(irp, STATUS_NO_MEMORY, 0); + } + + status = create_urb(dev, &context->urb, direction, urbFunction, + endpoint, packetSize, mdlAddress, totalLength); + + if (!NT_SUCCESS(status)) + { + ExFreePool(context); + remove_lock_release(dev); + return complete_irp(irp, status, 0); + } + + + context->sequence = sequenceID; + + stack_location = IoGetNextIrpStackLocation(irp); + + stack_location->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; + stack_location->Parameters.Others.Argument1 = context->urb; + stack_location->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB; + + IoSetCompletionRoutine(irp, transfer_complete, context, TRUE, TRUE, TRUE); + + // Set the transfer flags just before we call the irp down. + // If this is an iso transfer, set_urb_transfer_flags() might need + // to get the start frame and set latency. + // + set_urb_transfer_flags(dev, irp, context->urb, transferFlags, isoLatency); + + return IoCallDriver(dev->target_device, irp); +} + + +NTSTATUS DDKAPI transfer_complete(DEVICE_OBJECT *device_object, IRP *irp, + void *context) +{ + context_t *c = (context_t *)context; + int transmitted = 0; + libusb_device_t *dev = device_object->DeviceExtension; + + if (irp->PendingReturned) + { + IoMarkIrpPending(irp); + } + + if (NT_SUCCESS(irp->IoStatus.Status) + && USBD_SUCCESS(c->urb->UrbHeader.Status)) + { + if (c->urb->UrbHeader.Function == URB_FUNCTION_ISOCH_TRANSFER) + { + transmitted = c->urb->UrbIsochronousTransfer.TransferBufferLength; + } + if (c->urb->UrbHeader.Function == URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) + { + transmitted + = c->urb->UrbBulkOrInterruptTransfer.TransferBufferLength; + } + + USBMSG("sequence %d: %d bytes transmitted\n", + c->sequence, transmitted); + } + else + { + if (irp->IoStatus.Status == STATUS_CANCELLED) + { + USBERR("sequence %d: timeout error\n", + c->sequence); + } + else + { + USBERR("sequence %d: transfer failed: status: 0x%x, urb-status: 0x%x\n", + c->sequence, irp->IoStatus.Status, + c->urb->UrbHeader.Status); + } + } + + ExFreePool(c->urb); + ExFreePool(c); + + irp->IoStatus.Information = transmitted; + + remove_lock_release(dev); + + return STATUS_SUCCESS; +} + + +static NTSTATUS create_urb(libusb_device_t *dev, URB **urb, int direction, + int urbFunction, libusb_endpoint_t* endpoint, int packetSize, + MDL *buffer, int size) +{ + USBD_PIPE_HANDLE pipe_handle = NULL; + int num_packets = 0; + int i, urb_size; + + *urb = NULL; + + pipe_handle = endpoint->handle; + + /* isochronous transfer */ + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + if (packetSize <= 0) + { + USBERR("invalid packet size=%d\n", packetSize); + return STATUS_INVALID_PARAMETER; + } + + num_packets = size / packetSize; + + if (num_packets <= 0) + { + USBERR("invalid number of packets=%d\n", + num_packets); + return STATUS_INVALID_PARAMETER; + } + + if (num_packets > 255) + { + USBERR0("transfer size too large\n"); + return STATUS_INVALID_PARAMETER; + } + + urb_size = sizeof(struct _URB_ISOCH_TRANSFER) + + sizeof(USBD_ISO_PACKET_DESCRIPTOR) * num_packets; + } + else /* bulk or interrupt transfer */ + { + urb_size = sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER); + } + + *urb = ExAllocatePool(NonPagedPool, urb_size); + + if (!*urb) + { + USBERR0("memory allocation error\n"); + return STATUS_NO_MEMORY; + } + + memset(*urb, 0, urb_size); + + (*urb)->UrbHeader.Length = (USHORT)urb_size; + (*urb)->UrbHeader.Function = (USHORT)urbFunction; + + /* isochronous transfer */ + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + (*urb)->UrbIsochronousTransfer.PipeHandle = pipe_handle; + (*urb)->UrbIsochronousTransfer.TransferFlags = direction; + (*urb)->UrbIsochronousTransfer.TransferBufferLength = size; + (*urb)->UrbIsochronousTransfer.TransferBufferMDL = buffer; + (*urb)->UrbIsochronousTransfer.NumberOfPackets = num_packets; + + for (i = 0; i < num_packets; i++) + { + (*urb)->UrbIsochronousTransfer.IsoPacket[i].Offset = i * packetSize; + (*urb)->UrbIsochronousTransfer.IsoPacket[i].Length = packetSize; + } + } + /* bulk or interrupt transfer */ + else + { + (*urb)->UrbBulkOrInterruptTransfer.PipeHandle = pipe_handle; + (*urb)->UrbBulkOrInterruptTransfer.TransferFlags = direction; + (*urb)->UrbBulkOrInterruptTransfer.TransferBufferLength = size; + (*urb)->UrbBulkOrInterruptTransfer.TransferBufferMDL = buffer; + } + + return STATUS_SUCCESS; +} + +/*----------------------------------------------------------------------------- +Routine Description: +This routine splits up a main transfer request into one or more sub +requests as necessary. + +[ISOCHRONOUS TRANSFERS] +Each isoch irp/urb pair can span at most 255 packets. +Each isoch irp/urb pair can request at the most 65536 bytes. + +[BULK OR INTERRUPT TRANSFERS] +Each bulk/interrupt irp/urb pair can request at the most 65536 bytes. + +1. It creates a SUB_REQUEST_CONTEXT for each irp/urb pair and +attaches it to the main request irp. + +2. It intializes all of the sub request irp/urb pairs, and sub mdls +too. + +3. It passes down the driver stack all of the sub request irps. + +4. It leaves the completion of the main request irp as the +responsibility of the sub request irp completion routine, except +in the exception case where the main request irp is canceled +prior to passing any of the the sub request irps down the driver +stack. + +Arguments: + +dev - pointer to device object +irp - I/O request packet +direction - URB I/O direction (IN/OUT) +urbFunction - urb transfer function +endpoint - libusb_endpoint_t* +packetSize - isochronous packet size +maxTransferSize, +transferFlags, +isoLatency - +mdlAddress - transfer mdl buffer +totalLength - no. of bytes to be transferred + +Return Value: + +NT status value +*/ +NTSTATUS large_transfer(IN libusb_device_t* dev, + IN PIRP irp, + IN int direction, + IN int urbFunction, + IN libusb_endpoint_t* endpoint, + IN int packetSize, + IN int maxTransferSize, + IN int transferFlags, + IN int isoLatency, + IN PMDL mdlAddress, + IN int totalLength) +{ + PIO_STACK_LOCATION irpStack; + BOOLEAN read; + ULONG stageSize; + ULONG numIrps; + PMAIN_REQUEST_CONTEXT mainRequestContext; + PSUB_REQUEST_CONTEXT * subRequestContextArray; + PSUB_REQUEST_CONTEXT subRequestContext; + CCHAR stackSize; + PUCHAR virtualAddress; + ULONG i; + ULONG j; + NTSTATUS ntStatus; + PIO_STACK_LOCATION nextStack; + USBD_PIPE_HANDLE pipeHandle; + + LONG sequenceID; + const char* dispTransfer; + int startOffset; + + // TODO: reset pipe flag + // if (urbFunction != URB_FUNCTION_ISOCH_TRANSFER && pipe_flags & RESET) + // status = reset_endpoint(dev,endpoint->address, LIBUSB_DEFAULT_TIMEOUT); + // + //reset the pipe (if irps are pending this will fail) + // + //if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + // reset_endpoint(dev,endpoint->address,LIBUSB_DEFAULT_TIMEOUT); + + // + // initialize vars + // + irpStack = IoGetCurrentIrpStackLocation(irp); + sequenceID = InterlockedIncrement(&sequence); + subRequestContextArray = NULL; + + if (!maxTransferSize) + maxTransferSize = endpoint->maximum_transfer_size; + + startOffset = 0; + + read = (direction == USBD_TRANSFER_DIRECTION_IN) ? TRUE : FALSE; + dispTransfer = GetPipeDisplayName(endpoint); + pipeHandle = endpoint->handle; + + // defaults + stageSize = totalLength; + numIrps = 1; + + // Full speed ISO note: + // There is an inherent limit on the number of packets that can be + // passed down the stack with each irp/urb pair (255) + // + // If the number of required packets is > 255, we shall create + // "(required-packets / 255) [+ 1]" number of irp/urb pairs. + // + // Each irp/urb pair transfer is also called a stage transfer. + // + + // TODO: detect and optimize for high speed devices. + // + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + stageSize = get_iso_stagesize(totalLength, packetSize, maxTransferSize); + numIrps = (totalLength + stageSize - 1) / stageSize; + USBMSG("[%s #%d] EP%02Xh total-size=%d stage-size=%d IRPs=%d packet-size=%d\n", + dispTransfer, sequenceID, endpoint->address, totalLength, stageSize, numIrps, packetSize); + } + else + { + if (totalLength > (maxTransferSize)) + stageSize = maxTransferSize; + numIrps = (totalLength + stageSize - 1) / stageSize; + USBMSG("[%s #%d] EP%02Xh total-size=%d stage-size=%d IRPs=%d\n", + dispTransfer, sequenceID, endpoint->address, totalLength, stageSize, numIrps); + } + + // Initialize the main request irp read/write context, which is + // overlaid on top of irp->Tail.Overlay.DriverContext. + // + mainRequestContext = (PMAIN_REQUEST_CONTEXT)irp->Tail.Overlay.DriverContext; + + mainRequestContext->dispTransfer = dispTransfer; + mainRequestContext->sequenceID = sequenceID; + + InitializeListHead(&mainRequestContext->SubRequestList); + + stackSize = dev->target_device->StackSize; + + virtualAddress = (PUCHAR) MmGetMdlVirtualAddress(mdlAddress); + if (!virtualAddress) + { + USBERR("[%s #%d] MmGetMdlVirtualAddress failed\n", + dispTransfer, sequenceID); + ntStatus = STATUS_INSUFFICIENT_RESOURCES; + goto transfer_Free; + } + + // Allocate an array to keep track of the sub requests that will be + // allocated below. This array exists only during the execution of + // this routine and is used only to keep track of the sub requests + // before calling them down the driver stack. + // + subRequestContextArray = (PSUB_REQUEST_CONTEXT *) + ExAllocatePool(NonPagedPool, + numIrps * sizeof(PSUB_REQUEST_CONTEXT)); + + if (subRequestContextArray == NULL) + { + USBERR("[%s #%d] failed allocating sub request context array\n", + dispTransfer, sequenceID); + + ntStatus = STATUS_INSUFFICIENT_RESOURCES; + + goto transfer_Free; + } + + RtlZeroMemory(subRequestContextArray, numIrps * sizeof(PSUB_REQUEST_CONTEXT)); + + // + // Allocate the sub requests + // + for (i = 0; i < numIrps; i++) + { + PIRP subIrp; + PURB subUrb; + PMDL subMdl; + // ULONG urbSize; + ULONG offset; + ULONG nPackets=0; + + // The following outer scope variables are updated during each + // iteration of the loop: virtualAddress, totalLength, stageSize + + // + // For every stage of transfer we need to do the following + // tasks: + // + // 1. Allocate a sub request context (SUB_REQUEST_CONTEXT). + // 2. Allocate a sub request irp. + // 3. Allocate a sub request urb. + // 4. Allocate a sub request mdl. + // 5. Initialize the above allocations. + // + + // + // 1. Allocate a Sub Request Context (SUB_REQUEST_CONTEXT) + // + + subRequestContext = (PSUB_REQUEST_CONTEXT) + ExAllocatePool(NonPagedPool, sizeof(SUB_REQUEST_CONTEXT)); + + if (subRequestContext == NULL) + { + USBERR("[%s #%d] failed allocating sub request context\n", + dispTransfer, sequenceID); + + ntStatus = STATUS_INSUFFICIENT_RESOURCES; + + goto transfer_Free; + } + + RtlZeroMemory(subRequestContext, sizeof(SUB_REQUEST_CONTEXT)); + + // Attach it to the main request irp. + // + InsertTailList(&mainRequestContext->SubRequestList, &subRequestContext->ListEntry); + + // Remember it independently so we can refer to it later without + // walking the sub request list. + // + subRequestContextArray[i] = subRequestContext; + + // Set the master irp that all the sub-requests originated from. + subRequestContext->MainIrp = irp; + + // Remember the start offset + subRequestContext->startOffset = startOffset; + + // The reference count on the sub request prevents it from being + // freed until the completion routine for the sub request + // executes. + // + subRequestContext->ReferenceCount = 1; + + // + // 2. Allocate a sub request irp + // + subIrp = IoAllocateIrp(stackSize, FALSE); + + if (subIrp == NULL) + { + USBERR("[%s #%d] failed allocating subIrp\n", dispTransfer, sequenceID); + + ntStatus = STATUS_INSUFFICIENT_RESOURCES; + + goto transfer_Free; + } + + subRequestContext->SubIrp = subIrp; + + ntStatus = allocate_suburb((USHORT)urbFunction, stageSize, packetSize, &nPackets, &subUrb); + if (!NT_SUCCESS(ntStatus)) + { + USBERR("[%s #%d] failed allocating subUrb\n", dispTransfer, sequenceID); + goto transfer_Free; + } + else + { + USBDBG("[%s #%d] packets=%d irp-urb = #%d\n", + dispTransfer, sequenceID, nPackets, i); + } + + subRequestContext->SubUrb = subUrb; + + // + // 4. Allocate a sub request mdl. + // + subMdl = IoAllocateMdl((PVOID) virtualAddress, + stageSize, + FALSE, + FALSE, + NULL); + + if (subMdl == NULL) + { + USBERR("[%s #%d] failed allocating subMdl\n", dispTransfer, sequenceID); + + ntStatus = STATUS_INSUFFICIENT_RESOURCES; + + goto transfer_Free; + } + + subRequestContext->SubMdl = subMdl; + + IoBuildPartialMdl(irp->MdlAddress, + subMdl, + (PVOID)virtualAddress, + stageSize); + + // Update loop variables for next iteration. + // + virtualAddress += stageSize; + + totalLength -= stageSize; + + // + // Initialize the sub request urb. + // + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + USBDBG("[%s #%d] stage-size=%d nPackets=%d\n", + dispTransfer, sequenceID, stageSize, nPackets); + + subUrb->UrbIsochronousTransfer.PipeHandle = pipeHandle; + + // The direction is set here, other flags are set in the + // set_urb_transfer_flags() function. + // + subUrb->UrbIsochronousTransfer.TransferFlags = direction; + + subUrb->UrbIsochronousTransfer.TransferBufferLength = stageSize; + subUrb->UrbIsochronousTransfer.TransferBufferMDL = subMdl; + + // + // when the client driver sets the ASAP flag, it basically + // guarantees that it will make data available to the HC + // and that the HC should transfer it in the next transfer frame + // for the endpoint.(The HC maintains a next transfer frame + // state variable for each endpoint). By resetting the pipe, + // we make the pipe as virgin. If the data does not get to the HC + // fast enough, the USBD_ISO_PACKET_DESCRIPTOR - Status is + // USBD_STATUS_BAD_START_FRAME on uhci. On ohci it is 0xC000000E. + // + + subUrb->UrbIsochronousTransfer.NumberOfPackets = nPackets; + // + // Set the offsets for every packet for reads/writes + // + if (read) + { + offset = 0; + + for (j = 0; j < nPackets; j++) + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Offset = offset; + + if (stageSize > (ULONG)packetSize) + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Length = 0; + offset += packetSize; + stageSize -= packetSize; + } + else + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Length = 0; + offset += stageSize; + stageSize = 0; + } + } + } + else + { + offset = 0; + + for (j = 0; j < nPackets; j++) + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Offset = offset; + + if (stageSize > (ULONG)packetSize) + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Length = packetSize; + offset += packetSize; + stageSize -= packetSize; + } + else + { + subUrb->UrbIsochronousTransfer.IsoPacket[j].Length = stageSize; + offset += stageSize; + stageSize = 0; + /* + ASSERT(offset == (subUrb->UrbIsochronousTransfer.IsoPacket[j].Length + + subUrb->UrbIsochronousTransfer.IsoPacket[j].Offset)); + */ + } + } + } + } + else + { + USBDBG("[%s #%d] stage-size=%d\n",dispTransfer, sequenceID, stageSize); + + subUrb->UrbBulkOrInterruptTransfer.PipeHandle = pipeHandle; + + subUrb->UrbBulkOrInterruptTransfer.TransferFlags = direction; + + subUrb->UrbBulkOrInterruptTransfer.TransferBufferLength = stageSize; + subUrb->UrbBulkOrInterruptTransfer.TransferBufferMDL = subMdl; + } + // Initialize the sub irp stack location + // + nextStack = IoGetNextIrpStackLocation(subIrp); + + nextStack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; + + nextStack->Parameters.Others.Argument1 = (PVOID) subUrb; + + nextStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB; + + IoSetCompletionRoutine(subIrp, + (PIO_COMPLETION_ROUTINE)large_transfer_complete, + (PVOID)subRequestContext, + TRUE, + TRUE, + TRUE); + + // Update loop variables for next iteration. + // + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + stageSize = get_iso_stagesize(totalLength, packetSize, maxTransferSize); + else + { + if (totalLength > (maxTransferSize)) + stageSize = maxTransferSize; + else + stageSize = totalLength; + } + startOffset += stageSize; + } + + // + // While we were busy create subsidiary irp/urb pairs.. + // the main read/write irp may have been cancelled !! + // + + if (!irp->Cancel) + { + // + // normal processing + // + + USBDBG("[%s #%d] normal processing\n", dispTransfer, sequenceID); + + IoMarkIrpPending(irp); + + // The cancel routine might run simultaneously as soon as it is + // set. Do not access the main request irp in any way after + // setting the cancel routine. + // + // Note that it is still safe to access the sub requests up to + // the point where each sub request is called down the driver + // stack due to the sub request reference count which must be + // decremented by the completion routine. Do not access a sub + // request in any way after it is called down the driver stack. + // + // After setting the main request irp cancel routine we are + // committed to calling each of the sub requests down the + // driver stack. + // + IoSetCancelRoutine(irp, large_transfer_cancel_routine); + + for (i = 0; i < numIrps; i++) + { + subRequestContext = subRequestContextArray[i]; + + USBDBG("[%s #%d] IoCallDriver subIrp %d\n", dispTransfer, sequenceID, i); + + // Set the transfer flags just before we call the irp down. + // If this is an iso transfer, set_urb_transfer_flags() might need + // to get the start frame and set latency. + // + set_urb_transfer_flags(dev,irp, subRequestContext->SubUrb, transferFlags, isoLatency); + + IoCallDriver(dev->target_device, subRequestContext->SubIrp); + } + + // The sub requests are freed in either the sub request + // completion routine or in the main request irp cancel routine. + // + // Main request irp is completed only in sub request completion + // routine. + + ExFreePool(subRequestContextArray); + + return STATUS_PENDING; + } + else + { + // + // The Cancel flag for the irp has been set. + // + USBDBG("[%s #%d] Cancel flag set\n", dispTransfer, sequenceID); + + ntStatus = STATUS_CANCELLED; + } + + // + // Resource allocation failure, or the main request irp was + // cancelled before the cancel routine was set. Free any resource + // allocations and complete the main request irp. + // + // No sub requests were ever called down the driver stack in this + // case. + // + +transfer_Free: + + if (subRequestContextArray != NULL) + { + for (i = 0; i < numIrps; i++) + { + subRequestContext = subRequestContextArray[i]; + + if (subRequestContext != NULL) + { + if (subRequestContext->SubIrp != NULL) + { + IoFreeIrp(subRequestContext->SubIrp); + } + + if (subRequestContext->SubUrb != NULL) + { + ExFreePool(subRequestContext->SubUrb); + } + + if (subRequestContext->SubMdl != NULL) + { + IoFreeMdl(subRequestContext->SubMdl); + } + + ExFreePool(subRequestContext); + } + } + + ExFreePool(subRequestContextArray); + } + + irp->IoStatus.Status = ntStatus; + irp->IoStatus.Information = 0; + + IoCompleteRequest(irp, IO_NO_INCREMENT); + + USBERR("[%s #%d] ntStatus=%Xh\n", + dispTransfer, sequenceID, ntStatus); + + remove_lock_release(dev); + + return ntStatus; +} + +/*----------------------------------------------------------------------------- +Routine Description: + +This routine handles the completion of a Sub Request irp that was +created to handle part (or all) of the transfer for a Main Request +irp. + +It updates the transfer length (IoStatus.Information) of the Main +Request irp, and completes the Main Request irp if this Sub Request +irp is the final outstanding one. + +The Sub Request irp and Sub Request Context may either be freed +here, or by large_transfer_cancel(), according to which routine is +the last one to reference the Sub Request irp. + +Arguments: + +DeviceObject - NULL as this Sub Request irp was allocated without a +stack location for this driver to use itself. + +irp - Sub Request irp + +Context - Sub Request Context (PSUB_REQUEST_CONTEXT) + +Return Value: + +STATUS_MORE_PROCESSING_REQUIRED - Tells IoMgr not to free the Sub +Request irp as it is either explicitly freed here, or by +large_transfer_cancel() + +*/ +NTSTATUS large_transfer_complete(IN PDEVICE_OBJECT DeviceObjectIsNULL, + IN PIRP irp, + IN PVOID Context) +{ + PSUB_REQUEST_CONTEXT subRequestContext; + PURB subUrb; + PIRP mainIrp; + PMAIN_REQUEST_CONTEXT mainRequestContext; + PDEVICE_OBJECT deviceObject; + NTSTATUS ntStatus; + ULONG information; + ULONG i; + KIRQL irql; + BOOLEAN completeMainRequest; + int subRequestByteOffset; + int subRequestByteCount; + + LONG sequenceID; + const char* dispTransfer; + PUCHAR outBuffer; + BOOLEAN needs_cancelled = FALSE; + + UNREFERENCED_PARAMETER( DeviceObjectIsNULL ); + subRequestContext = (PSUB_REQUEST_CONTEXT)Context; + + subUrb = subRequestContext->SubUrb; + mainIrp = subRequestContext->MainIrp; + + // The main request irp context is overlaid on top of + // irp->Tail.Overlay.DriverContext. Get a pointer to it. + // + mainRequestContext = (PMAIN_REQUEST_CONTEXT) + mainIrp->Tail.Overlay.DriverContext; + + sequenceID = mainRequestContext->sequenceID; + dispTransfer = mainRequestContext->dispTransfer; + + subRequestByteCount = 0; + + deviceObject = IoGetCurrentIrpStackLocation(mainIrp)->DeviceObject; + + ntStatus = irp->IoStatus.Status; + + if (NT_SUCCESS(ntStatus) && USBD_SUCCESS(subUrb->UrbHeader.Status)) + { + if (subUrb->UrbHeader.Function == URB_FUNCTION_ISOCH_TRANSFER) + { + information = subUrb->UrbIsochronousTransfer.TransferBufferLength; + USBDBG("[%s #%d] transferred=%d\n", + dispTransfer, + sequenceID, + information); + + for (i = 0; i < subUrb->UrbIsochronousTransfer.NumberOfPackets; i++) + { + if (subUrb->UrbIsochronousTransfer.IsoPacket[i].Status != 0) + { + USBDBG("[%s #%d] IsoPacket[%d].Length=%d IsoPacket[%d].Status=%08Xh\n", + dispTransfer, + sequenceID, + i, + subUrb->UrbIsochronousTransfer.IsoPacket[i].Length, + i, + subUrb->UrbIsochronousTransfer.IsoPacket[i].Status); + } + } + } + else + { + subRequestByteCount = MmGetMdlByteCount(subUrb->UrbBulkOrInterruptTransfer.TransferBufferMDL); + subRequestByteOffset = MmGetMdlByteOffset(subUrb->UrbBulkOrInterruptTransfer.TransferBufferMDL); + information = subUrb->UrbBulkOrInterruptTransfer.TransferBufferLength; + USBDBG("[%s #%d] offset=%d requested=%d transferred=%d\n", + dispTransfer, + sequenceID, + subRequestByteOffset, + subRequestByteCount, + information); + } + + } + else + { + information = 0; + + if (ntStatus == STATUS_CANCELLED) + { + USBDBG("[%s #%d] cancelled\n", + dispTransfer, + sequenceID); + } + else + { + USBERR("[%s #%d] failed. status=%Xh urb-status=%Xh\n", + dispTransfer, + sequenceID, + ntStatus, + subUrb->UrbHeader.Status); + } + } + + // Prevent the cancel routine from executing simultaneously + // + IoAcquireCancelSpinLock(&irql); + + if (subUrb->UrbHeader.Function == URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER) + { + /* + USBDBG("[%s #%d] MdlAddress:0x%x Function:0x%x TransferFlags:0x%x information:%d srcOffset:%d dstOffset:%d\n", + dispTransfer, + sequenceID, + mainIrp->MdlAddress, + subUrb->UrbHeader.Function, + subUrb->UrbBulkOrInterruptTransfer.TransferFlags, + information, + mainIrp->IoStatus.Information, + subRequestContext->startOffset); + */ + + // If this bulk read was valid, returned a length > 0 and a + // previous sub irp/urb pair in this batch was short then the + // data was written to the wrong offset in the output buffer. + // We need to move this data to the correct location in the + // output buffer. + // + if ((mainIrp->MdlAddress) && + ((subUrb->UrbBulkOrInterruptTransfer.TransferFlags & USBD_TRANSFER_DIRECTION_IN) == USBD_TRANSFER_DIRECTION_IN) && + (information > 0)) + { + if (mainIrp->IoStatus.Information < subRequestContext->startOffset) + { + // Translate a virtual address range described in the MDL for a user buffer + // to a system-space address range. + // + outBuffer = MmGetSystemAddressForMdlSafe(mainIrp->MdlAddress, HighPagePriority); + + if (!outBuffer) + { + information = 0; + + USBERR("[%s #%d] failed translating a virtual address range\n", + dispTransfer,sequenceID); + } + else + { + USBDBG("[%s #%d] adjusting outBuffer old-offset %d to new-offset %d (length=%d)\n", + dispTransfer, + sequenceID, + subRequestContext->startOffset, + mainIrp->IoStatus.Information, + information); + + // move the data this subirp just put in the output buffer to the correct + // location. + // + RtlMoveMemory(outBuffer+mainIrp->IoStatus.Information, + outBuffer+subRequestContext->startOffset, + information); + } + } + else if (information < (ULONG)subRequestByteCount) + { + needs_cancelled = TRUE; + } + } + } + + // add the sub transfer length to the main transfer length. + // + mainIrp->IoStatus.Information += information; + + // Remove the sub request from the main request sub request list. + // + RemoveEntryList(&subRequestContext->ListEntry); + + // If the sub request list is now empty clear the main request + // cancel routine and note that the main request should be + // completed. + // + if (IsListEmpty(&mainRequestContext->SubRequestList)) + { + completeMainRequest = TRUE; + needs_cancelled = FALSE; + IoSetCancelRoutine(mainIrp, NULL); + } + else + { + completeMainRequest = FALSE; + + // If this is a bulk/interrupt transfer and we transmit less + // bytes then what we requested, cancel the pending subIrps. + // If the subirp(s) cannot be cancelled, any data they return + // must be moved to the correct location in the output buffer. + // + if (needs_cancelled) + { + // IoSetCancelRoutine returns the previous value of + // mainIrp->CancelRoutine. If no Cancel routine was previously + // set, or if IRP cancellation is already in progress, + // IoSetCancelRoutine returns NULL. + needs_cancelled = (IoSetCancelRoutine(mainIrp, NULL) == NULL) ? FALSE : TRUE; + } + + } + + // The cancel routine may now execute simultaneously, unless of + // course the cancel routine was just cleared above. + // + // Do not access the main irp or the mainRequestContext in any way + // beyond this point, unless this is the single instance of the sub + // request completion routine which will complete the main irp. + // + IoReleaseCancelSpinLock(irql); + + // needs_cancelled is set for the first subrequest that returns "short". + // provided it is not the final subrequest. + if (needs_cancelled) + { + // we can only do this (after IoReleaseCancelSpinLock) because the + // cancel routine for mainIrp was removed above. + large_transfer_cancel(mainIrp, FALSE); + } + + if (InterlockedDecrement(&subRequestContext->ReferenceCount) == 0) + { + // If the reference count is now zero then the cancel routine + // will not free the sub request. (Either the cancel routine + // ran and accessed the sub request and incremented the + // reference count and then decremented it again without freeing + // the sub request, or the cancel routine did not access the + // sub request and can no longer access it because it has been + // removed from the main request sub request list.) + // + IoFreeIrp(subRequestContext->SubIrp); + + ExFreePool(subRequestContext->SubUrb); + + IoFreeMdl(subRequestContext->SubMdl); + + ExFreePool(subRequestContext); + } + else + { + // In this case the cancel routine for the main request must be + // executing and is accessing the sub request after + // incrementing its reference count. When the cancel routine + // decrements the reference count again it will take care of + // freeing the sub request. + } + + if (completeMainRequest) + { + // The final sub request for the main request has completed so + // now complete the main request. + // + USBMSG("[%s #%d] done. total transferred=%d\n", + dispTransfer, + sequenceID, + mainIrp->IoStatus.Information); + + mainIrp->IoStatus.Status = STATUS_SUCCESS; + + IoCompleteRequest(mainIrp, IO_NO_INCREMENT); + + // the remove lock was referenced in dispatch_ioctl() when the main irp + // was first submitted. + remove_lock_release(deviceObject->DeviceExtension); + } + + return STATUS_MORE_PROCESSING_REQUIRED; +} + +/*++ + +Routine Description: + +This is the cancellation routine for the main read/write irp. + +It cancels all currently outstanding sub requests for the main +request. + +Completing the main request is the responsibility of the sub +request completion routine after all outstanding sub requests have +completed. + +Return Value: + +None + +--*/ +VOID large_transfer_cancel_routine(IN PDEVICE_OBJECT DeviceObject, IN PIRP irp) +{ + large_transfer_cancel(irp, TRUE); +} + +/*++ + +Routine Description: + +Cancels all currently outstanding sub requests for the main +request. + +Completing the main request is the responsibility of the sub +request completion routine after all outstanding sub requests have +completed. + +Return Value: + +None + +--*/ +VOID large_transfer_cancel(IN PIRP irp, BOOLEAN releaseCancelSpinlock) +{ + PMAIN_REQUEST_CONTEXT mainRequestContext; + LIST_ENTRY cancelList; + PLIST_ENTRY subRequestEntry; + PSUB_REQUEST_CONTEXT subRequestContext; + + // The main request irp context is overlaid on top of + // irp->Tail.Overlay.DriverContext. Get a pointer to it. + // + mainRequestContext = (PMAIN_REQUEST_CONTEXT) + irp->Tail.Overlay.DriverContext; + + // The mainRequestContext SubRequestList cannot be simultaneously + // changed by anything else as long as the cancel spin lock is still + // held, but can be changed immediately by the completion routine + // after the cancel spin lock is released. + // + // Iterate over the mainRequestContext SubRequestList and add all of + // the currently outstanding sub requests to the list of sub + // requests to be cancelled. + // + InitializeListHead(&cancelList); + + subRequestEntry = mainRequestContext->SubRequestList.Flink; + + while (subRequestEntry != &mainRequestContext->SubRequestList) + { + subRequestContext = CONTAINING_RECORD(subRequestEntry, + SUB_REQUEST_CONTEXT, + ListEntry); + + // Prevent the sub request from being freed as soon as the + // cancel spin lock is released by incrementing the reference + // count on the sub request. + // + InterlockedIncrement(&subRequestContext->ReferenceCount); + + InsertTailList(&cancelList, &subRequestContext->CancelListEntry); + + subRequestEntry = subRequestEntry->Flink; + } + + USBDBG("[%s #%d] cancel-reason=%s\n", + mainRequestContext->dispTransfer, + mainRequestContext->sequenceID, + releaseCancelSpinlock?"User":"ShortTransfer"); + + if (releaseCancelSpinlock) + { + + // The main read/write irp can be completed immediately after + // releasing the cancel spin lock. Do not access the main + // read/write irp or the mainRequestContext in any way beyond this + // point. + // + IoReleaseCancelSpinLock(irp->CancelIrql); + } + + // Iterate over the list that was built of sub requests to cancel + // and cancel each sub request. + // + while (!IsListEmpty(&cancelList)) + { + subRequestEntry = RemoveHeadList(&cancelList); + + subRequestContext = CONTAINING_RECORD(subRequestEntry, + SUB_REQUEST_CONTEXT, + CancelListEntry); + + if (!subRequestContext->SubIrp->Cancel) + { + IoCancelIrp(subRequestContext->SubIrp); + } + + if (InterlockedDecrement(&subRequestContext->ReferenceCount) == 0) + { + // If the reference count is now zero then the completion + // routine already ran for the sub request but did not free + // the sub request so it can be freed now. + // + IoFreeIrp(subRequestContext->SubIrp); + + ExFreePool(subRequestContext->SubUrb); + + IoFreeMdl(subRequestContext->SubMdl); + + ExFreePool(subRequestContext); + } + else + { + // The completion routine for the sub request has not yet + // executed and decremented the sub request reference count. + // Do not free the sub request here. It will be freed when + // the sub request completion routine executes. + } + } +} + +static int get_iso_stagesize(int totalLength, int packetSize, int maxTransferSize) +{ + int stageSize; + + if (totalLength > (packetSize * 255) || totalLength > maxTransferSize) + { + stageSize = packetSize * 255; + if (stageSize > maxTransferSize) + stageSize = maxTransferSize; + + // stageSize = stageSize - (stageSize % packetSize); + + } + else + { + stageSize = totalLength; + } + + return stageSize; +} + +static NTSTATUS allocate_suburb(USHORT urbFunction, + int stageSize, + int packetSize, + ULONG* nPackets, + PURB* subUrbRef) +{ + int urbSize; + // + // 3. Allocate a sub request urb. + // + if (urbFunction == URB_FUNCTION_ISOCH_TRANSFER) + { + *nPackets = (stageSize + packetSize - 1) / packetSize; + urbSize = GET_ISO_URB_SIZE(*nPackets); + } + else + { + *nPackets = 0; + urbSize = sizeof(struct _URB_BULK_OR_INTERRUPT_TRANSFER); + } + + *subUrbRef = (PURB)ExAllocatePool(NonPagedPool, urbSize); + + if ((*subUrbRef) == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + RtlZeroMemory(*subUrbRef, urbSize); + + (*subUrbRef)->UrbHeader.Length = (USHORT)urbSize; + (*subUrbRef)->UrbHeader.Function = urbFunction; + + return STATUS_SUCCESS; +} + +static const char* GetPipeDisplayName(libusb_endpoint_t* endpoint) +{ + if (endpoint->address & 0x80) + return read_pipe_display_names[(endpoint->pipe_type & 3)]; + else + return write_pipe_display_names[(endpoint->pipe_type & 3)]; +} + +void set_urb_transfer_flags(libusb_device_t* dev, PIRP irp, PURB subUrb,int transfer_flags, int isoLatency) +{ + if (subUrb->UrbHeader.Function == URB_FUNCTION_ISOCH_TRANSFER) + { + // only keep the direction bit + subUrb->UrbIsochronousTransfer.TransferFlags &= 1; + + // If true, allow short tranfers. + if (!(transfer_flags & TRANSFER_FLAGS_SHORT_NOT_OK)) + subUrb->UrbIsochronousTransfer.TransferFlags |= USBD_SHORT_TRANSFER_OK; + + if (!(transfer_flags & TRANSFER_FLAGS_ISO_SET_START_FRAME)) + subUrb->UrbIsochronousTransfer.TransferFlags |= USBD_START_ISO_TRANSFER_ASAP; + else + { + subUrb->UrbIsochronousTransfer.StartFrame = get_current_frame(dev, irp); + if (transfer_flags & TRANSFER_FLAGS_ISO_ADD_LATENCY) + subUrb->UrbIsochronousTransfer.StartFrame += isoLatency; + } + } + + else if (subUrb->UrbHeader.Function == URB_FUNCTION_CONTROL_TRANSFER) + { + // TODO: large control transfers + + // only keep the direction bit + subUrb->UrbControlTransfer.TransferFlags &= 1; + if (!(transfer_flags & TRANSFER_FLAGS_SHORT_NOT_OK)) + subUrb->UrbControlTransfer.TransferFlags |= USBD_SHORT_TRANSFER_OK; + + } + else + { + // Default is bulk or interrupt. + + // only keep the direction bit + subUrb->UrbBulkOrInterruptTransfer.TransferFlags &= 1; + + // If true, allow short tranfers. + if (!(transfer_flags & TRANSFER_FLAGS_SHORT_NOT_OK)) + subUrb->UrbBulkOrInterruptTransfer.TransferFlags |= USBD_SHORT_TRANSFER_OK; + } +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbd.def b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbd.def new file mode 100644 index 0000000..b04ea2c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbd.def @@ -0,0 +1,35 @@ + +EXPORTS +USBD_AllocateDeviceName +USBD_CalculateUsbBandwidth +USBD_CompleteRequest +USBD_CreateConfigurationRequest +USBD_CreateConfigurationRequestEx +USBD_CreateDevice +USBD_Debug_GetHeap +USBD_Debug_LogEntry +USBD_Debug_RetHeap +USBD_Dispatch +USBD_FreeDeviceMutex +USBD_FreeDeviceName +USBD_GetDeviceInformation +USBD_GetInterfaceLength +USBD_GetPdoRegistryParameter +USBD_GetSuspendPowerState +USBD_GetUSBDIVersion +USBD_InitializeDevice +USBD_MakePdoName +USBD_ParseConfigurationDescriptor +USBD_ParseConfigurationDescriptorEx +USBD_ParseDescriptors +USBD_QueryBusTime +USBD_RegisterHcDeviceCapabilities +USBD_RegisterHcFilter +USBD_RegisterHostController +USBD_RemoveDevice +USBD_RestoreDevice +USBD_SetSuspendPowerState +USBD_WaitDeviceMutex +USBD_CreateConfigurationRequestEx@8=_USBD_CreateConfigurationRequestEx@8 +USBD_ParseConfigurationDescriptorEx@28=_USBD_ParseConfigurationDescriptorEx@28 +USBD_ParseDescriptors@16=_USBD_ParseDescriptors@16 diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbdlib_gcc.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbdlib_gcc.h new file mode 100644 index 0000000..68d452c --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/usbdlib_gcc.h @@ -0,0 +1,310 @@ + +#ifndef __USBDLIB_H +#define __USBDLIB_H + +#if __GNUC__ >=3 +#pragma GCC system_header +#endif + +#ifdef __cplusplus +extern "C" +{ +#endif + +#pragma pack(push,4) + + + typedef struct _USBD_INTERFACE_LIST_ENTRY + { + PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; + PUSBD_INTERFACE_INFORMATION Interface; + } USBD_INTERFACE_LIST_ENTRY, *PUSBD_INTERFACE_LIST_ENTRY; + + +#define URB_STATUS(urb) ((urb)->UrbHeader.Status) + +#define GET_SELECT_CONFIGURATION_REQUEST_SIZE(totalInterfaces, totalPipes) \ + (sizeof(struct _URB_SELECT_CONFIGURATION) \ + + ((totalInterfaces - 1) * sizeof(USBD_INTERFACE_INFORMATION)) \ + + ((totalPipes - 1) * sizeof(USBD_PIPE_INFORMATION))) + +#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes) \ + (sizeof(struct _URB_SELECT_INTERFACE) \ + + ((totalPipes - 1) * sizeof(USBD_PIPE_INFORMATION))) + +#define GET_USBD_INTERFACE_SIZE(numEndpoints) \ + (sizeof(USBD_INTERFACE_INFORMATION) \ + + (sizeof(USBD_PIPE_INFORMATION)*(numEndpoints)) \ + - sizeof(USBD_PIPE_INFORMATION)) + +#define GET_ISO_URB_SIZE(n) (sizeof(struct _URB_ISOCH_TRANSFER) \ + + sizeof(USBD_ISO_PACKET_DESCRIPTOR) * n) + + +#define UsbBuildInterruptOrBulkTransferRequest(urb, \ + length, \ + pipeHandle, \ + transferBuffer, \ + transferBufferMDL, \ + transferBufferLength, \ + transferFlags, \ + link) { \ + (urb)->UrbHeader.Function = \ + URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbBulkOrInterruptTransfer.PipeHandle = (pipeHandle); \ + (urb)->UrbBulkOrInterruptTransfer.TransferBufferLength = \ + (transferBufferLength); \ + (urb)->UrbBulkOrInterruptTransfer.TransferBufferMDL = \ + (transferBufferMDL); \ + (urb)->UrbBulkOrInterruptTransfer.TransferBuffer = \ + (transferBuffer); \ + (urb)->UrbBulkOrInterruptTransfer.TransferFlags = \ + (transferFlags); \ + (urb)->UrbBulkOrInterruptTransfer.UrbLink = (link); } + + +#define UsbBuildGetDescriptorRequest(urb, \ + length, \ + descriptorType, \ + descriptorIndex, \ + languageId, \ + transferBuffer, \ + transferBufferMDL, \ + transferBufferLength, \ + link) { \ + (urb)->UrbHeader.Function = \ + URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbControlDescriptorRequest.TransferBufferLength = \ + (transferBufferLength); \ + (urb)->UrbControlDescriptorRequest.TransferBufferMDL = \ + (transferBufferMDL); \ + (urb)->UrbControlDescriptorRequest.TransferBuffer = \ + (transferBuffer); \ + (urb)->UrbControlDescriptorRequest.DescriptorType = \ + (descriptorType); \ + (urb)->UrbControlDescriptorRequest.Index = (descriptorIndex); \ + (urb)->UrbControlDescriptorRequest.LanguageId = (languageId); \ + (urb)->UrbControlDescriptorRequest.UrbLink = (link); } + + + +#define UsbBuildGetStatusRequest(urb, \ + op, \ + index, \ + transferBuffer, \ + transferBufferMDL, \ + link) { \ + (urb)->UrbHeader.Function = (op); \ + (urb)->UrbHeader.Length = \ + sizeof(struct _URB_CONTROL_GET_STATUS_REQUEST); \ + (urb)->UrbControlGetStatusRequest.TransferBufferLength = \ + sizeof(USHORT); \ + (urb)->UrbControlGetStatusRequest.TransferBufferMDL = \ + (transferBufferMDL); \ + (urb)->UrbControlGetStatusRequest.TransferBuffer = \ + (transferBuffer); \ + (urb)->UrbControlGetStatusRequest.Index = (index); \ + (urb)->UrbControlGetStatusRequest.UrbLink = (link); } + + +#define UsbBuildFeatureRequest(urb, \ + op, \ + featureSelector, \ + index, \ + link) { \ + (urb)->UrbHeader.Function = (op); \ + (urb)->UrbHeader.Length = \ + sizeof(struct _URB_CONTROL_FEATURE_REQUEST); \ + (urb)->UrbControlFeatureRequest.FeatureSelector = \ + (featureSelector); \ + (urb)->UrbControlFeatureRequest.Index = (index); \ + (urb)->UrbControlFeatureRequest.UrbLink = (link); } + + + +#define UsbBuildSelectConfigurationRequest(urb, \ + length, \ + configurationDescriptor) { \ + (urb)->UrbHeader.Function = URB_FUNCTION_SELECT_CONFIGURATION; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbSelectConfiguration.ConfigurationDescriptor = \ + (configurationDescriptor); } + +#define UsbBuildSelectInterfaceRequest(urb, \ + length, \ + configurationHandle, \ + interfaceNumber, \ + alternateSetting) { \ + (urb)->UrbHeader.Function = URB_FUNCTION_SELECT_INTERFACE; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbSelectInterface.Interface.AlternateSetting = \ + (alternateSetting); \ + (urb)->UrbSelectInterface.Interface.InterfaceNumber = \ + (interfaceNumber); \ + (urb)->UrbSelectInterface.ConfigurationHandle = \ + (configurationHandle); } + + +#define UsbBuildVendorRequest(urb, \ + cmd, \ + length, \ + transferFlags, \ + reservedbits, \ + request, \ + value, \ + index, \ + transferBuffer, \ + transferBufferMDL, \ + transferBufferLength, \ + link) { \ + (urb)->UrbHeader.Function = cmd; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbControlVendorClassRequest.TransferBufferLength = \ + (transferBufferLength); \ + (urb)->UrbControlVendorClassRequest.TransferBufferMDL = \ + (transferBufferMDL); \ + (urb)->UrbControlVendorClassRequest.TransferBuffer = \ + (transferBuffer); \ + (urb)->UrbControlVendorClassRequest.RequestTypeReservedBits = \ + (reservedbits); \ + (urb)->UrbControlVendorClassRequest.Request = (request); \ + (urb)->UrbControlVendorClassRequest.Value = (value); \ + (urb)->UrbControlVendorClassRequest.Index = (index); \ + (urb)->UrbControlVendorClassRequest.TransferFlags = \ + (transferFlags); \ + (urb)->UrbControlVendorClassRequest.UrbLink = (link); } + + +#define UsbBuildOsFeatureDescriptorRequest(urb, \ + length, \ + interface, \ + index, \ + transferBuffer, \ + transferBufferMDL, \ + transferBufferLength, \ + link) { \ + (urb)->UrbHeader.Function = \ + URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR; \ + (urb)->UrbHeader.Length = (length); \ + (urb)->UrbOSFeatureDescriptorRequest.TransferBufferLength = \ + (transferBufferLength); \ + (urb)->UrbOSFeatureDescriptorRequest.TransferBufferMDL = \ + (transferBufferMDL); \ + (urb)->UrbOSFeatureDescriptorRequest.TransferBuffer = \ + (transferBuffer); \ + (urb)->UrbOSFeatureDescriptorRequest.InterfaceNumber = \ + (interface); \ + (urb)->UrbOSFeatureDescriptorRequest.MS_FeatureDescriptorIndex = \ + (index); \ + (urb)->UrbOSFeatureDescriptorRequest.UrbLink = (link); } + + + VOID + DDKAPI + USBD_Debug_LogEntry( + IN CHAR *Name, + IN ULONG Info1, + IN ULONG Info2, + IN ULONG Info3 + ); + + VOID + DDKAPI + USBD_GetUSBDIVersion( + PUSBD_VERSION_INFORMATION VersionInformation + ); + + + PUSB_INTERFACE_DESCRIPTOR + DDKAPI + USBD_ParseConfigurationDescriptor( + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + IN UCHAR InterfaceNumber, + IN UCHAR AlternateSetting + ); + + PURB + DDKAPI + USBD_CreateConfigurationRequest( + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + IN OUT PUSHORT Siz + ); + + PUSB_COMMON_DESCRIPTOR + DDKAPI + USBD_ParseDescriptors( + IN PVOID DescriptorBuffer, + IN ULONG TotalLength, + IN PVOID StartPosition, + IN LONG DescriptorType + ); + + PUSB_INTERFACE_DESCRIPTOR + DDKAPI + USBD_ParseConfigurationDescriptorEx( + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + IN PVOID StartPosition, + IN LONG InterfaceNumber, + IN LONG AlternateSetting, + IN LONG InterfaceClass, + IN LONG InterfaceSubClass, + IN LONG InterfaceProtocol + ); + + PURB + DDKAPI + USBD_CreateConfigurationRequestEx( + IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, + IN PUSBD_INTERFACE_LIST_ENTRY InterfaceList + ); + + ULONG + DDKAPI + USBD_GetInterfaceLength( + IN PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, + IN PUCHAR BufferEnd + ); + + VOID + DDKAPI + USBD_RegisterHcFilter( + PDEVICE_OBJECT DeviceObject, + PDEVICE_OBJECT FilterDeviceObject + ); + + NTSTATUS + DDKAPI + USBD_GetPdoRegistryParameter( + IN PDEVICE_OBJECT PhysicalDeviceObject, + IN OUT PVOID Parameter, + IN ULONG ParameterLength, + IN PWCHAR KeyName, + IN ULONG KeyNameLength + ); + + NTSTATUS + DDKAPI + USBD_QueryBusTime( + IN PDEVICE_OBJECT RootHubPdo, + IN PULONG CurrentFrame + ); + + ULONG + DDKAPI + USBD_CalculateUsbBandwidth( + ULONG MaxPacketSize, + UCHAR EndpointType, + BOOLEAN LowSpeed + ); + + +#pragma pack(pop) + +#ifdef __cplusplus +} +#endif + +#endif /* __USBDLIB_H */ + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/vendor_request.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/vendor_request.c new file mode 100644 index 0000000..509c046 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/driver/vendor_request.c @@ -0,0 +1,143 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include "libusb_driver.h" + + +NTSTATUS vendor_class_request(libusb_device_t *dev, + int type, int recipient, + int request, int value, int index, + void *buffer, int size, int direction, + int *ret, int timeout) +{ + NTSTATUS status = STATUS_SUCCESS; + URB urb; + + *ret = 0; + + memset(&urb, 0, sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST)); + + switch (type) + { + case USB_TYPE_CLASS: + USBMSG0("type: class\n"); + switch (recipient) + { + case USB_RECIP_DEVICE: + USBMSG0("recipient: device\n"); + urb.UrbHeader.Function = URB_FUNCTION_CLASS_DEVICE; + break; + case USB_RECIP_INTERFACE: + USBMSG0("recipient: interface\n"); + urb.UrbHeader.Function = URB_FUNCTION_CLASS_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + USBMSG0("recipient: endpoint\n"); + urb.UrbHeader.Function = URB_FUNCTION_CLASS_ENDPOINT; + break; + case USB_RECIP_OTHER: + USBMSG0("recipient: other\n"); + urb.UrbHeader.Function = URB_FUNCTION_CLASS_OTHER; + break; + default: + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + } + break; + case USB_TYPE_VENDOR: + USBMSG0("type: vendor\n"); + switch (recipient) + { + case USB_RECIP_DEVICE: + USBMSG0("recipient: device\n"); + urb.UrbHeader.Function = URB_FUNCTION_VENDOR_DEVICE; + break; + case USB_RECIP_INTERFACE: + USBMSG0("recipient: interface\n"); + urb.UrbHeader.Function = URB_FUNCTION_VENDOR_INTERFACE; + break; + case USB_RECIP_ENDPOINT: + USBMSG0("recipient: endpoint\n"); + urb.UrbHeader.Function = URB_FUNCTION_VENDOR_ENDPOINT; + break; + case USB_RECIP_OTHER: + USBMSG0("recipient: other\n"); + urb.UrbHeader.Function = URB_FUNCTION_VENDOR_OTHER; + break; + default: + // [Kevin Timmerman Patch] + USBMSG("recipient: reserved (0x%02x)\n", recipient); + urb.UrbHeader.Function = URB_FUNCTION_VENDOR_DEVICE; + urb.UrbControlVendorClassRequest.RequestTypeReservedBits = (UCHAR)recipient; + break; + /* + USBERR0("invalid recipient\n"); + return STATUS_INVALID_PARAMETER; + */ + } + break; + default: + USBERR0("invalid type\n"); + return STATUS_INVALID_PARAMETER; + } + + USBMSG("request: 0x%02x\n", request); + USBMSG("value: 0x%04x\n", value); + USBMSG("index: 0x%04x\n", index); + USBMSG("size: %d\n", size); + + if (direction == USBD_TRANSFER_DIRECTION_IN) + { + USBMSG0("direction: in\n"); + } + else + { + USBMSG0("direction: out\n"); + } + + USBMSG("timeout: %d\n", timeout); + + urb.UrbHeader.Length = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST); + urb.UrbControlVendorClassRequest.TransferFlags + = direction | USBD_SHORT_TRANSFER_OK ; + urb.UrbControlVendorClassRequest.TransferBufferLength = size; + urb.UrbControlVendorClassRequest.TransferBufferMDL = NULL; + urb.UrbControlVendorClassRequest.TransferBuffer = buffer; + urb.UrbControlVendorClassRequest.Request = (UCHAR)request; + urb.UrbControlVendorClassRequest.Value = (USHORT)value; + urb.UrbControlVendorClassRequest.Index = (USHORT)index; + + // no maximum timeout check for vendor request. + status = call_usbd_ex(dev, &urb, IOCTL_INTERNAL_USB_SUBMIT_URB, timeout, 0); + + if (!NT_SUCCESS(status) || !USBD_SUCCESS(urb.UrbHeader.Status)) + { + USBERR("request failed: status: 0x%x, urb-status: 0x%x\n", status, urb.UrbHeader.Status); + } + else + { + if (direction == USBD_TRANSFER_DIRECTION_IN) + *ret = urb.UrbControlVendorClassRequest.TransferBufferLength; + USBMSG("%d bytes transmitted\n", + urb.UrbControlVendorClassRequest.TransferBufferLength); + } + + return status; +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.c new file mode 100644 index 0000000..702f466 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.c @@ -0,0 +1,416 @@ +/* Error & Logging functions + + Copyright 2010 Travis Robinson. + website: http://sourceforge.net/projects/libusb-win32 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, please visit www.gnu.org. +*/ + +#include "error.h" +#include +#include +#include + +#if IS_DRIVER + #ifdef __GNUC__ + #define OBJ_KERNEL_HANDLE 0x00000200L + #include + #include + #include + #include "usbdlib_gcc.h" + #else + #include + #endif +#else + #include +#endif + +#define USB_ERROR_BEGIN 500000 + +#ifndef LOG_APPNAME +#define LOG_APPNAME "LOG_APPNAME define missing" +#endif + +#define GetLogLevel(UsbLogLevel) ((UsbLogLevel & LOG_LEVEL_MASK)>LOG_LEVEL_MAX?LOG_LEVEL_MAX:UsbLogLevel & LOG_LEVEL_MASK) +#define GetLogOuput(LogOutputType) (LogOutputType>0?(_LOG_OUTPUT_TYPE & LogOutputType):1) + +void usb_err_v (const char* function, const char* format, va_list args); +void usb_wrn_v (const char* function, const char* format, va_list args); +void usb_msg_v (const char* function, const char* format, va_list args); +void usb_dbg_v (const char* function, const char* format, va_list args); + +void usb_log_v (enum USB_LOG_LEVEL level, const char* function, const char* format, va_list args); +void _usb_log (enum USB_LOG_LEVEL level, const char* app_name, const char* function, const char* format, ...); +void _usb_log_v (enum USB_LOG_LEVEL level, const char* app_name, const char* function, const char* format, va_list args); + +static int usb_log_def_handler(enum USB_LOG_LEVEL level, + const char* app_name, + const char* prefix, + const char* func, + int app_prefix_func_end, + char* message, + int message_length); + +#define STRIP_PREFIX(stringSrc, stringPrefix) \ + (strstr(stringSrc,stringPrefix)==stringSrc?stringSrc+strlen(stringPrefix):stringSrc) + +static const char *log_level_string[LOG_LEVEL_MAX+1] = +{ + "off", + "err", + "wrn", + "", + "dbg", + + "unknown", +}; + +static const char *skipped_function_prefix_list[] = +{ + "usb_registry_", + "usb_", + NULL +}; + +int usb_error_errno = 0; +log_hander_t user_log_hander = NULL; + +#if (defined(_DEBUG) || defined(DEBUG) || defined(DBG)) +int __usb_log_level = LOG_LEVEL_MAX; +#else +int __usb_log_level = LOG_OFF; +#endif + +usb_error_type_t usb_error_type = USB_ERROR_TYPE_NONE; + +const char** skipped_function_prefix = skipped_function_prefix_list; + +#if !IS_DRIVER + +char usb_error_str[LOGBUF_SIZE] = ""; + +char *usb_strerror(void) +{ + switch (usb_error_type) + { + case USB_ERROR_TYPE_NONE: + return "No error"; + case USB_ERROR_TYPE_STRING: + return usb_error_str; + case USB_ERROR_TYPE_ERRNO: + if (usb_error_errno > -USB_ERROR_BEGIN) + return strerror(usb_error_errno); + else + /* Any error we don't know falls under here */ + return "Unknown error"; + } + + return "Unknown error"; +} + +/* returns Windows' last error in a human readable form */ +const char *usb_win_error_to_string(void) +{ + static char tmp[LOGBUF_SIZE]; + + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), + LANG_USER_DEFAULT, tmp, sizeof(tmp) - 1, NULL); + + return tmp; +} + + +int usb_win_error_to_errno(void) +{ + switch (GetLastError()) + { + case ERROR_SUCCESS: + return 0; + case ERROR_INVALID_PARAMETER: + return EINVAL; + case ERROR_SEM_TIMEOUT: + case ERROR_OPERATION_ABORTED: + return ETRANSFER_TIMEDOUT; + case ERROR_NOT_ENOUGH_MEMORY: + return ENOMEM; + default: + return EIO; + } +} + +#endif + +void usb_err(const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + usb_err_v(function, format, args); + va_end(args); +} +void usb_wrn(const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + usb_wrn_v(function, format, args); + va_end(args); +} + +void usb_msg(const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + usb_msg_v(function, format, args); + va_end(args); +} + +void usb_dbg(const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + usb_dbg_v(function, format, args); + va_end(args); +} + +void usb_log(enum USB_LOG_LEVEL level, const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + usb_log_v(level, function, format, args); + va_end(args); +} + +void usb_err_v(const char* function, const char* format, va_list args) +{ + usb_log_v(LOG_ERROR, function, format, args); +} + +void usb_wrn_v(const char* function, const char* format, va_list args) +{ + usb_log_v(LOG_WARNING, function, format, args); +} + +void usb_msg_v(const char* function, const char* format, va_list args) +{ + usb_log_v(LOG_INFO, function, format, args); +} + +void usb_dbg_v(const char* function, const char* format, va_list args) +{ + usb_log_v(LOG_DEBUG, function, format, args); +} + +void usb_log_v(enum USB_LOG_LEVEL level, const char* function, const char* format, va_list args) +{ + _usb_log_v(level, LOG_APPNAME, function, format, args); +} + +void _usb_log(enum USB_LOG_LEVEL level, const char* app_name, const char* function, const char* format, ...) +{ + va_list args; + va_start(args, format); + _usb_log_v(level, app_name, function, format, args); + va_end(args); +} + +void _usb_log_v(enum USB_LOG_LEVEL level, + const char* app_name, + const char* function, + const char* format, + va_list args) +{ + + char local_buffer[LOGBUF_SIZE]; + int totalCount, count; + const char* prefix; + const char* func; + char* buffer; + int masked_level; + int app_prefix_func_end; +#ifndef LOG_STYLE_SHORT + const char** skip_list = NULL; +#endif + + masked_level = GetLogLevel(level); + + if (__usb_log_level < masked_level && masked_level != LOG_ERROR) return; + buffer = local_buffer; + totalCount = 0; + count = 0; + prefix = log_level_string[masked_level]; + func = function; + app_prefix_func_end = 0; + + if (masked_level > LOG_LEVEL_MAX) masked_level = LOG_LEVEL_MAX; + + if ((level & LOG_RAW) == LOG_RAW) + { + count = _vsnprintf(buffer, LOGBUF_SIZE-1, format, args); + if (count > 0) + { + buffer += count; + totalCount += count; + } + } + else + { +#ifdef LOG_STYLE_SHORT + if ((prefix) && strlen(prefix)) + { + count = _snprintf(buffer, (LOGBUF_SIZE-1), "%s: ", prefix); + } + else + { + count = 0; + } + func = ""; +#else + func = function; + + if (func) + { + // strip some prefixes to shorten function names + skip_list=skipped_function_prefix; + while(*skip_list && ((func)) && func[0]) + { + func = STRIP_PREFIX(func,skip_list[0]); + skip_list++; + } + } + + if(!func) func="none"; + + // print app name, level string and short function name + if ((prefix) && strlen(prefix)) + { + count = _snprintf(buffer, (LOGBUF_SIZE-1), "%s:%s [%s] ", app_name, prefix, func); + } + else + { + count = _snprintf(buffer, (LOGBUF_SIZE-1), "%s:[%s] ", app_name, func); + } +#endif + + if (count >= 0) + { + app_prefix_func_end = count; + buffer += count; + totalCount += count; + count = _vsnprintf(buffer, (LOGBUF_SIZE-1) - totalCount, format, args); + if (count > 0) + { + buffer += count; + totalCount += count; + } + } + } + + if (count < 0) + totalCount = LOGBUF_SIZE - 1; + + // make sure its null terminated + local_buffer[totalCount] = 0; + +#if (!IS_DRIVER) + if (masked_level == LOG_ERROR) + { + // if this is an error message then store it + strncpy(usb_error_str, local_buffer, totalCount); + usb_error_str[totalCount] = '\0'; + usb_error_type = USB_ERROR_TYPE_STRING; + } +#endif + + if (user_log_hander) + { + if (user_log_hander(level, app_name, prefix, func, app_prefix_func_end, local_buffer, totalCount)) + return; + } + if (__usb_log_level >= masked_level) + { + usb_log_def_handler(level, app_name, prefix, func, app_prefix_func_end, local_buffer, totalCount); + } +} + +void usb_log_set_level(enum USB_LOG_LEVEL level) +{ + // Debug builds of the driver force all messages on; all the time; + // Application can no longer change this. + // +#if (defined(_DEBUG) || defined(DEBUG) || defined(DBG)) + __usb_log_level = LOG_LEVEL_MAX; +#else + __usb_log_level = level > LOG_LEVEL_MAX ? LOG_LEVEL_MAX : level; +#endif +} + +int usb_log_get_level() +{ + return __usb_log_level; +} + +/* Default log handler +*/ +static int usb_log_def_handler(enum USB_LOG_LEVEL level, + const char* app_name, + const char* prefix, + const char* func, + int app_prefix_func_end, + char* message, + int message_length) +{ +#if IS_DRIVER + DbgPrint("%s",message); +#else + #if GetLogOuput(LOG_OUTPUT_TYPE_FILE) + FILE* file; + file = fopen(LOG_FILE_PATH,"a"); + if (file) + { + fwrite(message,1,strlen(message),file); + fflush(file); + fclose(file); + } + #endif + + #if GetLogOuput(LOG_OUTPUT_TYPE_STDERR) + fprintf(stderr, "%s", message); + #endif + + #if GetLogOuput(LOG_OUTPUT_TYPE_DEBUGWINDOW) + OutputDebugStringA(message); + #endif + + + #if GetLogOuput(LOG_OUTPUT_TYPE_MSGBOX) + if (GetLogLevel(level)==LOG_ERROR) + { + message[app_prefix_func_end-1]='\0'; + MessageBoxA(NULL,message+strlen(message),message,MB_OK|MB_ICONERROR); + } + #endif + +#endif // IS_DRIVER + + return 1; +} + +void usb_log_set_handler(log_hander_t log_hander) +{ + user_log_hander = log_hander; +} + +log_hander_t usb_log_get_handler(void) +{ + return user_log_hander; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.h new file mode 100644 index 0000000..3dbd758 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/error.h @@ -0,0 +1,187 @@ +/* Error & Logging functions + + Copyright 2010 Travis Robinson. + website: http://sourceforge.net/projects/libusb-win32 + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU (LGPL) General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU (LGPL) General Public + License for more details. + + You should have received a copy of the GNU (LGPL) General Public License + along with this program; if not, please visit www.gnu.org. +*/ + +#ifndef __ERROR_H__ +#define __ERROR_H__ + +#include + + +enum USB_LOG_LEVEL +{ + LOG_OFF, + LOG_ERROR, + LOG_WARNING, + LOG_INFO, + LOG_DEBUG, + + LOG_LEVEL_MAX, + LOG_LEVEL_MASK=0xff, + LOG_RAW=0x100 + +}; + +/* Connection timed out */ +#define ETRANSFER_TIMEDOUT 116 + +#define LOGBUF_SIZE 512 + +// TARGETTYPEs +#define PROGRAMconsole 0 +#define PROGRAMwindows 1 +#define DYNLINK 2 +#define DRIVER 3 + +// default TARGETTYPE +#ifndef TARGETTYPE +#define TARGETTYPE PROGRAMconsole +#endif + +#define IS_DRIVER (TARGETTYPE==DRIVER) +#define IS_CONSOLE_APP (TARGETTYPE==PROGRAMconsole) +#define IS_WINDOW_APP (TARGETTYPE==PROGRAMwindows) +#define IS_APP (IS_CONSOLE_APP || IS_WINDOW_APP) +#define IS_DLL (TARGETTYPE==DYNLINK) + +// NOTE: LOG_OUTPUT_TYPEs can be combined +// writes log messages to standard error output +#define LOG_OUTPUT_TYPE_STDERR 0x001 + +// writes log messages to Win32 OutputDebugString (DbgPrint for drivers) +#define LOG_OUTPUT_TYPE_DEBUGWINDOW 0x0002 +#define LOG_OUTPUT_TYPE_DBGPRINT 0x0002 + +// displays error log messages to a messagebox (not recommended) +#define LOG_OUTPUT_TYPE_MSGBOX 0x0004 + +// writes log messages to Kernel-mode DbgPrint + +// writes log messages directly to a file +#define LOG_OUTPUT_TYPE_FILE 0x0010 + +// strips all log messages except errors +#define LOG_OUTPUT_TYPE_REMOVE 0x0020 + +#define LOG_OUTPUT_TYPE_DEFAULT 0x0100 + +// File logging is never enabled by default. +// The LOG_OUTPUT_TYPE define must be manually +// set to enable file logging. +#if !IS_DRIVER + #ifndef LOG_DIRECTORY + #define LOG_FILE_PATH LOG_APPNAME ".log" + #else + #define LOG_FILE_PATH LOG_DIRECTORY LOG_APPNAME ".log" + #endif +#endif + +#if (IS_DRIVER) || (IS_DLL) || (IS_WINDOW_APP) + // default logging for drivers and dlls + #define DEF_LOG_OUTPUT_TYPE LOG_OUTPUT_TYPE_DEBUGWINDOW +#else + // default logging for applications and everything else + #define DEF_LOG_OUTPUT_TYPE LOG_OUTPUT_TYPE_STDERR +#endif + +#define _usb_log_do_nothing() while(0) +// Default logging output +#ifdef LOG_OUTPUT_TYPE + // all log messages (except errors) are stripped + #if (LOG_OUTPUT_TYPE & LOG_OUTPUT_TYPE_REMOVE) + #define USBMSG(format,...) _usb_log_do_nothing() + #define USBWRN(format,...) _usb_log_do_nothing() + #define USBDBG(format,...) _usb_log_do_nothing() + #define USBRAWMSG(format,...) _usb_log_do_nothing() + + #define USBMSG0(format) _usb_log_do_nothing() + #define USBWRN0(format) _usb_log_do_nothing() + #define USBDBG0(format) _usb_log_do_nothing() + #define USBRAWMSG0(format) _usb_log_do_nothing() + #endif + + #if (LOG_OUTPUT_TYPE & LOG_OUTPUT_TYPE_DEFAULT) + #define _LOG_OUTPUT_TYPE ((LOG_OUTPUT_TYPE & 0xff)|DEF_LOG_OUTPUT_TYPE) + #else + #define _LOG_OUTPUT_TYPE (LOG_OUTPUT_TYPE) + #endif + +#else + // if the LOG_OUTPUT_TYPE has not been manually set use + // the as defaults. + #define _LOG_OUTPUT_TYPE DEF_LOG_OUTPUT_TYPE +#endif + +// always keep error messages +#define USBERR(format,...) usb_err(__FUNCTION__,format,__VA_ARGS__) +#define USBERR0(format) usb_err(__FUNCTION__,"%s",format) + +// only keep debug log messages in debug builds +#if !(defined(_DEBUG) || defined(DEBUG) || defined(DBG)) && !defined(USBDBG) + #define USBDBG(format,...) _usb_log_do_nothing() + #define USBDBG0(format) _usb_log_do_nothing() +#endif + +// if USBMSG has not been defined as empty (see above) +// then keep all the info and warning log messages +#ifndef USBMSG + #define USBMSG(format,...) usb_msg(__FUNCTION__,format,__VA_ARGS__) + #define USBWRN(format,...) usb_wrn(__FUNCTION__,format,__VA_ARGS__) + #define USBRAWMSG(format,...) usb_log(LOG_INFO|LOG_RAW,__FUNCTION__,format,__VA_ARGS__) + + #define USBMSG0(format) usb_msg(__FUNCTION__,"%s",format) + #define USBWRN0(format) usb_wrn(__FUNCTION__,"%s",format) + #define USBRAWMSG0(format) usb_log(LOG_INFO|LOG_RAW,__FUNCTION__,"%s",format) +#endif + +// if USBDBG has not been defined as empty (see above) +// then keep all the debug log messages +#ifndef USBDBG + #define USBDBG(format,...) usb_dbg(__FUNCTION__,format,__VA_ARGS__) + #define USBDBG0(format) usb_dbg(__FUNCTION__,"%s",format) +#endif + +typedef enum +{ + USB_ERROR_TYPE_NONE = 0, + USB_ERROR_TYPE_STRING, + USB_ERROR_TYPE_ERRNO, +} usb_error_type_t; + +typedef int (*log_hander_t)(enum USB_LOG_LEVEL level, const char*,const char*,const char*, int, char*, int); + +#if (!IS_DRIVER) + const char *usb_win_error_to_string(void); + int usb_win_error_to_errno(void); +#endif + +void usb_log_set_level(enum USB_LOG_LEVEL level); +int usb_log_get_level(void); +void usb_log_set_handler(log_hander_t log_hander); +log_hander_t usb_log_get_handler(void); + +// these are the core logging functions used by the logging macros +// (not used directly) +void usb_err (const char* function, const char* format, ...); +void usb_wrn (const char* function, const char* format, ...); +void usb_msg (const char* function, const char* format, ...); +void usb_dbg (const char* function, const char* format, ...); +void usb_log (enum USB_LOG_LEVEL level, const char* function, const char* format, ...); + +#endif /* _ERROR_H_ */ + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.c new file mode 100644 index 0000000..54d5721 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.c @@ -0,0 +1,1236 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2006 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifdef __GNUC__ + #if !defined(WINVER) + #define WINVER 0x0500 + #endif + #if !defined(_WIN32_IE) + #define _WIN32_IE 0x0501 + #endif +#endif + +#define INITGUID +#include "libusb-win32_version.h" +#include "libwdi.h" +#include "msapi_utf8.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __INF_WIZARD_C__ +#include "inf_wizard_rc.rc" + +#define MAX_TEXT_LENGTH 256 + +// Copied from libwdi +#define safe_free(p) do {if (p != NULL) {free((void*)p); p = NULL;}} while(0) +#define safe_min(a, b) min((size_t)(a), (size_t)(b)) +#define safe_strcp(dst, dst_max, src, count) do {memcpy(dst, src, safe_min(count, dst_max)); \ + ((char*)dst)[safe_min(count, dst_max)-1] = 0;} while(0) +#define safe_strcpy(dst, dst_max, src) safe_strcp(dst, dst_max, src, safe_strlen(src)+1) +#define safe_strncat(dst, dst_max, src, count) strncat(dst, src, safe_min(count, dst_max - safe_strlen(dst) - 1)) +#define safe_strcat(dst, dst_max, src) safe_strncat(dst, dst_max, src, safe_strlen(src)+1) +#define safe_strcmp(str1, str2) strcmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2)) +#define safe_strncmp(str1, str2, count) strncmp(((str1==NULL)?"":str1), ((str2==NULL)?"":str2), count) +#define safe_closehandle(h) do {if (h != INVALID_HANDLE_VALUE) {CloseHandle(h); h = INVALID_HANDLE_VALUE;}} while(0) +#define safe_sprintf _snprintf +#define safe_strlen(str) ((((char*)str)==NULL)?0:strlen(str)) +#define safe_swprintf _snwprintf +#define safe_strdup _strdup + +#define _STRINGIFY(x) #x +#define STRINGIFY(x) _STRINGIFY(x) + + +// Used for device notification +DEFINE_GUID(GUID_DEVINTERFACE_USB_HUB, 0xf18a0e88, 0xc30c, 0x11d0, 0x88, \ + 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8); + +DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, \ + 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); + +typedef struct +{ + struct wdi_device_info* wdi; + + char description[MAX_PATH]; + char manufacturer[MAX_PATH]; + + char inf_name[MAX_PATH]; + char inf_dir [MAX_PATH]; + char inf_path[MAX_PATH]; + + BOOL user_allocated_wdi; + BOOL modified; // unused + + VS_FIXEDFILEINFO driver_info; +} device_context_t; + +typedef struct +{ + UINT controlID; + const char* message; +}create_tooltip_t; + +const char info_text_0[] = +"This program will create an .inf file for your device.\n\n" +"Before clicking \"Next\" make sure that your device is connected to the " +"system.\n"; + +const char info_text_1[] = +"A windows driver installation package has been created for the following " +"device:"; + +const char package_contents_fmt_0[] = +"This package contains %s v%d.%d.%d.%d drivers and support for the following platforms: %s."; + +const char package_contents_fmt_1[] = +"This package contains an inf file only."; + + +const char list_header_text[] = +"Select your device from the list of detected devices below. " +"If your device isn't listed then either connect it or click \"Next\" " +"and enter your device description manually."; + +create_tooltip_t tooltips_dlg2[]= +{ + {ID_TEXT_VID, + "A VID is a 16-bit vendor number (Vendor ID). A vendor ID is " + "necessary for developing a USB product. The USB-IF is responsible " + "for issuing USB vendor ID's to product manufacturers."}, + + {ID_TEXT_PID, + "A PID is a 16-bit product number (Product ID)."}, + + {ID_TEXT_MI, + "If not blank, creates a driver package targeting a specific interface."}, + + {ID_TEXT_MANUFACTURER, + "Manufacturer or vendor string."}, + + {ID_TEXT_DEV_NAME, + "Name or description."}, + + {0,NULL} +}; + +create_tooltip_t tooltips_dlg3[]= +{ + {ID_BUTTON_INSTALLNOW, + "Install this driver package now."}, + + {ID_BUTTON_NEXT, + "Finish without installing."}, + + {0,NULL} +}; + +create_tooltip_t tooltips_dlg1[]= +{ + {ID_LIST, + LPSTR_TEXTCALLBACK}, + + {0,NULL} +}; + +HICON mIcon; + +struct wdi_device_info* wdi_dev_list = NULL; + +HINSTANCE g_hInst = NULL; +WNDPROC device_list_wndproc_orig; + +TOOLINFO g_toolItem; + +HWND g_hwndTrackingTT = NULL; +BOOL g_TrackingMouse = FALSE; + +HWND create_tooltip(HWND hMain, HINSTANCE hInstance, UINT max_tip_width, create_tooltip_t tool_tips[]); +HWND CreateTrackingToolTip(HWND hDlg, TCHAR* pText); + +HWND create_label(char* text, HWND hParent, HINSTANCE hInstance, UINT x, UINT y, UINT cx, UINT cy, DWORD dwStyle, UINT uID); +HWND create_labeled_text(char* label, char* text, + HWND hParent, HINSTANCE hInstance, + UINT left, UINT top, UINT height, + UINT label_width, UINT text_width, + UINT uIDLabel, UINT uIDText); + +BOOL CALLBACK dialog_proc_0(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); +BOOL CALLBACK dialog_proc_1(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); +BOOL CALLBACK dialog_proc_2(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); +BOOL CALLBACK dialog_proc_3(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); + +static void device_list_init(HWND list); +static void device_list_refresh(HWND list); +static void device_list_add(HWND list, device_context_t *device); +static void device_list_clean(HWND list); + +static int save_file(HWND dialog, device_context_t *device); + +void close_file(FILE** file); + +int infwizard_install_driver(HWND dialog, device_context_t *device); +int infwizard_prepare_driver(HWND dialog, device_context_t *device); + +void output_debug(char* format,...) +{ + va_list args; + char msg[256]; + + va_start (args, format); + vsprintf(msg, format, args); + va_end (args); + + OutputDebugStringA(msg); +} + +int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev_instance, + LPSTR cmd_line, int cmd_show) +{ + device_context_t device; + int next_dialog; + + LoadLibrary("comctl32.dll"); + InitCommonControls(); + + memset(&device, 0, sizeof(device)); + + next_dialog = ID_DIALOG_0; + + mIcon = LoadIcon(instance, MAKEINTRESOURCE(IDR_MAIN_ICON)); + + g_hInst = instance; + + while (next_dialog) + { + g_TrackingMouse = FALSE; + + switch (next_dialog) + { + case ID_DIALOG_0: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_0, + (LPARAM)&device); + + break; + case ID_DIALOG_1: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_1, + (LPARAM)&device); + break; + case ID_DIALOG_2: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_2, + (LPARAM)&device); + break; + case ID_DIALOG_3: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_3, + (LPARAM)&device); + break; + default: + ; + } + } + + if (device.user_allocated_wdi) + { + device.user_allocated_wdi = FALSE; + if (device.wdi) + { + free(device.wdi); + device.wdi = NULL; + } + } + + if (wdi_dev_list) + { + wdi_destroy_list(wdi_dev_list); + wdi_dev_list = NULL; + } + + if (mIcon) + { + DestroyIcon(mIcon); + mIcon = NULL; + } + return 0; +} + +BOOL CALLBACK dialog_proc_0(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + SetWindowText(GetDlgItem(dialog, ID_INFO_TEXT), info_text_0); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_NEXT: + EndDialog(dialog, ID_DIALOG_1); + return TRUE ; + case ID_BUTTON_CANCEL: + case IDCANCEL: + EndDialog(dialog, 0); + return TRUE ; + } + } + + return FALSE; +} + +INT_PTR CALLBACK device_list_wndproc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + TCHAR tipText[80]; + POINT pt; + static int oldX, oldY; + int newX, newY; + LVHITTESTINFO hitTestInfo; + LVITEM lvitem; + device_context_t* dev_context; + BOOL ignored; + + switch(message) + { + case WM_MOUSELEAVE: + // The mouse pointer has left our window. + // Deactivate the tooltip. + SendMessage(g_hwndTrackingTT, TTM_TRACKACTIVATE, (WPARAM)FALSE, (LPARAM)&g_toolItem); + g_TrackingMouse = FALSE; + return FALSE; + + case WM_MOUSEMOVE: + + if (!g_TrackingMouse) + { + // The mouse has just entered the window. + + // Request notification when the mouse leaves. + TRACKMOUSEEVENT tme = { sizeof(TRACKMOUSEEVENT) }; + tme.hwndTrack = hDlg; + tme.dwFlags = TME_LEAVE; + TrackMouseEvent(&tme); + + // Activate the tooltip. + SendMessage(g_hwndTrackingTT, TTM_TRACKACTIVATE, + (WPARAM)TRUE, (LPARAM)&g_toolItem); + g_TrackingMouse = TRUE; + } + + newX = LOWORD(lParam); + newY = HIWORD(lParam); + + // Make sure the mouse has actually moved. The presence of the tooltip + // causes Windows to send the message continuously. + if ((newX != oldX) || (newY != oldY)) + { + oldX = newX; + oldY = newY; + + memset(&hitTestInfo,0,sizeof(hitTestInfo)); + hitTestInfo.pt.x = newX; + hitTestInfo.pt.y = newY; + + if ((ListView_HitTest(hDlg, &hitTestInfo) == -1) || newX > ListView_GetColumnWidth(hDlg, 0)) + { + safe_sprintf(tipText, sizeof(tipText) - 1, TEXT("%s"), TEXT("")); + SendMessage(g_hwndTrackingTT, TTM_TRACKACTIVATE,FALSE, (LPARAM)&g_toolItem); + } + else + { + SendMessage(g_hwndTrackingTT, TTM_SETDELAYTIME,TTDT_INITIAL, 1000); + + memset(&lvitem, 0 , sizeof(lvitem)); + + lvitem.iItem = hitTestInfo.iItem; + lvitem.mask = LVIF_PARAM; + ignored = ListView_GetItem(hDlg,&lvitem); + + dev_context = (device_context_t*)lvitem.lParam; + // Update the text. + safe_sprintf(tipText, sizeof(tipText)-1 , TEXT("%s"), wdi_get_vendor_name(dev_context->wdi->vid)); + SendMessage(g_hwndTrackingTT, TTM_TRACKACTIVATE,TRUE, (LPARAM)&g_toolItem); + + } + g_toolItem.lpszText = tipText; + SendMessage(g_hwndTrackingTT, TTM_SETTOOLINFO, 0, (LPARAM)&g_toolItem); + + // Position the tooltip. + // The coordinates are adjusted so that the tooltip does not + // overlap the mouse pointer. + pt.x = newX; + pt.y = newY; + + ClientToScreen(hDlg, &pt); + SendMessage(g_hwndTrackingTT, TTM_TRACKPOSITION, + 0, (LPARAM)MAKELONG(pt.x + 10, pt.y - 20)); + } + break; + } + return CallWindowProc(device_list_wndproc_orig, hDlg, message, wParam, lParam); +} + +BOOL CALLBACK dialog_proc_1(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + static HDEVNOTIFY notification_handle_hub = NULL; + static HDEVNOTIFY notification_handle_dev = NULL; + DEV_BROADCAST_HDR *hdr = (DEV_BROADCAST_HDR *) lParam; + DEV_BROADCAST_DEVICEINTERFACE dev_if; + static device_context_t *device = NULL; + HWND list = GetDlgItem(dialog, ID_LIST); + LVITEM item; + + switch (message) + { + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + + device = (device_context_t *)lParam; + if (device->user_allocated_wdi) + { + if (device->wdi) + { + free(device->wdi); + device->wdi = NULL; + } + device->user_allocated_wdi = FALSE; + } + g_hwndTrackingTT = CreateTrackingToolTip(list, TEXT(" ")); + +#if defined(_WIN64) + device_list_wndproc_orig = (WNDPROC)SetWindowLongPtr(list, GWLP_WNDPROC, (UINT_PTR)device_list_wndproc); +#else + device_list_wndproc_orig = (WNDPROC)SetWindowLongPtr(list, GWL_WNDPROC, (UINT_PTR)device_list_wndproc); +#endif + + memset(device, 0, sizeof(*device)); + + SetWindowText(GetDlgItem(dialog, ID_LIST_HEADER_TEXT), list_header_text); + device_list_init(list); + device_list_refresh(list); + + dev_if.dbcc_size = sizeof(dev_if); + dev_if.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_HUB; + notification_handle_hub = RegisterDeviceNotification(dialog, &dev_if, 0); + + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; + notification_handle_dev = RegisterDeviceNotification(dialog, &dev_if, 0); + + return TRUE; + + case WM_DEVICECHANGE: + switch (wParam) + { + case DBT_DEVICEREMOVECOMPLETE: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + device_list_refresh(list); + break; + case DBT_DEVICEARRIVAL: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + device_list_refresh(list); + break; + default: + ; + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_NEXT: + if (notification_handle_hub) + UnregisterDeviceNotification(notification_handle_hub); + if (notification_handle_dev) + UnregisterDeviceNotification(notification_handle_dev); + + memset(&item, 0, sizeof(item)); + item.mask = LVIF_TEXT | LVIF_PARAM; + item.iItem = ListView_GetNextItem(list, -1, LVNI_SELECTED); + + memset(device, 0, sizeof(*device)); + + if (item.iItem >= 0) + { + if (ListView_GetItem(list, &item)) + { + if (item.lParam) + { + memcpy(device, (void *)item.lParam, sizeof(*device)); + } + } + } + + if (!device->wdi) + { + device->user_allocated_wdi = TRUE; + device->wdi = malloc(sizeof(struct wdi_device_info)); + memset(device->wdi,0,sizeof(struct wdi_device_info)); + + device->wdi->vid = 0x12AB; + device->wdi->pid = 0x12AB; + } + + if (!device->manufacturer[0]) + strcpy(device->manufacturer, "Insert manufacturer name"); + if (!device->description[0]) + strcpy(device->description, "Insert device description"); + + if (notification_handle_hub) + UnregisterDeviceNotification(notification_handle_hub); + if (notification_handle_dev) + UnregisterDeviceNotification(notification_handle_dev); + + device_list_clean(list); + + EndDialog(dialog, ID_DIALOG_2); + return TRUE; + + case ID_BUTTON_BACK: + device_list_clean(list); + if (notification_handle_hub) + UnregisterDeviceNotification(notification_handle_hub); + if (notification_handle_dev) + UnregisterDeviceNotification(notification_handle_dev); + EndDialog(dialog, ID_DIALOG_0); + return TRUE ; + + case ID_BUTTON_CANCEL: + case IDCANCEL: + device_list_clean(list); + if (notification_handle_hub) + UnregisterDeviceNotification(notification_handle_hub); + if (notification_handle_dev) + UnregisterDeviceNotification(notification_handle_dev); + EndDialog(dialog, 0); + return TRUE ; + } + } + + return FALSE; +} + +BOOL CALLBACK dialog_proc_2(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + static device_context_t *device = NULL; + static HWND hToolTip; + char tmp[MAX_TEXT_LENGTH]; + int val; + + switch (message) + { + + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + + device = (device_context_t *)lParam; + + if (device) + { + wdi_is_driver_supported(WDI_LIBUSB, &device->driver_info); + + //g_hwndTrackingTT = CreateTrackingToolTip(dialog,TEXT(" ")); + hToolTip = create_tooltip(dialog, g_hInst, 300, tooltips_dlg2); + + memset(tmp, 0, sizeof(tmp)); + safe_sprintf(tmp,sizeof(tmp) - 1, "0x%04X", device->wdi->vid); + SetWindowText(GetDlgItem(dialog, ID_TEXT_VID), tmp); + + memset(tmp, 0, sizeof(tmp)); + safe_sprintf(tmp,sizeof(tmp) - 1, "0x%04X", device->wdi->pid); + SetWindowText(GetDlgItem(dialog, ID_TEXT_PID), tmp); + + + memset(tmp, 0, sizeof(tmp)); + if (device->wdi->is_composite) + safe_sprintf(tmp,sizeof(tmp) - 1, "0x%02X", device->wdi->mi); + SetWindowText(GetDlgItem(dialog, ID_TEXT_MI), tmp); + + SetWindowTextU(GetDlgItem(dialog, ID_TEXT_MANUFACTURER), + device->manufacturer); + + SetWindowTextU(GetDlgItem(dialog, ID_TEXT_DEV_NAME), + device->description); + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_NEXT: + //memset(device, 0, sizeof(*device)); + device->wdi->is_composite=false; + + GetWindowTextU(GetDlgItem(dialog, ID_TEXT_MANUFACTURER), + device->manufacturer, sizeof(tmp)); + + GetWindowTextU(GetDlgItem(dialog, ID_TEXT_DEV_NAME), + device->description, sizeof(tmp)); + + GetWindowText(GetDlgItem(dialog, ID_TEXT_VID), tmp, sizeof(tmp)); + if(sscanf(tmp, "0x%04x", &val) == 1) + device->wdi->vid = (WORD)val; + + GetWindowText(GetDlgItem(dialog, ID_TEXT_PID), tmp, sizeof(tmp)); + if(sscanf(tmp, "0x%04x", &val) == 1) + device->wdi->pid = (WORD)val; + + GetWindowText(GetDlgItem(dialog, ID_TEXT_MI), tmp, sizeof(tmp)); + + if (sscanf(tmp, "0x%02x", &val) == 1) + { + device->wdi->mi = (BYTE)val; + device->wdi->is_composite=true; + } + if (save_file(dialog, device)) + EndDialog(dialog, ID_DIALOG_3); + return TRUE ; + case ID_BUTTON_BACK: + EndDialog(dialog, ID_DIALOG_1); + return TRUE ; + case ID_BUTTON_CANCEL: + case IDCANCEL: + EndDialog(dialog, 0); + return TRUE ; + } + } + + return FALSE; +} +HWND create_label(char* text, HWND hParent, HINSTANCE hInstance, UINT x, UINT y, UINT cx, UINT cy, DWORD dwStyle, UINT uID) +{ + return CreateWindowU("Static", text, WS_CHILD | WS_VISIBLE | dwStyle, + x, y, cx, cy, + hParent, (HMENU)((UINT_PTR)uID), hInstance, 0); +} + +HWND create_labeled_text(char* label, char* text, + HWND hParent, HINSTANCE hInstance, + UINT left, UINT top, UINT height, + UINT label_width, UINT text_width, + UINT uIDLabel, UINT uIDText) +{ + HWND hwnd = NULL; + HFONT dlgFont; + LOGFONT logFont; + HFONT labelFont; + + // Get the font from the parent dialog + dlgFont = (HFONT)SendMessage(hParent,WM_GETFONT,0,0); + + if (label) + { + // convert it to a logfont + GetObject(dlgFont,sizeof(logFont),&logFont); + + // make it bold + logFont.lfWeight*=2; + + // convert it back to HFONT + labelFont = CreateFontIndirectA(&logFont); + } + else + { + labelFont = dlgFont; + } + + if (label) + { + // create the label text and set the label (bold) font + hwnd = create_label(label, hParent, hInstance, left, top, label_width, height, SS_LEFT, uIDLabel); + SendMessage(hwnd, WM_SETFONT, (WPARAM)labelFont, TRUE); + } + if (text) + { + if (label) + { + text_width-=5; + left+=label_width+5; + } + // create the label text and set the dialog font + hwnd = create_label(text, hParent, hInstance, left, top, text_width, height, SS_LEFT, uIDText); + SendMessage(hwnd,WM_SETFONT, (WPARAM)dlgFont, TRUE); + } + return hwnd; +} + +BOOL CALLBACK dialog_proc_3(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + static device_context_t *device = NULL; + char* bufferLabel = NULL; + char* bufferText = NULL; + int ret; + UINT x,y; + UINT TXT_WIDTH = 200; + UINT LBL_WIDTH = 150; + UINT LBL_HEIGHT = 15; + UINT LBL_SEP = 5; + HWND hwnd; + static HBRUSH hBrushStatic = NULL; + + RECT rect; + + switch (message) + { + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + + device = (device_context_t *)lParam; + + create_tooltip(dialog, g_hInst, 300, tooltips_dlg3); + + bufferLabel = malloc(MAX_TEXT_LENGTH*2); + bufferText = bufferLabel+MAX_TEXT_LENGTH; + if (bufferLabel) + { + GetWindowRect(GetDlgItem(dialog,IDG_MAIN),&rect); + TXT_WIDTH = rect.right-rect.left-30-LBL_WIDTH; + + y = 40; + x = 30; + safe_sprintf(bufferLabel, MAX_TEXT_LENGTH, "%s", info_text_1); + create_labeled_text(bufferLabel,NULL, dialog, g_hInst, x, y, LBL_HEIGHT * 2,LBL_WIDTH+TXT_WIDTH,0, ID_TEXT_HIGHLIGHT_INFO, ID_TEXT_HIGHLIGHT_INFO); + + y += LBL_HEIGHT*2+LBL_SEP*2; + safe_strcpy(bufferLabel, MAX_TEXT_LENGTH, "Vendor ID:"); + safe_sprintf(bufferText, MAX_TEXT_LENGTH, "0x%04X", device->wdi->vid); + create_labeled_text(bufferLabel,bufferText,dialog,g_hInst,x,y,LBL_HEIGHT,LBL_WIDTH,TXT_WIDTH, ID_INFO_TEXT, ID_INFO_TEXT); + + y += LBL_HEIGHT+LBL_SEP; + safe_strcpy(bufferLabel, MAX_TEXT_LENGTH, "Product ID:"); + safe_sprintf(bufferText, MAX_TEXT_LENGTH, "0x%04X", device->wdi->pid); + create_labeled_text(bufferLabel,bufferText,dialog,g_hInst,x,y,LBL_HEIGHT,LBL_WIDTH,TXT_WIDTH, ID_INFO_TEXT, ID_INFO_TEXT); + + if (device->wdi->is_composite) + { + y += LBL_HEIGHT+LBL_SEP; + safe_strcpy(bufferLabel, MAX_TEXT_LENGTH, "Interface # (MI):"); + safe_sprintf(bufferText, MAX_TEXT_LENGTH, "0x%02X", device->wdi->mi); + create_labeled_text(bufferLabel,bufferText,dialog,g_hInst,x,y,LBL_HEIGHT,LBL_WIDTH,TXT_WIDTH, ID_INFO_TEXT, ID_INFO_TEXT); + } + + y += LBL_HEIGHT+LBL_SEP; + safe_strcpy(bufferLabel, MAX_TEXT_LENGTH, "Device description:"); + safe_sprintf(bufferText, MAX_TEXT_LENGTH, "%s", device->description); + create_labeled_text(bufferLabel,bufferText,dialog,g_hInst,x,y,LBL_HEIGHT,LBL_WIDTH,TXT_WIDTH, ID_INFO_TEXT, ID_INFO_TEXT); + + y += LBL_HEIGHT+LBL_SEP; + safe_strcpy(bufferLabel, MAX_TEXT_LENGTH, "Manufacturer:"); + safe_sprintf(bufferText, MAX_TEXT_LENGTH, "%s", device->manufacturer); + create_labeled_text(bufferLabel,bufferText,dialog,g_hInst,x,y,LBL_HEIGHT,LBL_WIDTH,TXT_WIDTH, ID_INFO_TEXT, ID_INFO_TEXT); + + y += LBL_HEIGHT+LBL_SEP*2; + if (device->driver_info.dwSignature) + { + safe_sprintf(bufferLabel, MAX_TEXT_LENGTH, package_contents_fmt_0, "libusb-win32", + (int)device->driver_info.dwFileVersionMS>>16, (int)device->driver_info.dwFileVersionMS&0xFFFF, + (int)device->driver_info.dwFileVersionLS>>16, (int)device->driver_info.dwFileVersionLS&0xFFFF, + "x86, x64, ia64"); + + } + else + { + safe_sprintf(bufferLabel, MAX_TEXT_LENGTH, "%s", package_contents_fmt_1); + } + hwnd = create_labeled_text(NULL,bufferLabel,dialog,g_hInst,x,y,LBL_HEIGHT*2, 0, LBL_WIDTH+TXT_WIDTH, ID_TEXT_HIGHLIGHT_INFO, ID_TEXT_HIGHLIGHT_INFO); + + free(bufferLabel); + + } + if ((device->driver_info.dwSignature) && GetFileAttributesU(device->inf_path)!=INVALID_FILE_ATTRIBUTES) + EnableWindow(GetDlgItem(dialog, ID_BUTTON_INSTALLNOW), TRUE); + else + EnableWindow(GetDlgItem(dialog, ID_BUTTON_INSTALLNOW), FALSE); + + return TRUE; + case WM_CTLCOLORSTATIC: + { + /// + /// By responding to this message, the parent window can use the + /// specified device context handle to set the text and background + /// colors of the static control. + /// + /// If an application processes this message, the return value is a + /// handle to a brush that the system uses to paint the background + /// of the static control. + /// + if(ID_TEXT_HIGHLIGHT_INFO == GetDlgCtrlID((HWND)lParam)) + { + SetBkColor((HDC) wParam, (COLORREF) GetSysColor(COLOR_BTNFACE)); + + SetTextColor((HDC) wParam, GetSysColor(COLOR_ACTIVECAPTION)); + SetBkMode((HDC) wParam, TRANSPARENT); + + if(!hBrushStatic) + { + hBrushStatic = CreateSolidBrush( (COLORREF) GetSysColor(COLOR_BTNFACE)); + } + + return PtrToUlong(hBrushStatic); + } + + // Let Windows do default handling + return FALSE; + } + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_INSTALLNOW: + // Disable the install now button (forever) + EnableWindow(GetDlgItem(dialog,ID_BUTTON_INSTALLNOW),FALSE); + + // Set the wait cursor and installing text + SetCursor(LoadCursor(NULL,IDC_WAIT)); + SetWindowText(GetDlgItem(dialog, IDL_INSTALLING_TEXT), "Installing driver, please wait.."); + + // Install the driver + ret = infwizard_install_driver(dialog, device); + + // Clear installing text and restore the arrow cursor + SetWindowText(GetDlgItem(dialog, IDL_INSTALLING_TEXT), ""); + SetCursor(LoadCursor(NULL,IDC_ARROW)); + + // infwizard_install_driver() will display a message if it fails + if (ret == ERROR_SUCCESS) + { + MessageBoxA(dialog,"Installation successful.", + "Driver Install Complete", MB_OK | MB_APPLMODAL); + + // Close the wizard + EndDialog(dialog, 0); + } + return TRUE; + case ID_BUTTON_NEXT: + case IDCANCEL: + EndDialog(dialog, 0); + return TRUE ; + } + } + + return FALSE; +} + +static void device_list_init(HWND list) +{ + LVCOLUMN lvc; + int ignored; + + ignored = (int)ListView_SetExtendedListViewStyle(list, LVS_EX_FULLROWSELECT); + + memset(&lvc, 0, sizeof(lvc)); + + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; + lvc.fmt = LVCFMT_LEFT; + + lvc.cx = 70; + lvc.iSubItem = 0; + lvc.pszText = "Vendor ID"; + ignored = ListView_InsertColumn(list, 1, &lvc); + + lvc.cx = 70; + lvc.iSubItem = 1; + lvc.pszText = "Product ID"; + ignored = ListView_InsertColumn(list, 2, &lvc); + + lvc.cx = 260; + lvc.iSubItem = 2; + lvc.pszText = "Description"; + ignored = ListView_InsertColumn(list, 3, &lvc); + + lvc.cx = 40; + lvc.iSubItem = 3; + lvc.pszText = "MI"; + ignored = ListView_InsertColumn(list, 4, &lvc); +} + +static void device_list_refresh(HWND list) +{ + int ret; + device_context_t *device; + struct wdi_device_info* wdi_dev_info; + struct wdi_options_create_list options; + const char* vendor_name; + + memset(&options,0,sizeof(options)); + options.list_all=TRUE; + options.list_hubs=FALSE; + options.trim_whitespaces=TRUE; + + device_list_clean(list); + + if (wdi_dev_list) + wdi_destroy_list(wdi_dev_list); + + ret = wdi_create_list(&wdi_dev_list,&options); + if (ret == WDI_SUCCESS) + { + for(wdi_dev_info=wdi_dev_list; wdi_dev_info!=NULL; wdi_dev_info=wdi_dev_info->next) + { + device = (device_context_t *) malloc(sizeof(device_context_t)); + memset(device, 0, sizeof(*device)); + device->wdi=wdi_dev_info; + safe_strcpy(device->description,MAX_PATH,device->wdi->desc); + + if ((vendor_name = wdi_get_vendor_name(device->wdi->vid))) + { + safe_strcpy(device->manufacturer,MAX_PATH, vendor_name); + } + + device_list_add(list, device); + } + } +} + +static void device_list_add(HWND list, device_context_t *device) +{ + LVITEM item; + char vid[32]; + char pid[32]; + char mi[32]; + int ignored; + + memset(&item, 0, sizeof(item)); + memset(vid, 0, sizeof(vid)); + memset(pid, 0, sizeof(pid)); + memset(mi, 0, sizeof(mi)); + + sprintf(vid, "0x%04X", device->wdi->vid); + sprintf(pid, "0x%04X", device->wdi->pid); + if (device->wdi->is_composite) + { + sprintf(mi, "0x%02X", device->wdi->mi); + } + + item.mask = LVIF_TEXT | LVIF_PARAM; + item.lParam = (LPARAM)device; + + ignored = ListView_InsertItem(list, &item); + + ListView_SetItemText(list, 0, 0, vid); + ListView_SetItemText(list, 0, 1, pid); + ListView_SetItemTextU(list, 0, 2, device->description); + ListView_SetItemText(list, 0, 3, mi); +} + +static void device_list_clean(HWND list) +{ + LVITEM item; + BOOL ignored; + + memset(&item, 0, sizeof(LVITEM)); + + while (ListView_GetItem(list, &item)) + { + if (item.lParam) + free((void *)item.lParam); + + ignored = ListView_DeleteItem(list, 0); + memset(&item, 0, sizeof(LVITEM)); + } +} + +/* + * Converts a name + ext UTF-8 pair to a valid MS filename. + * Returned string is allocated and needs to be freed manually + */ +static char* to_valid_filename(char* name, char* ext) +{ + size_t i, j, k; + bool found; + char* ret; + wchar_t unauthorized[] = L"\x0001\x0002\x0003\x0004\x0005\x0006\x0007\x0008\x000a" + L"\x000b\x000c\x000d\x000e\x000f\x0010\x0011\x0012\x0013\x0014\x0015\x0016\x0017" + L"\x0018\x0019\x001a\x001b\x001c\x001d\x001e\x001f\x007f\"<>|:*"; + wchar_t to_underscore[] = L" \t"; + wchar_t *wname, *wext, *wret; + + if ((name == NULL) || (ext == NULL)) { + return NULL; + } + + // Convert to UTF-16 + wname = utf8_to_wchar(name); + wext = utf8_to_wchar(ext); + if ((wname == NULL) || (wext == NULL)) { + safe_free(wname); safe_free(wext); return NULL; + } + + // The returned UTF-8 string will never be larger than the sum of its parts + wret = calloc(2*(wcslen(wname) + wcslen(wext) + 2), 1); + if (wret == NULL) { + safe_free(wname); safe_free(wext); return NULL; + } + wcscpy(wret, wname); + safe_free(wname); + wcscat(wret, wext); + safe_free(wext); + + for (i=0, k=0; iinf_path, 0, sizeof(device->inf_path)); + memset(device->inf_dir,0,sizeof(device->inf_dir)); + memset(device->inf_name,0,sizeof(device->inf_name)); + + if (strlen(device->description)) + { + if (_stricmp(device->description,"Insert device description")!=0) + { + valid_name = to_valid_filename(device->description, ".inf"); + if (valid_name != NULL) + { + strncpy(device->inf_path, valid_name, MAX_PATH); + free(valid_name); + } + } + } + if (!strlen(device->inf_path)) + strcpy(device->inf_path, "your_file.inf"); + + memcpy(ofd_filter, + "inf files (*.inf)\0*.inf\0\0", + sizeof("inf files (*.inf)\0*.inf\0\0")); + + open_file.lStructSize = sizeof(OPENFILENAME); + open_file.hwndOwner = dialog; + open_file.lpstrFile = device->inf_path; + open_file.nMaxFile = sizeof(device->inf_path); + open_file.lpstrFilter = ofd_filter; + open_file.nFilterIndex = 1; + open_file.lpstrFileTitle = device->inf_name; + open_file.nMaxFileTitle = sizeof(device->inf_name); + open_file.lpstrInitialDir = NULL; + open_file.Flags = OFN_PATHMUSTEXIST; + open_file.lpstrDefExt = "inf"; + + if (GetSaveFileNameU(&open_file)) + { + safe_strcpy(device->inf_dir, MAX_PATH, device->inf_path); + + // strip the filename + length = (int)strlen(device->inf_dir); + while (length) + { + length--; + if (device->inf_dir[length]=='\\' || device->inf_dir[length]=='/') + { + device->inf_dir[length]='\0'; + break; + } + + device->inf_dir[length]='\0'; + } + + return infwizard_prepare_driver(dialog, device) == WDI_SUCCESS; + } + return FALSE; +} + +int infwizard_prepare_driver(HWND dialog, device_context_t *device) +{ + struct wdi_options_prepare_driver options; + int ret; + + memset(&options,0,sizeof(options)); + options.driver_type = WDI_LIBUSB; + options.vendor_name = device->manufacturer; + + if (device->wdi->desc) + free(device->wdi->desc); + device->wdi->desc = safe_strdup(device->description); + + if ((ret = wdi_prepare_driver(device->wdi, device->inf_dir, device->inf_name, &options) != WDI_SUCCESS)) + { + MessageBoxA(dialog, wdi_strerror(ret),"Error Preparing Driver", MB_OK|MB_ICONWARNING); + } + + return ret; +} + +int infwizard_install_driver(HWND dialog, device_context_t *device) +{ + struct wdi_options_install_driver options; + int ret; + + memset(&options,0,sizeof(options)); + options.hWnd = dialog; + if ((ret = wdi_install_driver(device->wdi, device->inf_dir, device->inf_name, &options)) != WDI_SUCCESS) + { + MessageBoxA(dialog, wdi_strerror(ret),"Error Installing Driver", MB_OK|MB_ICONWARNING); + } + + return ret; +} + +/* +* Create a tooltip for the controls in tool_tips +*/ +HWND create_tooltip(HWND hMain, HINSTANCE hInstance, UINT max_tip_width, create_tooltip_t tool_tips[]) +{ + HWND hTip; + TOOLINFO toolInfo = {0}; + int i; + + // Create the tooltip window + hTip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMain, NULL, + hInstance, NULL); + + if (hTip == NULL) { + return (HWND)NULL; + } + + // Associate the tooltip to the control + toolInfo.cbSize = sizeof(toolInfo); + toolInfo.hwnd = hMain; + toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS; + + for (i=0; tool_tips[i].controlID != 0 && tool_tips[i].message != NULL; i++) + { + toolInfo.uId =(UINT_PTR)GetDlgItem(hMain,tool_tips[i].controlID); + toolInfo.lpszText = (LPSTR)tool_tips[i].message; + SendMessage(hTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); + } + + SendMessage(hTip, TTM_SETMAXTIPWIDTH, 0, max_tip_width); + + return hTip; +} +HWND CreateTrackingToolTip(HWND hDlg, TCHAR* pText) +{ + // Create a tooltip. + HWND hwndTT = CreateWindowEx(WS_EX_TOPMOST, + TOOLTIPS_CLASS, NULL, + WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + hDlg, NULL, g_hInst,NULL); + + if (!hwndTT) + { + return NULL; + } + + // Set up tool information. + // In this case, the "tool" is the entire parent window. + g_toolItem.cbSize = sizeof(TOOLINFO); + g_toolItem.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE; + g_toolItem.hwnd = hDlg; + g_toolItem.hinst = g_hInst; + g_toolItem.lpszText = pText; + g_toolItem.uId = (UINT_PTR)hDlg; + GetClientRect (hDlg, &g_toolItem.rect); + + // Associate the tooltip with the tool window. + SendMessage(hwndTT, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &g_toolItem); + SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, 0, 300); + + return hwndTT; +} + +// These are used to flag end users about the driver they are going to replace +enum driver_type { + DT_SYSTEM, + DT_LIBUSB, + DT_UNKNOWN, + DT_NONE, + NB_DRIVER_TYPES, +}; + +// Retrieve the driver type according to its service string +int get_driver_type(struct wdi_device_info* dev) +{ + int i; + const char* libusb_name[] = { "WinUSB", "libusb0" }; + const char* system_name[] = { "usbhub", "usbccgp", "USBSTOR", "HidUsb"}; + + if ((dev == NULL) || (dev->driver == NULL)) { + return DT_NONE; + } + for (i=0; idriver, libusb_name[i]) == 0) { + return DT_LIBUSB; + } + } + for (i=0; idriver, system_name[i]) == 0) { + return DT_SYSTEM; + } + } + return DT_UNKNOWN; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.ico b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.ico new file mode 100644 index 0000000..6a6cc7f Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard.ico differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard_rc.rc new file mode 100644 index 0000000..1ac18f4 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/inf_wizard_rc.rc @@ -0,0 +1,129 @@ + +#ifdef __GNUC__ +#define _WIN32_IE 0x0501 +#endif + +#include +#include + +#define IDR_MAIN_ICON 128 + +#define ID_DIALOG_0 10000 +#define ID_DIALOG_1 10001 +#define ID_DIALOG_2 10002 +#define ID_DIALOG_3 10003 + +#define ID_BUTTON_CANCEL 10003 +#define ID_BUTTON_NEXT 10004 +#define ID_BUTTON_BACK 10005 +#define ID_LIST 10006 +#define ID_TEXT_VID 10007 +#define ID_TEXT_PID 10008 +#define ID_TEXT_MANUFACTURER 10009 +#define ID_TEXT_DEV_NAME 10010 +#define ID_INFO_TEXT 10012 +#define ID_LIST_HEADER_TEXT 10013 + +#define ID_BUTTON_INSTALLNOW 10014 +#define ID_TEXT_MI 10015 +#define ID_TEXT_HIGHLIGHT_INFO 10016 + +#define IDG_MAIN 11000 + +#define IDL_VID 11010 +#define IDL_PID 11011 +#define IDL_MI 11012 +#define IDL_MANUFACTURER 11013 +#define IDL_DEV_NAME 11014 +#define IDL_INSTALLING_TEXT 11015 + +//#define DIALOG_FONT "MS Sans Serif" +#define DIALOG_FONT "Tahoma" +#define DIALOG_FONT_SIZE 8 +#define DIALOG_CAPTION "libusb-win32 Inf-Wizard\0" + +#ifndef __INF_WIZARD_C__ + + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR DIALOG_CAPTION +#define RC_FILE_NAME_STR "inf-wizard.exe" + +#include "libusb-win32_version.rc" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAIN_ICON ICON "inf_wizard.ico" + +ID_DIALOG_0 DIALOG DISCARDABLE 0,0,310,200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + DEFPUSHBUTTON "Next >",ID_BUTTON_NEXT,190,175,50,15 + PUSHBUTTON "Cancel",ID_BUTTON_CANCEL,250,175,50,15 + GROUPBOX "Information",IDG_MAIN,10,10,290,155 + LTEXT 0,ID_INFO_TEXT,20,25,270,100 +END + +ID_DIALOG_1 DIALOG DISCARDABLE 0, 0, 310, 200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + DEFPUSHBUTTON "Next >",ID_BUTTON_NEXT,190,175,50,15 + PUSHBUTTON "< Back",ID_BUTTON_BACK,130,175,50,15 + PUSHBUTTON "Cancel",ID_BUTTON_CANCEL,250,175,50,15 + GROUPBOX "Device Selection",IDG_MAIN,10,10,290,155 + LTEXT 0,ID_LIST_HEADER_TEXT,20,25,270,30 + CONTROL "List2",ID_LIST,WC_LISTVIEW, + WS_BORDER | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL + | LVS_SHOWSELALWAYS, 20,60,270,95 +END + +ID_DIALOG_2 DIALOG DISCARDABLE 0, 0, 310, 200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + DEFPUSHBUTTON "Next >",ID_BUTTON_NEXT,190,175,50,15 + PUSHBUTTON "< Back",ID_BUTTON_BACK,130,175,50,15 + PUSHBUTTON "Cancel",ID_BUTTON_CANCEL,250,175,50,15 + EDITTEXT ID_TEXT_VID, 125, 35,160,14 + EDITTEXT ID_TEXT_PID, 125, 55,160,14 + EDITTEXT ID_TEXT_MI, 125, 75,160,14 + EDITTEXT ID_TEXT_MANUFACTURER, 125, 95,160,14 + EDITTEXT ID_TEXT_DEV_NAME, 125,115,160,14 + LTEXT "Vendor ID (hex format)",IDL_VID, 25,35, 95,15, SS_CENTERIMAGE + LTEXT "Product ID (hex format)",IDL_PID, 25,55, 95,15, SS_CENTERIMAGE + LTEXT "MI (hex format)",IDL_MI, 25,75, 95,15, SS_CENTERIMAGE + LTEXT "Manufacturer Name",IDL_MANUFACTURER, 25,95, 95,15, SS_CENTERIMAGE + LTEXT "Device Name",IDL_DEV_NAME, 25,115,95,15, SS_CENTERIMAGE + GROUPBOX "Device Configuration",IDG_MAIN,10,10,290,155 +END + +ID_DIALOG_3 DIALOG DISCARDABLE 0,0,310,200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + PUSHBUTTON "Done",ID_BUTTON_NEXT, 250,175,50,15 + LTEXT "",IDL_INSTALLING_TEXT, 70,175,165,15, SS_CENTER + GROUPBOX "Information",IDG_MAIN,10,10,290,155 + PUSHBUTTON "Install Now..",ID_BUTTON_INSTALLNOW, 20,140,70,15 +END + +ID_MANIFEST RT_MANIFEST "common_controls.manifest" + +#endif + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install-filter-help.txt b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install-filter-help.txt new file mode 100644 index 0000000..09de299 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install-filter-help.txt @@ -0,0 +1,96 @@ +WARNING: + Improper use of libusb-win32 install-filter can cause devices to + malfunction and in some cases complete system failure. + +DISCLAIMER: + THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES, + WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED + TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE ORGANIZATION SHALL + NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. + + +USAGE: install-filter [install|uninstall|list] <-ac> <-dc> <-ad> + <-c=> <-d=> <-f=> + <-p=> <-w=> + +Commands: Compatible Switches: + install (i/-i) <-ac> <-c=> <-d=> <-f=> <-p=> <-w=> + uninstall (u/-u) <-ac> <-c=> <-d=> <-f=> <-p=> <-w=> <-ad> + list (l/-l) <-ac> <-dc> <-c=> <-p=> <-w=> + +NOTE: + * If no switches are specified, the default class key list is used. + * 64bit OSes must use the 64bit version of this application. + +Switches For Class Filters: + --all-classes (-ac) + install : Adds libusb-win32 as an upper class filter for all + classes in the USB enumerator. (Same as -dc in install mode) + uninstall: Removes libusb-win32 as an upper class filter for all + known classes. This is a FULL class removal. + list : Displays all known classes. + + --device-classes (-dc) + install : Adds libusb-win32 as an upper class filter for all + classes in the USB enumerator. + uninstall: Removes libusb-win32 as an upper class filter for all + classes in the USB enumerator. + list : Displays all classes in the USB enumerator and the devices + contained within them. + + --class= (-c=) + install : Adds libusb-win32 as an upper class filter for the + specified class only. Classes can be specified by name or + guid. + uninstall: Removes libusb-win32 as an upper class filter for the + specified class only. Classes can be specified by name or + guid. + list : Displays information about the specified classes and the + devices contained within them. + +Switches For Device Filters: + --device= (-d=) + install : Adds libusb-win32 as an upper device filter for the + specified device. + uninstall: Removes libusb-win32 as an upper device filter for the + specified device. + list : + + --all-devices (-ad) + install + install : + uninstall: Removes libusb-win32 device filters from all devices in the + USB enumerator. + list : + +Switches For INF Files: + --inf= (-f=) + install : Installs usb device(s) from an inf file. + uninstall: Attempts to roll back a device driver installation. If + rollback fails or is unavailable, the device is removed and + all root hubs are restarted. + list : + +Common Switches: + --prompt= (-p=) + Prompts the user with the specified string before running. To include + spaces in the prompt string, place the entire switch in double quotes. + Example: "-p=Are you sure?" + + --wait= (-w=) + After the operation completes, displays the specified string and waits for + user input. To include spaces in the prompt string, place the entire + switch in double quotes. + Example: "-w=Press any key.." + + +Examples: + install-filter install --device-classes + install-filter uninstall --all-classes + install-filter list --device-classes + install-filter install --class={00000000-0000-0000-0000-000000000000} + install-filter install "--device=USB\Vid_04d8&Pid_000c&Rev_0000" + install-filter install --device=USB\Vid_04d8.Pid_000c.Rev_0000 + install-filter install --inf=your_file.inf diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install.c new file mode 100644 index 0000000..b65cb29 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install.c @@ -0,0 +1,2735 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2005 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* Parts of the code from libwdi by Pete Batard +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +#if defined(_WIN64) +#include +#else +#include +#endif +#else +#include +#define strlwr(p) _strlwr(p) +#endif + +#include "usb.h" +#include "registry.h" +#include "error.h" +#include "driver_api.h" +#include "libusb-win32_version.h" + + +#define LIBUSB_DRIVER_PATH "system32\\drivers\\libusb0.sys" +#define LIBUSB_OLD_SERVICE_NAME_NT "libusbd" + +#define INSTALLFLAG_FORCE 0x00000001 + +#define IDC_PROGRESS_TEXT 10001 +#define IDC_PROGRESS_BAR 10002 +// #define IDC_INFO_PANE 10003 + +#define UM_PROGRESS_STOP (0x7000 - 1) +#define UM_PROGRESS_START (0x7000 - 2) + +#define DISPLAY_NAME "libusb-win32 installer" +#define DISPLAY_RUNNING "libusb-win32 installer running.." +#define DISPLAY_DONE "libusb-win32 installer finished" +#define DISPLAY_DONE_WITH_ERRORS "libusb-win32 installer errors!" +#define COLOR_RED RGB(128,0,0) +#define COLOR_LTRED RGB(255,64,64) +#define COLOR_ORANGE RGB(255, 102, 0) + +#define safe_free(p) do { if (p) free(p); p = NULL; }while(0) +#define safe_strlen(p) (p ? strlen(p) : 0) + +#define MOVE_CONTROL(ParentHwnd, ControlID, Rect, Repaint, TopZOrder) \ + SetWindowPos(GetDlgItem(ParentHwnd, ControlID), HWND_TOP, Rect.left, Rect.top, abs(Rect.right - Rect.left), abs(Rect.bottom - Rect.top), \ + (Repaint ? 0 : SWP_NOREDRAW) | (TopZOrder ? 0 : SWP_NOZORDER)) + +// transform coordinates in a RECT from client to screen coordiantes +#define ClientToScreenRC(hwnd, prect) do{ClientToScreen(hwnd,(LPPOINT)&prect->left); ClientToScreen(hwnd,(LPPOINT)&prect->right); }while(0) + +// transform coordinates in a RECT from screen to client coordiantes +#define ScreenToClientRC(hwnd, prect) do{ScreenToClient(hwnd,(LPPOINT)&prect->left); ScreenToClient(hwnd,(LPPOINT)&prect->right); }while(0) + +// fills a pointer to a TRIVERTEX structure +#define TRIVERTEX_FILL(TriVertex, XPos, YPos, RedC16, GreenC16, BlueC16, AlphaC16) do { \ + (TriVertex)->x = XPos; \ + (TriVertex)->y = YPos; \ + (TriVertex)->Red = RedC16; \ + (TriVertex)->Green = GreenC16; \ + (TriVertex)->Blue = BlueC16; \ + (TriVertex)->Alpha = AlphaC16; \ + }while(0) + +#define COLOR16_MAX 0xff00 +#define RBG_TO_C16(rgb, add, RField, GField, BField) do { \ + if (((int)((GetRValue(rgb) + (add)) * 256)) > COLOR16_MAX) \ + RField = COLOR16_MAX; \ + else if (((int)((GetRValue(rgb) + (add)) * 256)) < 0) \ + RField = 0; \ + else \ + RField = ((GetRValue(rgb) + (add)) * 256); \ + \ + \ + if (((int)((GetGValue(rgb) + (add)) * 256)) > COLOR16_MAX) \ + GField = COLOR16_MAX; \ + else if (((int)((GetGValue(rgb) + (add)) * 256)) < 0) \ + GField = 0; \ + else \ + GField = ((GetGValue(rgb) + (add)) * 256); \ + \ + \ + if (((int)((GetBValue(rgb) + (add)) * 256)) > COLOR16_MAX) \ + BField = COLOR16_MAX; \ + else if (((int)((GetBValue(rgb) + (add)) * 256)) < 0) \ + BField = 0; \ + else \ + BField = ((GetBValue(rgb) + (add)) * 256); \ + \ + \ + }while(0) + + +LPCSTR install_lock_sem_name = "libusb-win32-installer-{1298B356-F6E3-4455-9FEC-3932714AF49B}"; + +LPCSTR install_warning = "This will add libusb-win32 as a driver for all usb devices on the PC. " + "This function is for development purposes only. Improper use of the " + "libusb-win32 filter driver can cause devices to malfunction and in some " + "cases complete system failure."; + +LPCSTR install_wait = "Press any key to exit.."; + +/* commands */ +LPCWSTR paramcmd_list[] = { + L"list", + L"-l", + L"l", + 0 +}; + +LPCWSTR paramcmd_install[] = { + L"install", + L"-i", + L"i", + 0 +}; + +LPCWSTR paramcmd_uninstall[] = { + L"uninstall", + L"-u", + L"u", + 0 +}; + +LPCWSTR paramcmd_help[] = { + L"--help", + L"help", + L"-h", + L"/?", + L"-?", + L"h", + 0 +}; + +/* switches */ +LPCWSTR paramsw_all_classes[] = { + L"--all-classes", + L"-ac", + 0 +}; + +LPCWSTR paramsw_all_devices[] = { + L"--all-devices", + L"-ad", + 0 +}; + +LPCWSTR paramsw_device_classes[] = { + L"--device-classes", + L"-dc", + 0 +}; + +LPCWSTR paramsw_class[] = { + L"--class=", + L"-c=", + 0 +}; + +LPCWSTR paramsw_device_upper[] = { + L"--device=", + L"-d=", + 0 +}; + +LPCWSTR paramsw_device_upper_by_devinst[] = { + L"--device-id=", + L"-di=", + 0 +}; + +LPCWSTR paramsw_inf[] = { + L"--inf=", + L"-f=", + 0 +}; + +LPCWSTR paramsw_prompt[] = { + L"--prompt=", + L"-p=", + L"-p", + 0 +}; + +LPCWSTR paramsw_wait[] = { + L"--wait=", + L"-w=", + L"-w", + 0 +}; + +typedef struct _LONGGUID { + unsigned int Data1; + unsigned int Data2; + unsigned int Data3; + unsigned int Data4[ 8 ]; +} LONGGUID; + +typedef struct _install_progress_context_t +{ + HINSTANCE hInstance; + HWND progress_hwnd; + bool_t progress_window_ready; + filter_context_t* filter_context; + uintptr_t thread_id; + int ret; + DWORD progress_textlength; + LONG progress_ind_ofs; + bool_t stopped; + int error_count; +} install_progress_context_t; + +static install_progress_context_t g_install_progress_context; + +static bool_t usb_install_get_argument(LPWSTR param_value, LPCWSTR* out_param, LPCWSTR* out_value, LPCWSTR* param_names); +void usb_install_report(filter_context_t* filter_context); +void usage(void); + +/* riched32.dll */ +#define INIT_RICHED32() if (riched32_dll == NULL) riched32_dll = LoadLibrary("riched32") + +/* msimg32.dll exports */ +typedef BOOL (WINAPI * gradient_fill_t)(HDC, + PTRIVERTEX, + ULONG, + PVOID, + ULONG, + ULONG); +#define INIT_MSIMG32() if (msimg32_dll == NULL) msimg32_dll = LoadLibrary("msimg32") +#define INIT_GRADIENTFILL() if (gradient_fill == NULL) do { \ + INIT_MSIMG32(); if (msimg32_dll) gradient_fill = (gradient_fill_t) GetProcAddress(msimg32_dll, "GradientFill"); \ + }while(0) + +/* shell32.dll exports */ +typedef LPWSTR* (WINAPI * commandline_to_argvw_t)(LPCWSTR, int*); +#define INIT_SHELL32() if (shell32_dll == NULL) shell32_dll = LoadLibrary("shell32") +#define INIT_COMMANDLINE_TO_ARGVW() if (commandline_to_argvw == NULL) do { \ + INIT_SHELL32(); if (shell32_dll) commandline_to_argvw = (commandline_to_argvw_t) GetProcAddress(shell32_dll, "CommandLineToArgvW"); \ + }while(0) + +/* kernel32.dll exports */ +typedef BOOL (WINAPI * is_wow64_process_t)(HANDLE, PBOOL); + +/* newdev.dll exports */ +typedef BOOL (WINAPI * update_driver_for_plug_and_play_devices_t)(HWND, + LPCSTR, + LPCSTR, + DWORD, + PBOOL); + +typedef BOOL (WINAPI * rollback_driver_t)(HDEVINFO, + PSP_DEVINFO_DATA, + HWND, + DWORD, + PBOOL); + +typedef BOOL (WINAPI * uninstall_device_t)(HWND, + HDEVINFO, + PSP_DEVINFO_DATA, + DWORD, + PBOOL); + +/* setupapi.dll exports */ +typedef BOOL (WINAPI * setup_copy_oem_inf_t)(PCSTR, PCSTR, DWORD, DWORD, + PSTR, DWORD, PDWORD, PSTR*); + + +/* advapi32.dll exports */ +typedef SC_HANDLE (WINAPI * open_sc_manager_t)(LPCTSTR, LPCTSTR, DWORD); +typedef SC_HANDLE (WINAPI * open_service_t)(SC_HANDLE, LPCTSTR, DWORD); +typedef BOOL (WINAPI * change_service_config_t)(SC_HANDLE, DWORD, DWORD, + DWORD, LPCTSTR, LPCTSTR, + LPDWORD, LPCTSTR, LPCTSTR, + LPCTSTR, LPCTSTR); +typedef BOOL (WINAPI * close_service_handle_t)(SC_HANDLE); +typedef SC_HANDLE (WINAPI * create_service_t)(SC_HANDLE, LPCTSTR, LPCTSTR, + DWORD, DWORD, DWORD, DWORD, + LPCTSTR, LPCTSTR, LPDWORD, + LPCTSTR, LPCTSTR, LPCTSTR); +typedef BOOL (WINAPI * delete_service_t)(SC_HANDLE); +typedef BOOL (WINAPI * start_service_t)(SC_HANDLE, DWORD, LPCTSTR); +typedef BOOL (WINAPI * query_service_status_t)(SC_HANDLE, LPSERVICE_STATUS); +typedef BOOL (WINAPI * control_service_t)(SC_HANDLE, DWORD, LPSERVICE_STATUS); + + +static HINSTANCE riched32_dll = NULL; +static HINSTANCE shell32_dll = NULL; +static HINSTANCE msimg32_dll = NULL; +static HINSTANCE gdi32_dll = NULL; + +static HINSTANCE advapi32_dll = NULL; + +static commandline_to_argvw_t commandline_to_argvw = NULL; +static gradient_fill_t gradient_fill = NULL; + +static open_sc_manager_t open_sc_manager = NULL; +static open_service_t open_service = NULL; +static change_service_config_t change_service_config = NULL; +static close_service_handle_t close_service_handle = NULL; +static create_service_t create_service = NULL; +static delete_service_t delete_service = NULL; +static start_service_t start_service = NULL; +static query_service_status_t query_service_status = NULL; +static control_service_t control_service = NULL; + +static bool_t usb_service_load_dll(void); +static bool_t usb_service_free_dll(void); + +static bool_t usb_service_create(const char *name, const char *display_name, + const char *binary_path, unsigned long type, + unsigned long start_type); +static bool_t usb_service_stop(const char *name); +static bool_t usb_service_delete(const char *name); + +static bool_t usb_install_iswow64(void); +static BOOL usb_install_admin_check(void); + +static BOOL usb_install_log_handler(enum USB_LOG_LEVEL level, + const char* app_name, + const char* prefix, + const char* func, + int app_prefix_func_end, + char* message, + int message_length); + +int usb_install_window(HWND hWnd, HINSTANCE instance, filter_context_t* filter_context); +int usb_install_console(filter_context_t* filter_context); +void usb_install_destroy_filter_context(filter_context_t** filter_context); + +bool_t usb_progress_context_create(install_progress_context_t* install_progress_context, + HINSTANCE hInstance, + filter_context_t* filter_context); +void usb_progress_context_destroy(install_progress_context_t* install_progress_context); + +bool_t usb_progress_add_text(HWND hwnd, const char* message, COLORREF crNewColor, bool_t bold, bool_t italic); + +BOOL sem_create_lock(HANDLE* sem_handle_out, LPCSTR unique_name, LONG remaining, LONG max); +BOOL sem_destroy_lock(HANDLE* sem_handle_in); +BOOL sem_release_lock(HANDLE sem_handle); +BOOL sem_try_lock(HANDLE sem_handle, DWORD dwMilliseconds); + +static void detect_version(void); + +// Detect Windows version +/* +* Windows versions +*/ +enum windows_version { + WINDOWS_UNDEFINED, + WINDOWS_UNSUPPORTED, + WINDOWS_2K, + WINDOWS_XP, + WINDOWS_2003_XP64, + WINDOWS_VISTA, + WINDOWS_7 +}; +enum windows_version windows_version = WINDOWS_UNDEFINED; +#define GET_WINDOWS_VERSION do{ if (windows_version == WINDOWS_UNDEFINED) detect_version(); } while(0) +static void detect_version(void) +{ + OSVERSIONINFO os_version; + + memset(&os_version, 0, sizeof(OSVERSIONINFO)); + os_version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + windows_version = WINDOWS_UNSUPPORTED; + if ((GetVersionEx(&os_version) != 0) && (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)) { + if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 0)) { + windows_version = WINDOWS_2K; + } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 1)) { + windows_version = WINDOWS_XP; + } else if ((os_version.dwMajorVersion == 5) && (os_version.dwMinorVersion == 2)) { + windows_version = WINDOWS_2003_XP64; + } else if (os_version.dwMajorVersion >= 6) { + if (os_version.dwBuildNumber < 7000) { + windows_version = WINDOWS_VISTA; + } else { + windows_version = WINDOWS_7; + } + } + } +} + +BOOL sem_create_lock(HANDLE* sem_handle_out, LPCSTR unique_name, LONG remaining, LONG max) +{ + SECURITY_ATTRIBUTES sem_attributes; + + memset(&sem_attributes, 0, sizeof(sem_attributes)); + sem_attributes.nLength = sizeof(sem_attributes); + sem_attributes.bInheritHandle = TRUE; + + *sem_handle_out = CreateSemaphoreA(&sem_attributes, remaining, max, unique_name); + + return *sem_handle_out != NULL; + +} + +BOOL sem_destroy_lock(HANDLE* sem_handle_in) +{ + if (sem_handle_in && *sem_handle_in) + { + return CloseHandle(*sem_handle_in); + *sem_handle_in = NULL; + } + return FALSE; + +} + +BOOL sem_release_lock(HANDLE sem_handle) +{ + if (!sem_handle) return FALSE; + return ReleaseSemaphore(sem_handle, 1, NULL); +} + +BOOL sem_try_lock(HANDLE sem_handle, DWORD dwMilliseconds) +{ + if (!sem_handle) return FALSE; + return WaitForSingleObject(sem_handle, dwMilliseconds) == WAIT_OBJECT_0; +} + +void CALLBACK usb_touch_inf_file_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show) +{ + usb_install_service_np(); +} + +void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show) +{ + usb_uninstall_service_np(); +} + +void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show) +{ + usb_install_driver_np(cmd_line); +} + +int usb_install_service(filter_context_t* filter_context) +{ + char display_name[MAX_PATH]; + + int ret = 0; + + const char* driver_name = LIBUSB_DRIVER_NAME_NT; + /* stop devices that are handled by libusb's device driver */ + usb_registry_stop_libusb_devices(); + + /* the old driver is unloaded now */ + if (usb_registry_is_nt()) + { + memset(display_name, 0, sizeof(display_name)); + + /* create the Display Name */ + _snprintf(display_name, sizeof(display_name) - 1, + "libusb-win32 - Kernel Driver, Version %d.%d.%d.%d", + VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO, VERSION_NANO); + + /* create the kernel service */ + USBMSG("creating %s service..\n", driver_name); + if (!usb_service_create(driver_name, display_name, + LIBUSB_DRIVER_PATH, + SERVICE_KERNEL_DRIVER, SERVICE_DEMAND_START)) + { + USBERR("failed creating service %s\n", driver_name); + ret = -1; + return ret; + } + } + /* restart devices that are handled by libusb's device driver */ + usb_registry_start_libusb_devices(); + + /* insert device filter drivers */ + usb_registry_insert_device_filters(filter_context); + + /* insert class filter driver */ + usb_registry_insert_class_filter(filter_context); + + if (filter_context->class_filters_modified) + { + /* restart the whole USB system so that the new drivers will be loaded */ + usb_registry_restart_all_devices(); + filter_context->class_filters_modified = FALSE; + } + return ret; +} + +int usb_install_service_np(void) +{ + return usb_install_npA(NULL, NULL, "i -dc", 0); +} + +int usb_uninstall_service(filter_context_t* filter_context) +{ + if (!usb_registry_is_nt()) return -1; + + /* older version of libusb used a system service, just remove it */ + usb_service_stop(LIBUSB_OLD_SERVICE_NAME_NT); + usb_service_delete(LIBUSB_OLD_SERVICE_NAME_NT); + + /* remove user specified device filters */ + if (filter_context->device_filters || filter_context->remove_all_device_filters) + { + usb_registry_remove_device_filter(filter_context); + } + /* remove class filter driver */ + usb_registry_remove_class_filter(filter_context); + + /* unload filter drivers */ + if (filter_context->class_filters_modified) + { + usb_registry_restart_all_devices(); + filter_context->class_filters_modified = FALSE; + } + return 0; +} + +int usb_uninstall_service_np(void) +{ + return usb_install_npA(NULL, NULL, "u -ac", 0); +} + +BOOL usb_install_find_model_section(HINF inf_handle, PINFCONTEXT inf_context) +{ + // find the .inf file's model-section. This is normally a [Devices] + // section, but could be anything. + + char tmp[MAX_PATH]; + char* model[8]; + BOOL success = FALSE; + DWORD field_index; + + // first find [Manufacturer]. The models are listeed in this section. + if (SetupFindFirstLine(inf_handle, "Manufacturer", NULL, inf_context)) + { + memset(model, 0, sizeof(model)); + for (field_index = 1; field_index < ( sizeof(model) / sizeof(model[0]) ); field_index++) + { + success = SetupGetStringField(inf_context, field_index, tmp, sizeof(tmp), NULL); + if (!success) break; + + model[(field_index-1)] = _strdup(tmp); + switch(field_index) + { + case 1: // The first field is the base model-section-name, "Devices" for example. + USBDBG("model-section-name=%s\n", tmp); + break; + default: // These are the target OS field(s), "NT" or "NTX86" for example. + USBDBG("target-os-version=%s\n", tmp); + } + } + + // if the base model-section-name was found.. + if (field_index > 1) + { + // find the model-section + field_index = 0; + strcpy(tmp, model[0]); + while (!(success = SetupFindFirstLine(inf_handle, tmp, NULL, inf_context))) + { + field_index++; + if (!model[field_index]) break; + sprintf(tmp, "%s.%s", model[0], model[field_index]); + } + } + + // these were allocated with _strdup above. + for (field_index = 0; model[field_index] != NULL; field_index++) + free(model[field_index]); + + // model-section-name or model-section not found + if (!success) + { + USBERR0(".inf file does not contain a valid model-section-name\n"); + } + } + else + { + USBERR0(".inf file does not contain a valid Manufacturer section\n"); + } + + return success; +} + +int usb_install_inf_np(const char *inf_file, + bool_t remove_mode, + bool_t copy_oem_inf_mode) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + INFCONTEXT inf_context; + HINF inf_handle; + DWORD config_flags, problem, status; + BOOL reboot; + char inf_path[MAX_PATH]; + char id[MAX_PATH]; + char tmp_id[MAX_PATH]; + char *p; + int dev_index; + HINSTANCE newdev_dll = NULL; + HMODULE setupapi_dll = NULL; + CONFIGRET cr; + update_driver_for_plug_and_play_devices_t UpdateDriverForPlugAndPlayDevices; + rollback_driver_t RollBackDriver; + uninstall_device_t UninstallDevice; + bool_t usb_reset_required = FALSE; + int field_index; + setup_copy_oem_inf_t SetupCopyOEMInf; + + if (usb_install_iswow64()) + { + USBERR0("This is a 64bit operating system and requires the 64bit " DISPLAY_NAME " application.\n"); + return -1; + } + + newdev_dll = LoadLibrary("newdev.dll"); + if (!newdev_dll) + { + USBERR0("loading newdev.dll failed\n"); + return -1; + } + + UpdateDriverForPlugAndPlayDevices = (update_driver_for_plug_and_play_devices_t)GetProcAddress(newdev_dll, "UpdateDriverForPlugAndPlayDevicesA"); + if (!UpdateDriverForPlugAndPlayDevices) + { + USBERR0("loading newdev.dll failed\n"); + return -1; + } + UninstallDevice = (uninstall_device_t)GetProcAddress(newdev_dll, "DiUninstallDevice"); + RollBackDriver = (rollback_driver_t)GetProcAddress(newdev_dll, "DiRollbackDriver"); + + setupapi_dll = GetModuleHandle("setupapi.dll"); + if (!setupapi_dll) + { + USBERR0("loading setupapi.dll failed\n"); + return -1; + } + SetupCopyOEMInf = (setup_copy_oem_inf_t)GetProcAddress(setupapi_dll, "SetupCopyOEMInfA"); + if (!SetupCopyOEMInf) + { + USBERR0("loading setupapi.dll failed\n"); + return -1; + } + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + + + /* retrieve the full .inf file path */ + if (!GetFullPathName(inf_file, MAX_PATH, inf_path, NULL)) + { + USBERR(".inf file %s not found\n", + inf_file); + return -1; + } + + /* open the .inf file */ + inf_handle = SetupOpenInfFile(inf_path, NULL, INF_STYLE_WIN4, NULL); + + if (inf_handle == INVALID_HANDLE_VALUE) + { + USBERR("unable to open .inf file %s\n", + inf_file); + return -1; + } + + if (!usb_install_find_model_section(inf_handle, &inf_context)) + { + SetupCloseInfFile(inf_handle); + return -1; + } + + do + { + /* get the device ID from the .inf file */ + + field_index = 2; + while(SetupGetStringField(&inf_context, field_index++, id, sizeof(id), NULL)) + { + /* convert the string to lowercase */ + strlwr(id); + + if (strncmp(id, "usb\\", 4) != 0) + { + USBERR("invalid hardware id %s\n", id); + SetupCloseInfFile(inf_handle); + return -1; + } + + USBMSG("%s device %s..\n", + remove_mode ? "removing" : "installing", id + 4); + + reboot = FALSE; + + if (!remove_mode) + { + if (copy_oem_inf_mode) + { + /* copy the .inf file to the system directory so that is will be found */ + /* when new devices are plugged in */ + if (SetupCopyOEMInf(inf_path, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL)) + { + USBDBG("SetupCopyOEMInf failed for %s\n", inf_path); + } + else + { + USBDBG(".inf file %s copied to system directory\n", inf_path); + copy_oem_inf_mode = FALSE; + } + } + + /* force an update of all connected devices matching this ID */ + UpdateDriverForPlugAndPlayDevices(NULL, id, inf_path, INSTALLFLAG_FORCE, &reboot); + } + + /* now search the registry for device nodes representing currently */ + /* unattached devices or remove devices depending on the mode */ + + /* get all USB device nodes from the registry, present and non-present */ + /* devices */ + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, DIGCF_ALLCLASSES); + + if (dev_info == INVALID_HANDLE_VALUE) + { + SetupCloseInfFile(inf_handle); + return -1; + } + + dev_index = 0; + + /* enumerate the device list to find all attached and unattached */ + /* devices */ + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + /* get the harware ID from the registry, this is a multi-zero string */ + if (SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, + SPDRP_HARDWAREID, NULL, + (BYTE *)tmp_id, + sizeof(tmp_id), NULL)) + { + /* check all possible IDs contained in that multi-zero string */ + for (p = tmp_id; *p; p += (strlen(p) + 1)) + { + /* convert the string to lowercase */ + strlwr(p); + + /* found a match? */ + if (strstr(p, id)) + { + if (remove_mode) + { + if (RollBackDriver) + { + if (RollBackDriver(dev_info, &dev_info_data, NULL, 0, &reboot)) + { + break; + } + else + { + USBERR("failed RollBackDriver for device %s\n", p); + } + } + if (UninstallDevice) + { + if (UninstallDevice(NULL, dev_info, &dev_info_data, 0, &reboot)) + { + usb_reset_required = TRUE; + break; + } + else + { + USBERR("failed UninstallDevice for device %s\n", p); + } + } + + if (SetupDiRemoveDevice(dev_info, &dev_info_data)) + { + usb_reset_required = TRUE; + break; + } + else + { + USBERR("failed RemoveDevice for device %s\n", p); + } + + } + else + { + cr = CM_Get_DevNode_Status(&status, + &problem, + dev_info_data.DevInst, + 0); + + /* is this device disconnected? */ + if (cr == CR_NO_SUCH_DEVINST) + { + /* found a device node that represents an unattached */ + /* device */ + if (SetupDiGetDeviceRegistryProperty(dev_info, + &dev_info_data, + SPDRP_CONFIGFLAGS, + NULL, + (BYTE *)&config_flags, + sizeof(config_flags), + NULL)) + { + /* mark the device to be reinstalled the next time it is */ + /* plugged in */ + config_flags |= CONFIGFLAG_REINSTALL; + + /* write the property back to the registry */ + SetupDiSetDeviceRegistryProperty(dev_info, + &dev_info_data, + SPDRP_CONFIGFLAGS, + (BYTE *)&config_flags, + sizeof(config_flags)); + } + } + } + /* a match was found, skip the rest */ + break; + } + } + } + /* check the next device node */ + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + /* get the next device ID from the .inf file */ + } + } + while (SetupFindNextLine(&inf_context, &inf_context)); + + /* we are done, close the .inf file */ + SetupCloseInfFile(inf_handle); + + if (usb_reset_required) + { + usb_registry_restart_all_devices(); + } + else if (!remove_mode) + { + usb_registry_stop_libusb_devices(); /* stop all libusb devices */ + usb_registry_start_libusb_devices(); /* restart all libusb devices */ + } + + return 0; +} + +int usb_install_driver_np(const char *inf_file) +{ + return usb_install_inf_np(inf_file, FALSE, TRUE); +} + + +bool_t usb_service_load_dll() +{ + if (usb_registry_is_nt()) + { + advapi32_dll = LoadLibrary("advapi32.dll"); + + if (!advapi32_dll) + { + USBERR0("loading DLL advapi32.dll failed\n"); + return FALSE; + } + + open_sc_manager = (open_sc_manager_t) + GetProcAddress(advapi32_dll, "OpenSCManagerA"); + + open_service = (open_service_t) + GetProcAddress(advapi32_dll, "OpenServiceA"); + + change_service_config = (change_service_config_t) + GetProcAddress(advapi32_dll, "ChangeServiceConfigA"); + + close_service_handle = (close_service_handle_t) + GetProcAddress(advapi32_dll, "CloseServiceHandle"); + + create_service = (create_service_t) + GetProcAddress(advapi32_dll, "CreateServiceA"); + + delete_service = (delete_service_t) + GetProcAddress(advapi32_dll, "DeleteService"); + + start_service = (start_service_t) + GetProcAddress(advapi32_dll, "StartServiceA"); + + query_service_status = (query_service_status_t) + GetProcAddress(advapi32_dll, "QueryServiceStatus"); + + control_service = (control_service_t) + GetProcAddress(advapi32_dll, "ControlService"); + + if (!open_sc_manager || !open_service || !change_service_config + || !close_service_handle || !create_service || !delete_service + || !start_service || !query_service_status || !control_service) + { + FreeLibrary(advapi32_dll); + USBERR0("loading exported functions of advapi32.dll failed"); + + return FALSE; + } + } + return TRUE; +} + +bool_t usb_service_free_dll() +{ + if (advapi32_dll) + { + FreeLibrary(advapi32_dll); + } + return TRUE; +} + +bool_t usb_service_create(const char *name, const char *display_name, + const char *binary_path, unsigned long type, + unsigned long start_type) +{ + SC_HANDLE scm = NULL; + SC_HANDLE service = NULL; + bool_t ret = FALSE; + + if (!usb_service_load_dll()) + { + return FALSE; + } + + do + { + scm = open_sc_manager(NULL, SERVICES_ACTIVE_DATABASE, + SC_MANAGER_ALL_ACCESS); + + if (!scm) + { + USBERR("opening service control " + "manager failed: %s", usb_win_error_to_string()); + break; + } + + service = open_service(scm, name, SERVICE_ALL_ACCESS); + + if (service) + { + if (!change_service_config(service, + type, + start_type, + SERVICE_ERROR_NORMAL, + binary_path, + NULL, + NULL, + NULL, + NULL, + NULL, + display_name)) + { + USBERR("changing config of " + "service '%s' failed: %s", + name, usb_win_error_to_string()); + break; + } + ret = TRUE; + break; + } + + if (GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST) + { + service = create_service(scm, + name, + display_name, + GENERIC_EXECUTE, + type, + start_type, + SERVICE_ERROR_NORMAL, + binary_path, + NULL, NULL, NULL, NULL, NULL); + + if (!service) + { + USBERR("creating " + "service '%s' failed: %s", + name, usb_win_error_to_string()); + } + ret = TRUE; + } + } + while (0); + + if (service) + { + close_service_handle(service); + } + + if (scm) + { + close_service_handle(scm); + } + + usb_service_free_dll(); + + return ret; +} + +bool_t usb_service_stop(const char *name) +{ + bool_t ret = FALSE; + SC_HANDLE scm = NULL; + SC_HANDLE service = NULL; + SERVICE_STATUS status; + + if (!usb_service_load_dll()) + { + return FALSE; + } + + USBMSG("stopping %s service..\n", name); + + do + { + scm = open_sc_manager(NULL, SERVICES_ACTIVE_DATABASE, + SC_MANAGER_ALL_ACCESS); + + if (!scm) + { + USBERR("opening service control " + "manager failed: %s", usb_win_error_to_string()); + break; + } + + service = open_service(scm, name, SERVICE_ALL_ACCESS); + + if (!service) + { + ret = TRUE; + break; + } + + if (!query_service_status(service, &status)) + { + USBERR("getting status of " + "service '%s' failed: %s", + name, usb_win_error_to_string()); + break; + } + + if (status.dwCurrentState == SERVICE_STOPPED) + { + ret = TRUE; + break; + } + + if (!control_service(service, SERVICE_CONTROL_STOP, &status)) + { + USBERR("stopping service '%s' failed: %s", + name, usb_win_error_to_string()); + break; + } + + do + { + int wait = 0; + + if (!query_service_status(service, &status)) + { + USBERR("getting status of " + "service '%s' failed: %s", + name, usb_win_error_to_string()); + break; + } + Sleep(500); + wait += 500; + + if (wait > 20000) + { + USBERR("stopping " + "service '%s' failed, timeout", name); + ret = FALSE; + break; + } + ret = TRUE; + } + while (status.dwCurrentState != SERVICE_STOPPED); + } + while (0); + + if (service) + { + close_service_handle(service); + } + + if (scm) + { + close_service_handle(scm); + } + + usb_service_free_dll(); + + return ret; +} + +bool_t usb_service_delete(const char *name) +{ + bool_t ret = FALSE; + SC_HANDLE scm = NULL; + SC_HANDLE service = NULL; + + if (!usb_service_load_dll()) + { + return FALSE; + } + + USBMSG("deleting %s service..\n", name); + + do + { + scm = open_sc_manager(NULL, SERVICES_ACTIVE_DATABASE, + SC_MANAGER_ALL_ACCESS); + + if (!scm) + { + USBERR("opening service control " + "manager failed: %s", usb_win_error_to_string()); + break; + } + + service = open_service(scm, name, SERVICE_ALL_ACCESS); + + if (!service) + { + ret = TRUE; + break; + } + + + if (!delete_service(service)) + { + USBERR("deleting " + "service '%s' failed: %s", + name, usb_win_error_to_string()); + break; + } + ret = TRUE; + } + while (0); + + if (service) + { + close_service_handle(service); + } + + if (scm) + { + close_service_handle(scm); + } + + usb_service_free_dll(); + + return ret; +} + +void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show) +{ + usb_touch_inf_file_np(cmd_line); +} + +int usb_touch_inf_file_np(const char *inf_file) +{ + const char inf_comment[] = ";added by libusb to break this file's digital " + "signature"; + const wchar_t inf_comment_uni[] = L";added by libusb to break this file's " + L"digital signature"; + + char buf[1024]; + wchar_t wbuf[1024]; + int found = 0; + OSVERSIONINFO version; + FILE *f; + + version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + + if (!GetVersionEx(&version)) + return -1; + + + /* XP system */ + if ((version.dwMajorVersion == 5) && (version.dwMinorVersion >= 1)) + { + f = fopen(inf_file, "rb"); + + if (!f) + return -1; + + while (fgetws(wbuf, sizeof(wbuf) / 2, f)) + { + if (wcsstr(wbuf, inf_comment_uni)) + { + found = 1; + break; + } + } + + fclose(f); + + if (!found) + { + f = fopen(inf_file, "ab"); + /* fputwc(0x000d, f); */ + /* fputwc(0x000d, f); */ + fputws(inf_comment_uni, f); + fclose(f); + } + } + else + { + f = fopen(inf_file, "r"); + + if (!f) + return -1; + + while (fgets(buf, sizeof(buf), f)) + { + if (strstr(buf, inf_comment)) + { + found = 1; + break; + } + } + + fclose(f); + + if (!found) + { + f = fopen(inf_file, "a"); + fputs("\n", f); + fputs(inf_comment, f); + fputs("\n", f); + fclose(f); + } + } + + return 0; +} + +int usb_install_needs_restart_np(void) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + SP_DEVINSTALL_PARAMS install_params; + int ret = FALSE; + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_info = SetupDiGetClassDevs(NULL, NULL, NULL, + DIGCF_ALLCLASSES | DIGCF_PRESENT); + + SetEnvironmentVariable("LIBUSB_NEEDS_REBOOT", "1"); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return ret; + } + + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + memset(&install_params, 0, sizeof(SP_PROPCHANGE_PARAMS)); + install_params.cbSize = sizeof(SP_DEVINSTALL_PARAMS); + + if (SetupDiGetDeviceInstallParams(dev_info, &dev_info_data, + &install_params)) + { + if (install_params.Flags & (DI_NEEDRESTART | DI_NEEDREBOOT)) + { + USBMSG0("restart needed\n"); + ret = TRUE; + } + } + + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + return ret; +} + +bool_t usb_install_parse_filter_context(filter_context_t* filter_context, + LPCWSTR cmd_line, + int arg_start, + int* arg_cnt) +{ + #define GET_ARG(Params) usb_install_get_argument(argv[arg_pos], &arg_param, &arg_value, Params) + + LONGGUID class_guid; + int arg_pos; + LPWSTR* argv = NULL; + LPCWSTR arg_param, arg_value; + bool_t success = TRUE; + size_t length; + char tmp[MAX_PATH+1]; + filter_device_t* found_device; + filter_class_t* found_class; + filter_file_t* found_inf; + + *arg_cnt = 0; + INIT_COMMANDLINE_TO_ARGVW(); + + if (!commandline_to_argvw) + { + USBERR("failed CommandLineToArgvW:%X", GetLastError()); + success = FALSE; + goto Done; + } + + if (!(argv = commandline_to_argvw(cmd_line, arg_cnt))) + { + USBERR("failed CommandLineToArgvW:%X", GetLastError()); + success = FALSE; + goto Done; + } + + if (*arg_cnt <= arg_start) + { + success = FALSE; + goto Done; + } + + for(arg_pos = arg_start; arg_pos < *arg_cnt; arg_pos++) + { + if (GET_ARG(paramcmd_help)) + { + filter_context->show_help_only = TRUE; + break; + } + else if (GET_ARG(paramcmd_list)) + { + if (filter_context->filter_mode) + { + USBERR("multiple commands not allowed: %ls\n", argv[arg_pos]); + success = FALSE; + break; + } + filter_context->filter_mode = FM_LIST; + } + else if (GET_ARG(paramcmd_install)) + { + if (filter_context->filter_mode) + { + USBERR("multiple commands not allowed: %ls\n", argv[arg_pos]); + success = FALSE; + break; + } + filter_context->filter_mode = FM_INSTALL; + } + else if (GET_ARG(paramcmd_uninstall)) + { + if (filter_context->filter_mode) + { + USBERR("multiple commands not allowed: %ls\n", argv[arg_pos]); + success = FALSE; + break; + } + filter_context->filter_mode = FM_REMOVE; + } + else if (GET_ARG(paramsw_all_classes)) + { + filter_context->switches.add_all_classes = TRUE; + } + else if (GET_ARG(paramsw_device_classes)) + { + filter_context->switches.add_device_classes = TRUE; + } + else if (GET_ARG(paramsw_all_devices)) + { + filter_context->remove_all_device_filters = TRUE; + } + else if ( GET_ARG(paramsw_device_upper) || GET_ARG(paramsw_device_upper_by_devinst) ) + { + length = wcstombs(tmp, arg_value, MAX_PATH); + if (length < 1) + { + success = FALSE; + USBERR("invalid argument %ls\n", argv[arg_pos]); + break; + } + tmp[length] = 0; + + if (GET_ARG(paramsw_device_upper)) + { + usb_registry_add_filter_device_keys(&filter_context->device_filters, "", tmp, "", "", "", "", &found_device); + } + else if (GET_ARG(paramsw_device_upper_by_devinst)) + { + usb_registry_add_filter_device_keys(&filter_context->device_filters, tmp, "", "", "", "", "", &found_device); + } + // upper device filter + if (!found_device) + { + success = FALSE; + USBERR("failed adding device upper filter key %ls\n", argv[arg_pos]); + break; + } + else + { + found_device->action |= FT_DEVICE_UPPERFILTER; + } + } + else if (GET_ARG(paramsw_class)) + { + memset(tmp, 0, sizeof(tmp)); + length = wcstombs(tmp, arg_value, MAX_PATH); + if (length < 1) + { + success = FALSE; + USBERR("invalid argument %ls\n", argv[arg_pos]); + break; + } + tmp[length] = 0; + + if ((length != 38 || tmp[0] != '{' || tmp[length-1] != '}') || + sscanf(tmp, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + &class_guid.Data1, &class_guid.Data2, &class_guid.Data3, + &class_guid.Data4[0], &class_guid.Data4[1], &class_guid.Data4[2], &class_guid.Data4[3], + &class_guid.Data4[4], &class_guid.Data4[5], &class_guid.Data4[6], &class_guid.Data4[7]) != 11) + { + // assume arg_value is a class name + success = usb_registry_add_class_key(&filter_context->class_filters, + "", tmp, "", &found_class, FALSE); + if (!success) + { + USBERR("failed adding class name at argument %ls\n", argv[arg_pos]); + break; + } + } + else + { + sprintf(tmp, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + class_guid.Data1, class_guid.Data2, class_guid.Data3, + class_guid.Data4[0], class_guid.Data4[1], class_guid.Data4[2], class_guid.Data4[3], + class_guid.Data4[4], class_guid.Data4[5], class_guid.Data4[6], class_guid.Data4[7]); + + // assume arg_value is a class guid + success = usb_registry_add_usb_class_key(filter_context, tmp); + if (!success) + { + USBERR("failed adding class guid at argument %ls\n", argv[arg_pos]); + break; + } + } + } + else if (GET_ARG(paramsw_inf)) + { + memset(tmp, 0, sizeof(tmp)); + length = wcstombs(tmp, arg_value, MAX_PATH); + if (length < 1) + { + success = FALSE; + USBERR("invalid argument %ls\n", argv[arg_pos]); + break; + } + tmp[length] = 0; + + usb_registry_add_filter_file_keys(&filter_context->inf_files, tmp, &found_inf); + if (!found_inf) + { + success = FALSE; + USBERR("failed adding inf %ls\n", argv[arg_pos]); + break; + } + } + else if (GET_ARG(paramsw_prompt)) + { + if (arg_value && wcslen(arg_value)) + { + length = wcstombs(NULL, arg_value, 4096); + if (length < 1) + { + success = FALSE; + USBERR("failed wcstombs %ls\n", argv[arg_pos]); + break; + } + length+=3; + filter_context->prompt_string = (char*)malloc(length); + length = wcstombs(filter_context->prompt_string, arg_value, length); + if (length < 1) + { + success = FALSE; + USBERR("failed wcstombs %ls\n", argv[arg_pos]); + break; + } + filter_context->prompt_string[length] = 0; + } + else + { + filter_context->prompt_string = (char*)malloc(strlen(install_warning)+1); + strcpy(filter_context->prompt_string, install_warning); + } + } + else if (GET_ARG(paramsw_wait)) + { + if (arg_value && wcslen(arg_value)) + { + length = wcstombs(NULL, arg_value, 4096); + if (length < 1) + { + success = FALSE; + USBERR("failed wcstombs %ls\n", argv[arg_pos]); + break; + } + length+=3; + filter_context->wait_string = (char*)malloc(length); + length = wcstombs(filter_context->wait_string, arg_value, length); + if (length < 1) + { + success = FALSE; + USBERR("failed wcstombs %ls\n", argv[arg_pos]); + break; + } + filter_context->wait_string[length] = 0; + } + else + { + filter_context->wait_string = (char*)malloc(strlen(install_wait)+1); + strcpy(filter_context->wait_string, install_wait); + } + } + else + { + USBERR("invalid argument %ls\n", argv[arg_pos]); + success = FALSE; + break; + } + } + +Done: + if (success && filter_context->class_filters) + { + // find class keys (fill in the blanks) + usb_registry_lookup_class_keys_by_name(&filter_context->class_filters); + } + if (argv) + { + LocalFree(argv); + } + return success; +} + +int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg) +{ + WCHAR* cmd_line_w; + size_t length; + int ret; + + if (!cmd_line || !strlen(cmd_line)) + { + return -1; + } + + length = (strlen(cmd_line) * sizeof(WCHAR)) + sizeof(WCHAR); + cmd_line_w = malloc(length); + if (!cmd_line_w) + return -1; + + memset(cmd_line_w, 0, length); + if ((length = mbstowcs(cmd_line_w, cmd_line, length / sizeof(WCHAR))) < 1) + { + free(cmd_line_w); + return -1; + } + cmd_line_w[length] = 0; + + ret = usb_install_npW(hwnd, instance, cmd_line_w, starg_arg); + + free(cmd_line_w); + + return ret; +} + +int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line_w, int starg_arg) +{ + filter_context_t* filter_context; + int ret = ERROR_SUCCESS; + HANDLE sem_handle = NULL; + int arg_cnt; + + // create a named semaphore + if (!sem_create_lock(&sem_handle, install_lock_sem_name, 1, 1)) + return -1; + + // lock the semaphore + if (!sem_try_lock(sem_handle, 0)) + { + sem_destroy_lock(&sem_handle); + return -1; + } + + // use the log handler to report progress status + if (!usb_log_get_handler()) + { + usb_log_set_handler(usb_install_log_handler); + usb_log_set_level(LOG_DEBUG); + } + else + { + ret = -1; + goto Done; + } + + // allocate the filter context + filter_context = (filter_context_t*)malloc(sizeof(filter_context_t)); + if (!filter_context) + { + USBERR0("memory allocation failure\n"); + ret = -1; + goto Done; + } + memset(filter_context, 0, sizeof(filter_context_t)); + + // Fill the filter context from the command line arguments. + if (!(usb_install_parse_filter_context(filter_context, cmd_line_w, starg_arg, &arg_cnt))) + { + if (arg_cnt <= starg_arg) + { + usage(); + } + ret = -1; + if (hwnd) + { + MessageBoxA(hwnd, usb_strerror(), DISPLAY_NAME " error", MB_OK | MB_ICONERROR); + } + goto Done; + } + + if (filter_context->show_help_only) + { + usage(); + ret = -1; + goto Done; + } + + if (hwnd && instance) + { + // Using windowed install mode. + if (safe_strlen(filter_context->prompt_string)) + { + const char* msg_title = DISPLAY_NAME; + if (MessageBox(hwnd, filter_context->prompt_string, msg_title, MB_OKCANCEL) != IDOK) + { + ret = -1; + } + } + if (ret == ERROR_SUCCESS) + { + ret = usb_install_window(hwnd, instance, filter_context); + } + } + else + { + // Using console install mode. + if (ret == ERROR_SUCCESS) + { + ret = usb_install_console(filter_context); + if (safe_strlen(filter_context->wait_string)) + { + printf(filter_context->wait_string); + _getch(); + } + + } + } + +Done: + // Free the filter context. + usb_install_destroy_filter_context(&filter_context); + + // Restore the default log handler. + usb_log_set_handler(NULL); + + // Close (release) the semaphore lock. + sem_destroy_lock(&sem_handle); + + return ret; +} + +void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, LPSTR cmd_line, int cmd_show) +{ + usb_install_npA(wnd, instance, cmd_line, 0); +} + +void usb_install_destroy_filter_context(filter_context_t** filter_context) +{ + + filter_context_t* p = *filter_context; + if (filter_context && p) + { + usb_registry_free_class_keys(&p->class_filters); + usb_registry_free_filter_devices(&p->device_filters); + usb_registry_free_filter_files(&p->inf_files); + safe_free(p->prompt_string); + safe_free(p->wait_string); + free(p); + *filter_context = NULL; + } +} + +static void center_dialog(HWND hWndToCenterOn, HWND hWndSubDialog) +{ + RECT rectToCenterOn; + RECT rectSubDialog; + int xLeft, yTop; + + if (hWndSubDialog == NULL) + return; + + if (hWndToCenterOn == NULL) + hWndToCenterOn = GetDesktopWindow(); + + GetWindowRect(hWndToCenterOn, &rectToCenterOn); + GetWindowRect(hWndSubDialog, &rectSubDialog); + + if ((rectToCenterOn.right - rectToCenterOn.left) < (rectSubDialog.right - rectSubDialog.left) || + rectToCenterOn.left < 0 || + rectToCenterOn.top < 0 || + (rectToCenterOn.bottom - rectToCenterOn.top) < (rectSubDialog.bottom - rectSubDialog.top)) + { + hWndToCenterOn = GetDesktopWindow(); + GetWindowRect(hWndToCenterOn, &rectToCenterOn); + } + + xLeft = (rectToCenterOn.left + rectToCenterOn.right) / 2 - (rectSubDialog.right - rectSubDialog.left) / 2; + yTop = (rectToCenterOn.top + rectToCenterOn.bottom) / 2 - (rectSubDialog.bottom - rectSubDialog.top) / 2; + + // Move the window to the correct coordinates with SetWindowPos() + SetWindowPos(hWndSubDialog, HWND_TOP, xLeft, yTop, -1, -1, SWP_NOSIZE | SWP_SHOWWINDOW); +} + +static BOOL usb_install_log_handler(enum USB_LOG_LEVEL level, + const char* app_name, + const char* prefix, + const char* func, + int app_prefix_func_end, + char* message, + int message_length) +{ + HANDLE std_handle; + DWORD req_length; + HWND hDlg, hWnd; + + if (g_install_progress_context.progress_window_ready && g_install_progress_context.progress_hwnd) + { + hDlg = g_install_progress_context.progress_hwnd; + hWnd = GetDlgItem(hDlg, IDC_PROGRESS_TEXT); + if (!hWnd) + { + // use default log handler + return FALSE; + } + + //strip the app, func, and prefix + message += app_prefix_func_end; + message_length -= app_prefix_func_end; + + // trim right '\n' + while(message_length > 0 && message[message_length-1] == '\n') + { + message[message_length-1] = 0; + message_length--; + } + + // trim left '\n' + while(message_length > 0 && message[0] == '\n') + { + message++; + message_length--; + } + + switch(level & LOG_LEVEL_MASK) + { + case LOG_ERROR: + g_install_progress_context.error_count++; + usb_progress_add_text(hWnd, message, COLOR_RED, FALSE, FALSE); + break; + case LOG_WARNING: + usb_progress_add_text(hWnd, message, COLOR_ORANGE, FALSE, TRUE); + break; + default: + usb_progress_add_text(hWnd, message, GetSysColor(COLOR_BTNTEXT), FALSE, FALSE); + break; + } + + return TRUE; + } + else if (((std_handle = GetStdHandle(STD_OUTPUT_HANDLE)) != INVALID_HANDLE_VALUE) && std_handle) + { + if ((level & LOG_LEVEL_MASK) == LOG_ERROR) + std_handle = GetStdHandle(STD_ERROR_HANDLE); + + if (std_handle && std_handle != INVALID_HANDLE_VALUE) + { + WriteConsoleA(std_handle, message, (DWORD)message_length, &req_length, NULL); + return TRUE; + } + // use default log handler + return FALSE; + } + + // use default log handler + return FALSE; +} + +int usb_install_console(filter_context_t* filter_context) +{ + filter_file_t* filter_file; + int ret = 0; + + if (!usb_install_admin_check()) + { + USBERR0(DISPLAY_NAME " requires administrative privileges.\n"); + ret = -1; + goto Done; + } + + if (usb_install_iswow64()) + { + USBERR0("This is a 64bit operating system and requires the 64bit " DISPLAY_NAME " application.\n"); + ret = -1; + goto Done; + } + + if (!filter_context->filter_mode) + { + USBERR("command not specified. Use %ls, %ls, or %ls.\n", + paramcmd_list[0], paramcmd_install[0], paramcmd_uninstall[0]); + ret = -1; + goto Done; + + } + /* only add the default class keys if there is nothing else to do. */ + if (filter_context->class_filters || + filter_context->device_filters || + filter_context->inf_files || + filter_context->switches.add_all_classes || + filter_context->switches.add_device_classes || + filter_context->remove_all_device_filters) + { + filter_context->switches.add_default_classes = FALSE; + } + else + { + filter_context->switches.add_default_classes = TRUE; + + } + + USBRAWMSG("\n" DISPLAY_NAME " (v%u.%u.%u.%u)\n", + VERSION_MAJOR, VERSION_MINOR, VERSION_MICRO, VERSION_NANO); + + + do + { + bool_t refresh_only; + + // if the user specified class keys and the -ac or -dc switch, remove the users keys. + if (filter_context->class_filters && (filter_context->switches.add_all_classes || filter_context->switches.add_device_classes)) + { + USBWRN0("-ac and -dc switches are incompatible with -c= switch\n"); + usb_registry_free_class_keys(&filter_context->class_filters); + } + + if (filter_context->filter_mode == FM_REMOVE) + { + if (filter_context->switches.switches_value || + filter_context->class_filters || + filter_context->device_filters) + { + + if (filter_context->switches.add_all_classes || filter_context->switches.add_device_classes) + refresh_only = FALSE; + else + refresh_only = TRUE; + + if (!usb_registry_get_usb_class_keys(filter_context, refresh_only)) + { + ret = -1; + break; + } + + if (!usb_registry_get_all_class_keys(filter_context, refresh_only)) + { + ret = -1; + break; + } + + } + + // uninstall class & device filters + ret = usb_uninstall_service(filter_context); + if (ret < 0) + { + break; + } + + // rollback/uninstall devices using inf files + filter_file = filter_context->inf_files; + while (filter_file) + { + USBMSG("uninstalling inf %s..\n", filter_file->name); + if (usb_install_inf_np(filter_file->name, TRUE, TRUE) < 0) + { + ret = -1; + break; + } + filter_file = filter_file->next; + } + if (ret == -1) + break; + } + else if (filter_context->filter_mode == FM_INSTALL) + { + if (filter_context->remove_all_device_filters) + { + USBWRN("invalid switch for install operation (%ls)\n",paramsw_all_devices[0]); + } + if (filter_context->switches.switches_value || + filter_context->class_filters || + filter_context->device_filters) + { + + if (filter_context->switches.add_all_classes || filter_context->switches.add_device_classes) + refresh_only = FALSE; + else + refresh_only = TRUE; + + if (!usb_registry_get_usb_class_keys(filter_context, refresh_only)) + { + ret = -1; + break; + } + + if (!usb_registry_get_all_class_keys(filter_context, refresh_only)) + { + ret = -1; + break; + } + + ret = usb_install_service(filter_context); + if (ret < 0) + { + break; + } + } + + filter_file = filter_context->inf_files; + while (filter_file) + { + USBMSG("installing inf %s..\n", filter_file->name); + if (usb_install_inf_np(filter_file->name, FALSE, TRUE) < 0) + { + ret = -1; + break; + } + filter_file = filter_file->next; + } + if (ret == -1) + break; + } + else if (filter_context->filter_mode == FM_LIST) + { + if (!usb_registry_get_usb_class_keys(filter_context, TRUE)) + { + ret = -1; + break; + } + + if (!usb_registry_get_all_class_keys(filter_context, TRUE)) + { + ret = -1; + break; + } + + usb_install_report(filter_context); + } + else + { + USBERR0("unknown filter_mode command\n"); + } + }while(FALSE); + +Done: + return ret; +} + +void __cdecl usb_progress_thread(void* param) +{ + install_progress_context_t* context = (install_progress_context_t*)param; + + context->ret = usb_install_console(context->filter_context); + PostMessage(context->progress_hwnd, UM_PROGRESS_STOP, (WPARAM)context->ret, 0); + _endthread(); +} + +bool_t usb_progress_add_text(HWND hwnd, const char* message, COLORREF crNewColor, bool_t bold, bool_t italic) +{ + static const char crlf[] = "\r\n"; + CHARFORMAT cf; + char* text = (char *)malloc(strlen(message) + sizeof(crlf)); + int iTotalTextLength = GetWindowTextLength(hwnd); + + if (!text) + { + printf("%s\n", "memory allocation failure"); + return FALSE; + } + + if (iTotalTextLength > 0) + { + strcpy(text, crlf); + strcpy(&text[strlen(crlf)], message); + } + else + { + strcpy(text, message); + } + + // set the selection to the end + SendMessage(hwnd, EM_SETSEL, (WPARAM)(int)iTotalTextLength, (LPARAM)(int)iTotalTextLength); + + // set the color + cf.cbSize = sizeof(CHARFORMAT); + cf.dwMask = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD; + cf.dwEffects = (unsigned long)~(CFE_AUTOCOLOR | CFE_UNDERLINE | CFE_BOLD); + cf.crTextColor = crNewColor; + + if (bold) + cf.dwEffects |= CFE_BOLD; + + if (italic) + cf.dwEffects |= CFE_ITALIC; + + SendMessage(hwnd, EM_SETCHARFORMAT, (WPARAM)(UINT)SCF_SELECTION, (LPARAM)&cf); + + // set the text + SendMessage(hwnd, EM_REPLACESEL, (WPARAM)(BOOL)FALSE, (LPARAM)(LPCSTR)text); + + free(text); + + // keep it scrolled to the bottom + SendMessage(hwnd, WM_VSCROLL, (WPARAM)LOWORD(SB_BOTTOM), (LPARAM)0); + + return TRUE; +} + +bool_t usb_progress_size(HWND hDlg) +{ + RECT rect_client, rect_text, rect_bar; + int pad_x = GetSystemMetrics(SM_CXEDGE) * 2; + int pad_y = GetSystemMetrics(SM_CYEDGE) * 2; + + GetClientRect(hDlg, &rect_client); + + // adjust the bar label + rect_bar = rect_client; + rect_bar.top = rect_bar.bottom - 4; + OffsetRect(&rect_bar, 0, -pad_y); + InflateRect(&rect_bar, -pad_x, 0); + + // adjust the textbox + rect_text.top = pad_y; + rect_text.left = pad_x; + rect_text.bottom = rect_bar.top - pad_y; + rect_text.right = rect_client.right - pad_y; + + // resize the progress textbox + MOVE_CONTROL(hDlg, IDC_PROGRESS_TEXT, rect_text, TRUE, FALSE); + + // resize the bar label + MOVE_CONTROL(hDlg, IDC_PROGRESS_BAR, rect_bar, TRUE, FALSE); + + // keep it scrolled to the bottom + SendMessage(GetDlgItem(hDlg, IDC_PROGRESS_TEXT), WM_VSCROLL, (WPARAM)LOWORD(SB_BOTTOM), (LPARAM)0); + + // repaint + // InvalidateRect(hDlg, NULL, TRUE); + // PostMessageA(hDlg, WM_PAINT, (WPARAM)NULL, (LPARAM)0); + + return TRUE; +} + +bool_t usb_progress_init_children(install_progress_context_t* progress_context, HWND hDlg) +{ + HWND hWnd; + CHARFORMAT cf; + DWORD style; + + style = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | ES_MULTILINE | ES_LEFT | ES_READONLY | ES_AUTOVSCROLL | ES_AUTOHSCROLL; + if (progress_context->filter_context->filter_mode == FM_LIST) + { + style |= WS_VSCROLL | WS_HSCROLL; + } + // create rich textbox + hWnd = CreateWindowEx(WS_EX_STATICEDGE, RICHEDIT_CLASS, NULL, + style, + 5, 5, 5, 5, + hDlg, (HMENU)((UINT_PTR)IDC_PROGRESS_TEXT), + g_install_progress_context.hInstance, NULL); + + memset(&cf, 0 , sizeof(cf)); + cf.cbSize = sizeof(cf); + + // set rich textbox font and size + cf.dwMask = CFM_FACE | CFM_SIZE; + cf.yHeight = 170; + strcpy(cf.szFaceName, "Tahoma"); + + SendMessage(hWnd, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf); + SendMessage(hWnd, EM_SETWORDBREAKPROCEX, (WPARAM)0, (LPARAM)NULL); + SendMessage(hWnd, EM_SETBKGNDCOLOR, (WPARAM)0, (LPARAM)GetSysColor(COLOR_BTNFACE)); + + // create custom progress bar + hWnd = CreateWindowA("STATIC", NULL, + WS_CHILD | WS_VISIBLE | SS_OWNERDRAW, + 5, 5, 5, 5, + hDlg, (HMENU)((UINT_PTR)IDC_PROGRESS_BAR), + g_install_progress_context.hInstance, NULL); + + usb_progress_size(hDlg); + return TRUE; +} + +LRESULT CALLBACK usb_progress_wndproc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ +#define PROGRESS_BLOCK_SIZE 66 + + CREATESTRUCT* cs; + DRAWITEMSTRUCT* ds; + int wmId, wmEvent; + MINMAXINFO* minmaxinfo; + HWND hwnd; + + switch (message) + { + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + if (g_install_progress_context.stopped && wmId == IDCLOSE && wmEvent == BN_CLICKED) + { + PostMessageA(hDlg, UM_PROGRESS_STOP, 0, 0); + } + break; + + case WM_CREATE: + cs = (LPCREATESTRUCT)lParam; + g_install_progress_context.progress_hwnd = hDlg; + g_install_progress_context.hInstance = cs->hInstance; + + usb_progress_init_children(&g_install_progress_context, hDlg); + center_dialog(GetParent(hDlg), hDlg); + + if (InterlockedIncrement(&g_install_progress_context.progress_ind_ofs) == 1) + { + PostMessage(hDlg, UM_PROGRESS_START, 0, 0); + g_install_progress_context.progress_window_ready = TRUE; + + // Send a WM_TIMER message every 1/10th second + SetTimer(hDlg, 1, 10, NULL); + } + + return (INT_PTR)0; + + case WM_TIMER: + InterlockedIncrement(&g_install_progress_context.progress_ind_ofs); + InvalidateRect(GetDlgItem(hDlg, IDC_PROGRESS_BAR), NULL, FALSE); + return (INT_PTR)TRUE; + break; + + case UM_PROGRESS_START: + g_install_progress_context.stopped = FALSE; + if (g_install_progress_context.thread_id == 0) + { + // Using a thread prevents application freezout on security warning + if ( (hwnd = GetDlgItem(hDlg, IDOK)) != NULL) + EnableWindow(hwnd, FALSE); + + SetWindowTextA(hDlg, DISPLAY_RUNNING); + g_install_progress_context.error_count = 0; + g_install_progress_context.thread_id = _beginthread(usb_progress_thread, 0, &g_install_progress_context); + if (g_install_progress_context.thread_id != -1L) + { + return (INT_PTR)TRUE; + } + } + // Fall through and return an error + wParam = (WPARAM) - 1; + + case UM_PROGRESS_STOP: + if (!g_install_progress_context.stopped) + { + g_install_progress_context.stopped = TRUE; + if ( (hwnd = GetDlgItem(hDlg, IDC_PROGRESS_TEXT)) != NULL) + { + if (g_install_progress_context.error_count != 0) + { + usb_progress_add_text(hwnd,"", COLOR_RED, TRUE, FALSE); + usb_progress_add_text(hwnd, "Operation completed with errors!", COLOR_RED, TRUE, FALSE); + } + else + { + usb_progress_add_text(hwnd, "Operation completed successfuly.", GetSysColor(COLOR_BTNTEXT), TRUE, FALSE); + } + } + + // enable the close button + SetWindowLongPtr(hDlg, GWL_STYLE, (GetWindowLongPtr(hDlg, GWL_STYLE) | WS_SYSMENU)); + + // enable ok button + if ( (hwnd = GetDlgItem(hDlg, IDOK)) != NULL) + EnableWindow(hwnd, TRUE); + + if (g_install_progress_context.error_count == 0) + { + SetWindowTextA(hDlg, DISPLAY_DONE); + } + else + { + SetWindowTextA(hDlg, DISPLAY_DONE_WITH_ERRORS); + } + + if (safe_strlen(g_install_progress_context.filter_context->wait_string)) + { + const char* wait_string = g_install_progress_context.filter_context->wait_string; + if (strcmp(install_wait, wait_string) == 0) + { + wait_string = "Click the [X] close button to exit."; + } + + usb_progress_add_text(GetDlgItem(hDlg, IDC_PROGRESS_TEXT), + wait_string, + GetSysColor(COLOR_BTNTEXT), TRUE, FALSE); + } + else if (g_install_progress_context.error_count == 0) + { + PostQuitMessage((int)wParam); + DestroyWindow(hDlg); + return (INT_PTR)TRUE; + } + + // redraw everything + RedrawWindow(hDlg, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INTERNALPAINT | RDW_INVALIDATE); + + + } + else + { + PostQuitMessage((int)wParam); + DestroyWindow(hDlg); + } + return (INT_PTR)TRUE; + + case WM_CLOSE: + if (!g_install_progress_context.stopped) + { + // prevent closure using Alt-F4 while running + return (INT_PTR)TRUE; + } + PostQuitMessage((int)wParam); + DestroyWindow(hDlg); + break; + + case WM_DESTROY: // close application + g_install_progress_context.progress_window_ready = FALSE; + return (INT_PTR)FALSE; + + case WM_SIZE: + if (wParam == SIZE_RESTORED) + { + usb_progress_size(hDlg); + } + break; + + case WM_GETMINMAXINFO: + minmaxinfo = (MINMAXINFO*)lParam; + if (minmaxinfo != NULL) + { + // set min extent + minmaxinfo->ptMinTrackSize.x = 320; + minmaxinfo->ptMinTrackSize.y = 140; + + // set max extent + minmaxinfo->ptMaxTrackSize.x = 800; + minmaxinfo->ptMaxTrackSize.y = 600; + } + break; + + case WM_DRAWITEM: + wmId = (int)wParam; + switch (wmId) + { + case IDC_PROGRESS_BAR: + ds = (DRAWITEMSTRUCT*)lParam; + if ( (ds != NULL) ) + { + TRIVERTEX vertex[4] ; + GRADIENT_RECT gRect; + COLORREF clr, clr2; + USHORT r, g, b; + WORD offset_pos; + DWORD offset; + double actual_offset; + HDC hdc; + HBITMAP memBM; + RECT rect; + + rect = ds->rcItem; + hdc = CreateCompatibleDC(ds->hDC); + memBM = CreateCompatibleBitmap (ds->hDC, rect.right - rect.left, rect.bottom - rect.top ); + SelectObject(hdc, memBM); + + DrawEdge(hdc, &rect, EDGE_ETCHED, BF_RECT); + InflateRect(&rect, -1, -1); + + if (g_install_progress_context.stopped) + { + if (g_install_progress_context.error_count) + { + HBRUSH hbr_fill = CreateSolidBrush(COLOR_LTRED); + FillRect(hdc, &rect, hbr_fill); + DeleteObject(hbr_fill); + } + else + { + FillRect(hdc, &rect, GetSysColorBrush(COLOR_INACTIVEBORDER)); + } + + // Copy back buffer into screen device context for display. + BitBlt(ds->hDC, ds->rcItem.left, ds->rcItem.top, + ds->rcItem.right, ds->rcItem.bottom, hdc, 0, 0, SRCCOPY); + + DeleteDC(hdc); // Free resources. + DeleteObject(memBM); // Free resources. + + return (INT_PTR)TRUE; + + } + + offset = (DWORD)g_install_progress_context.progress_ind_ofs; + clr = GetSysColor(COLOR_ACTIVECAPTION); + clr2 = GetSysColor(COLOR_WINDOW); + + if (offset & 0x40) + offset_pos = (WORD)(((64 - (offset & 63)))); + else + offset_pos = (WORD)(offset & 63); + + actual_offset = offset_pos; + actual_offset /= 64.0; + offset_pos = (WORD)(actual_offset * rect.right); + + RBG_TO_C16(clr2, 0, r, g, b); + TRIVERTEX_FILL(&vertex[0], rect.left, rect.top, r, g, b, 0x0000); + + RBG_TO_C16(clr, 0, r, g, b); + TRIVERTEX_FILL(&vertex[1], offset_pos, rect.bottom, r, g, b, 0x0000); + + RBG_TO_C16(clr, 0, r, g, b); + TRIVERTEX_FILL(&vertex[2], offset_pos, rect.top, r, g, b, 0x0000); + + RBG_TO_C16(clr2, 0, r, g, b); + TRIVERTEX_FILL(&vertex[3], rect.right, rect.bottom, r, g, b, 0x0000); + + // Create a GRADIENT_RECT structure that + // references the TRIVERTEX vertices. + gRect.UpperLeft = 0; + gRect.LowerRight = 1; + + INIT_GRADIENTFILL(); + if (gradient_fill) + { + // Draw a shaded rectangle. + gradient_fill(hdc, &vertex[0], 2, &gRect, 1, GRADIENT_FILL_RECT_H); + gradient_fill(hdc, &vertex[2], 2, &gRect, 1, GRADIENT_FILL_RECT_H); + + // Copy back buffer into screen device context for display. + BitBlt(ds->hDC, ds->rcItem.left, ds->rcItem.top, ds->rcItem.right, + ds->rcItem.bottom, hdc, 0, 0, SRCCOPY); + + DeleteDC(hdc); // Free resources. + DeleteObject(memBM); // Free resources. + + return (INT_PTR)TRUE; + } + else + { + // fallback for no GradientFill api + FillRect(hdc, &rect, GetSysColorBrush(COLOR_ACTIVECAPTION)); + DeleteDC(hdc); // Free resources. + DeleteObject(memBM); // Free resources. + return (INT_PTR)TRUE; + } + + } + break; + } + break; + } + return DefWindowProc(hDlg, message, wParam, lParam); +} + +// initialize progress context +bool_t usb_progress_context_create(install_progress_context_t* install_progress_context, + HINSTANCE hInstance, + filter_context_t* filter_context) +{ + memset(install_progress_context, 0, sizeof(*install_progress_context)); + install_progress_context->hInstance = hInstance; + install_progress_context->filter_context = filter_context; + + return TRUE; +} + +// deinitialize progress context +void usb_progress_context_destroy(install_progress_context_t* install_progress_context) +{ + memset(install_progress_context, 0, sizeof(*install_progress_context)); +} + +// run the installer through a progress window +int usb_install_window(HWND hWnd, HINSTANCE instance, filter_context_t* filter_context) +{ + MSG msg; + WNDCLASSEX wc; + BOOL bRet; + HWND hDlg; + int ret; + + if (!hWnd || !instance) + return -1; + + INIT_RICHED32(); + + if (!usb_progress_context_create(&g_install_progress_context, instance, filter_context)) + { + return -1; + } + memset(&wc, 0, sizeof(wc)); + + // First we create Window class if it doesn't already exist + if (!GetClassInfoExA(instance, "libusbwin32_progress_class", &wc)) + { + wc.cbSize = sizeof(WNDCLASSEX); + wc.style = CS_DBLCLKS | CS_SAVEBITS; + wc.lpfnWndProc = usb_progress_wndproc; + wc.cbClsExtra = wc.cbWndExtra = 0; + wc.hInstance = GetModuleHandle(NULL); + wc.hIcon = wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.lpszClassName = "libusbwin32_progress_class"; + wc.lpszMenuName = NULL; + wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); + + if (!RegisterClassExA(&wc)) + { + USBERR0("can't register class\n"); + usb_progress_context_destroy(&g_install_progress_context); + return -1; + } + } + + // Then we create the dialog base + hDlg = CreateWindowExA(WS_EX_TOOLWINDOW | WS_EX_CONTROLPARENT, + "libusbwin32_progress_class", DISPLAY_NAME, + WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CAPTION | WS_POPUP | WS_THICKFRAME, + 100, 100, 320, 140, hWnd, NULL, instance, NULL); + if (hDlg == NULL) + { + USBERR0("Unable to create progress dialog\n"); + usb_progress_context_destroy(&g_install_progress_context); + return -1; + } + + g_install_progress_context.progress_hwnd = hDlg; + + if (GetDesktopWindow() != hWnd) + EnableWindow(hWnd, FALSE); // Start modal (disable main Window) + + UpdateWindow(hDlg); + + // ...and handle the message processing loop + while( (bRet = GetMessage(&msg, NULL, 0, 0)) != 0) + { + if (bRet == -1) + { + //wdi_err("GetMessage error"); + } + else + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + if (GetDesktopWindow() != hWnd) + EnableWindow(hWnd, TRUE); // end modal (enable main Window) + + ret = g_install_progress_context.ret; + usb_progress_context_destroy(&g_install_progress_context); + + return ret; +} + +static bool_t usb_install_get_argument(LPWSTR param_value, LPCWSTR* out_param, LPCWSTR* out_value, LPCWSTR* param_names) +{ + LPCWSTR param_name; + int param_name_length; + int param_name_pos = 0; + int ret; + + if (!param_value || !out_param || !out_value) + return FALSE; + + *out_param = 0; + *out_value = 0; + + while((param_name = param_names[param_name_pos])) + { + if (!(param_name_length = (int)wcslen(param_name))) + return FALSE; + + if (param_name[param_name_length-1] == '=') + { + ret = _wcsnicmp(param_value, param_name, param_name_length); + } + else + { + ret = _wcsicmp(param_value, param_name); + } + if (ret == 0) + { + *out_param = param_names[param_name_pos]; + *out_value = param_value + param_name_length; + return TRUE; + } + + param_name_pos++; + } + + return FALSE; +} + +void usb_install_report(filter_context_t* filter_context) +{ + filter_class_t* next_class; + filter_device_t* next_device; + + next_class = filter_context->class_filters; + while (next_class) + { + if (next_class->class_filter_devices) + { + USBRAWMSG0("\n"); + } + + USBRAWMSG("%s (%s)\n", next_class->class_guid, next_class->class_name); + + if (strlen(next_class->class_uppers)) + { + if (usb_registry_mz_to_sz(next_class->class_uppers, ',')) + { + USBRAWMSG(" class upper filters:%s\n", next_class->class_uppers); + } + } + if (strlen(next_class->class_lowers)) + { + if (usb_registry_mz_to_sz(next_class->class_lowers, ',')) + { + USBRAWMSG(" class lower filters:%s\n", next_class->class_lowers); + } + } + + next_device = next_class->class_filter_devices; + while(next_device) + { + + USBRAWMSG(" %s - %s (%s)\n", + next_device->device_hwid, next_device->device_name, next_device->device_mfg); + + USBRAWMSG(" %s\n", next_device->device_id); + + if (strlen(next_device->device_uppers)) + { + if (usb_registry_mz_to_sz(next_device->device_uppers, ',')) + { + USBRAWMSG(" device upper filters:%s\n", next_device->device_uppers); + } + } + if (strlen(next_device->device_lowers)) + { + if (usb_registry_mz_to_sz(next_device->device_lowers, ',')) + { + USBRAWMSG(" device lower filters:%s\n", next_device->device_lowers); + } + } + + next_device = next_device->next; + } + next_class = next_class->next; + + } +} + +static bool_t usb_install_iswow64(void) +{ + HMODULE kernel_dll; + is_wow64_process_t IsWow64Process; + BOOL IsWow64 = FALSE; + + kernel_dll = GetModuleHandleA("kernel32.dll"); + if (!kernel_dll) + { + USBERR0("loading kernel32.dll failed\n"); + return FALSE; + } + + IsWow64Process = (is_wow64_process_t) GetProcAddress(kernel_dll, "IsWow64Process"); + if (IsWow64Process) + { + if (!IsWow64Process(GetCurrentProcess(), &IsWow64)) + { + // handle error + IsWow64 = FALSE; + } + } + return IsWow64; +} + +static BOOL usb_install_admin_check(void) +/*++ +Routine Description: This routine returns TRUE if the caller's +process is a member of the Administrators local group. Caller is NOT +expected to be impersonating anyone and is expected to be able to +open its own process and process token. +Arguments: None. +Return Value: +TRUE - Caller has Administrators local group. +FALSE - Caller does not have Administrators local group. -- +*/ +{ + BOOL b; + SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; + PSID AdministratorsGroup; + + GET_WINDOWS_VERSION; + if (windows_version <= WINDOWS_XP) + { + return TRUE; + } + + b = AllocateAndInitializeSid( + &NtAuthority, + 2, + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &AdministratorsGroup); + if(b) + { + if (!CheckTokenMembership( NULL, AdministratorsGroup, &b)) + { + b = FALSE; + } + FreeSid(AdministratorsGroup); + } + + return(b); +} + +void usage(void) +{ +#define ID_HELP_TEXT 10020 +#define ID_DOS_TEXT 300 + + CONST CHAR* src; + DWORD src_count, charsWritten; + HGLOBAL res_data; + HANDLE handle; + HRSRC hSrc; + + if ((handle = GetStdHandle(STD_ERROR_HANDLE)) == INVALID_HANDLE_VALUE) + return; + + hSrc = FindResourceA(NULL, MAKEINTRESOURCEA(ID_HELP_TEXT), MAKEINTRESOURCEA(ID_DOS_TEXT)); + if (!hSrc) return; + + src_count = SizeofResource(NULL, hSrc); + + res_data = LoadResource(NULL, hSrc); + if (!res_data) return; + + src = (char*) LockResource(res_data); + if (!src) return; + + WriteConsoleA(handle, src, src_count, &charsWritten, NULL); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter.c new file mode 100644 index 0000000..9379f9f --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter.c @@ -0,0 +1,27 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * Copyright (c) 2010 Travis Robinson +* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include "usb.h" + + +int main() +{ + return usb_install_npW(NULL, NULL, GetCommandLineW(), 1); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_rc.rc new file mode 100644 index 0000000..2c5501e --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_rc.rc @@ -0,0 +1,21 @@ + + +#ifndef __INSTALL_FILTER_RC__ +#define ID_HELP_TEXT 10020 +#define ID_DOS_TEXT 300 + +#ifdef __GNUC__ +#define _WIN32_IE 0x0501 +#endif + +#include + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "libusb-win32 - Install-Filter" +#define RC_FILE_NAME_STR "install-filter.exe" + +#include "libusb-win32_version.rc" + +ID_HELP_TEXT ID_DOS_TEXT "install-filter-help.txt" +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.c new file mode 100644 index 0000000..1a9d428 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.c @@ -0,0 +1,712 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2006 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define INITGUID + +#include + +#ifdef __GNUC__ + #if defined(_WIN64) + #include + #else + #include + #endif +#else + #include + #define strlwr(p) _strlwr(p) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libusb-win32_version.h" +#include "registry.h" + +#define __INSTALL_FILTER_WIN_C__ +#include "install_filter_win_rc.rc" + +#define MAX_TEXT_LENGTH 256 + +#define _STRINGIFY(x) #x +#define STRINGIFY(x) _STRINGIFY(x) + + +// Used for device notification +DEFINE_GUID(GUID_DEVINTERFACE_USB_HUB, 0xf18a0e88, 0xc30c, 0x11d0, 0x88, \ + 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8); + +DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, \ + 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); + +typedef struct +{ + UINT controlID; + const char* message; +}create_tooltip_t; + +typedef struct +{ + filter_mode_e mode; + filter_type_e type; + + struct + { + // device plugged notification + HDEVNOTIFY handle_hub; + HDEVNOTIFY handle_dev; + }notify; + +}install_filter_win_t,*pinstall_filter_win_t; + +const char info_text_0[] = +"This program adds/removes libusb-win32 as a driver to an existing device installation.\r\n\r\n" +"The libusb-win32 filter driver allows access to usb devices using the libusb-win32 api while maintaining " +"compatibility with software which uses the original driver."; + +const char info_text_1[] = +"A windows driver installation package has been created for the following " +"device:"; + +const char package_contents_fmt_0[] = +"This package contains %s v%d.%d.%d.%d drivers and support for the following platforms: %s."; + +const char package_contents_fmt_1[] = +"This package contains an inf file only."; + + +const char list_header_text_install[] = +"Connect your device and select it from the list of unfiltered devices below. " +"If your device isn't listed, it may already be filtered, be in a \"driverless\" state, " +"or incompatible with the libusb-win32 filter driver."; + +const char list_header_text_remove[] = +"Select your device from the list of filtered devices below. " +"If your device isn't listed, it does not have a device filter."; + +create_tooltip_t tooltips_dlg0[]= +{ + {IDC_INSTALL_DEVICE_FILTER, + "Install libusb-win32 as a device upper filter for a single device. This device is selected on the next wizard page."}, + + {IDC_REMOVE_DEVICE_FILTER, + "Remove a libusb-win32 device upper filter for a single device. This device is selected on the next wizard page."}, + + {IDC_REMOVE_DEVICE_FILTERS, + "Remove all libusb-win32 device upper filters."}, + + {0,NULL} +}; + +create_tooltip_t tooltips_dlg1[]= +{ + {IDC_SHOW_CONNECTED_DEVICES, + "A VID is a 16-bit vendor number (Vendor ID). A vendor ID is " + "necessary for developing a USB product. The USB-IF is responsible " + "for issuing USB vendor ID's to product manufacturers."}, + + {IDC_SHOW_ALL_DEVICES, + "A PID is a 16-bit product number (Product ID)."}, + + {ID_LIST, + LPSTR_TEXTCALLBACK}, + + {0,NULL} +}; + +HICON mIcon; +HINSTANCE g_hInst = NULL; + +// see install.c +extern int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); + +HWND create_tooltip(HWND hMain, HINSTANCE hInstance, UINT max_tip_width, create_tooltip_t tool_tips[]); +BOOL CALLBACK dialog_proc_0(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); +BOOL CALLBACK dialog_proc_1(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam); + +static void device_list_init(pinstall_filter_win_t context, HWND list); +static bool_t device_list_refresh(pinstall_filter_win_t context, HWND list); +static void device_list_add(pinstall_filter_win_t context, HWND list, filter_device_t* device); +static void device_list_clean(pinstall_filter_win_t context, HWND list); + +void output_debug(char* format,...) +{ + va_list args; + char msg[256]; + + va_start (args, format); + vsprintf(msg, format, args); + va_end (args); + + OutputDebugStringA(msg); +} + +void init_install_filter_context(install_filter_win_t* context) +{ + memset(context, 0, sizeof(*context)); + context->mode = FM_INSTALL; + context->type = FT_DEVICE_UPPERFILTER; +} + +int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev_instance, + LPSTR cmd_line, int cmd_show) +{ + install_filter_win_t context; + int next_dialog; + + + LoadLibrary("comctl32.dll"); + InitCommonControls(); + if (cmd_line && strlen(cmd_line)) + { + HWND hwnd = GetDesktopWindow(); + return usb_install_npA(hwnd, instance, cmd_line, 0); + } + init_install_filter_context(&context); + + next_dialog = ID_DIALOG_0; + + mIcon = LoadIcon(instance, MAKEINTRESOURCE(IDR_MAIN_ICON)); + + g_hInst = instance; + + while (next_dialog) + { + switch (next_dialog) + { + case ID_DIALOG_0: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_0, + (LPARAM)&context); + + break; + case ID_DIALOG_1: + next_dialog = (int)DialogBoxParam(instance, + MAKEINTRESOURCE(next_dialog), + NULL, (DLGPROC)dialog_proc_1, + (LPARAM)&context); + break; + default: + ; + } + } + + if (mIcon) + { + DestroyIcon(mIcon); + mIcon = NULL; + } + return 0; +} + +static void device_notification_register(HWND dialog, pinstall_filter_win_t context) +{ + DEV_BROADCAST_DEVICEINTERFACE dev_if; + + dev_if.dbcc_size = sizeof(dev_if); + dev_if.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + + // register for device hub hot-plugs + if (!context->notify.handle_hub) + { + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_HUB; + context->notify.handle_hub = RegisterDeviceNotification(dialog, &dev_if, 0); + } + + // register for device hot-plugs + if (!context->notify.handle_dev) + { + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; + context->notify.handle_dev = RegisterDeviceNotification(dialog, &dev_if, 0); + } +} + +static void device_notification_unregister(pinstall_filter_win_t context) +{ + if (context->notify.handle_hub) + { + UnregisterDeviceNotification(context->notify.handle_hub); + context->notify.handle_hub = NULL; + } + if (context->notify.handle_dev) + { + UnregisterDeviceNotification(context->notify.handle_dev); + context->notify.handle_dev = NULL; + } +} + +BOOL CALLBACK dialog_proc_0(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + static install_filter_win_t* context = NULL; + + switch (message) + { + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + context = (install_filter_win_t*)lParam; + + SetWindowText(GetDlgItem(dialog, ID_INFO_TEXT), info_text_0); + create_tooltip(dialog, g_hInst, 300, tooltips_dlg0); + + switch(context->mode) + { + case FM_INSTALL: + CheckRadioButton(dialog, IDC_INSTALL_DEVICE_FILTER, IDC_REMOVE_DEVICE_FILTERS, IDC_INSTALL_DEVICE_FILTER); + break; + case FM_REMOVE: + CheckRadioButton(dialog, IDC_INSTALL_DEVICE_FILTER, IDC_REMOVE_DEVICE_FILTERS, IDC_REMOVE_DEVICE_FILTER); + break; + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_NEXT: + context->type = FT_DEVICE_UPPERFILTER; + if (IsDlgButtonChecked(dialog, IDC_INSTALL_DEVICE_FILTER)) + { + context->mode = FM_INSTALL; + } + else if (IsDlgButtonChecked(dialog, IDC_REMOVE_DEVICE_FILTER)) + { + context->mode = FM_REMOVE; + } + else if (IsDlgButtonChecked(dialog, IDC_REMOVE_DEVICE_FILTERS)) + { + if (MessageBox(dialog, + "This will remove libusb-win32 as a device filter for all known devices. Are you sure you wich to continue?", + "Remove all device filters", + MB_OKCANCEL|MB_ICONWARNING) == IDOK) + { + if (usb_install_npA(dialog, g_hInst, "uninstall -ad", 0) == 0) + { + MessageBox(dialog, + "All libusb-win32 device filters removed successfully.", + "Remove all device filters", + MB_OK|MB_ICONINFORMATION); + + // reset to wizard defaults + init_install_filter_context(context); + EndDialog(dialog, ID_DIALOG_0); + } + else + { + // if an error occurs, usb_install_np() displays the error message. + } + } + return TRUE ; + } + EndDialog(dialog, ID_DIALOG_1); + return TRUE ; + + case ID_BUTTON_CANCEL: + case IDCANCEL: + EndDialog(dialog, 0); + return TRUE ; + } + } + + return FALSE; +} + +BOOL CALLBACK dialog_proc_1(HWND dialog, UINT message, + WPARAM wParam, LPARAM lParam) +{ + static install_filter_win_t* context = NULL; + DEV_BROADCAST_HDR *hdr = (DEV_BROADCAST_HDR *) lParam; + filter_device_t* selected_device; + + HWND list = GetDlgItem(dialog, ID_LIST); + LVITEM item; + + switch (message) + { + case WM_DESTROY: + if (list) + { + device_list_clean(context, list); + } + break; + case WM_INITDIALOG: + SendMessage(dialog,WM_SETICON,ICON_SMALL, (LPARAM)mIcon); + SendMessage(dialog,WM_SETICON,ICON_BIG, (LPARAM)mIcon); + + context = (install_filter_win_t *)lParam; + + device_list_init(context, list); + switch (context->mode) + { + case FM_INSTALL: + SetWindowText(GetDlgItem(dialog, ID_LIST_HEADER_TEXT), list_header_text_install); + SetWindowText(GetDlgItem(dialog, ID_BUTTON_NEXT), "Install"); + break; + case FM_REMOVE: + SetWindowText(GetDlgItem(dialog, ID_LIST_HEADER_TEXT), list_header_text_remove); + SetWindowText(GetDlgItem(dialog, ID_BUTTON_NEXT), "Remove"); + break; + } + EnableWindow(GetDlgItem(dialog, ID_BUTTON_NEXT), FALSE); + device_list_refresh(context, list); + + device_notification_register(dialog, context); + + return TRUE; + + case WM_DEVICECHANGE: + switch (wParam) + { + case DBT_DEVICEREMOVECOMPLETE: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + { + EnableWindow(GetDlgItem(dialog, ID_BUTTON_NEXT), FALSE); + device_list_refresh(context, list); + } + break; + case DBT_DEVICEARRIVAL: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + { + EnableWindow(GetDlgItem(dialog, ID_BUTTON_NEXT), FALSE); + device_list_refresh(context, list); + } + break; + default:; + } + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case ID_BUTTON_NEXT: + device_notification_unregister(context); + + memset(&item, 0, sizeof(item)); + item.mask = LVIF_TEXT | LVIF_PARAM; + item.iItem = ListView_GetNextItem(list, -1, LVNI_SELECTED); + + if (item.iItem >= 0) + { + if (ListView_GetItem(list, &item)) + { + selected_device = (filter_device_t*)item.lParam; + if (selected_device) + { + char tmp[MAX_PATH]; + sprintf(tmp,"%s \"-di=%s\"", + (context->mode == FM_INSTALL) ? "i":"u", + selected_device->device_id); + + if (usb_install_npA(dialog, g_hInst, tmp, 0) == 0) + { + char msg_title[MAX_PATH]; + char msg_txt[MAX_PATH*3]; + + sprintf(msg_title, + "%s device filter", + (context->mode == FM_INSTALL) ? "Install":"Remove"); + + sprintf(msg_txt, + "libusb-win32 device filter successfully %s for %s (%s)", + (context->mode == FM_INSTALL) ? "installed":"removed", + selected_device->device_name, + selected_device->device_hwid); + + MessageBox(dialog, msg_txt, msg_title, MB_OK|MB_ICONINFORMATION); + device_list_clean(context, list); + EndDialog(dialog, ID_DIALOG_1); + return TRUE; + } + } + } + } + + EndDialog(dialog, 0); + return TRUE; + + case ID_BUTTON_BACK: + device_notification_unregister(context); + device_list_clean(context, list); + EndDialog(dialog, ID_DIALOG_0); + return TRUE ; + + case ID_BUTTON_CANCEL: + case IDCANCEL: + device_notification_unregister(context); + device_list_clean(context, list); + EndDialog(dialog, 0); + return TRUE ; + } + break; + case WM_NOTIFY: + if ( (lParam) && (((LPNMHDR)lParam)->idFrom == ID_LIST) ) + { + LPNMLISTVIEW pnmv; + HWND hwnd; + switch (((LPNMHDR)lParam)->code) + { + case LVN_ITEMCHANGED: + pnmv = (LPNMLISTVIEW) lParam; + if (pnmv->uNewState & LVIS_SELECTED) + { + hwnd = GetDlgItem(dialog, ID_BUTTON_NEXT); + if (!IsWindowEnabled(hwnd)) + { + EnableWindow(hwnd, TRUE); + } + } + break; + } + } + break; + } + + return FALSE; +} + +static void device_list_init(pinstall_filter_win_t context, HWND list) +{ + LVCOLUMN lvc; + int ignored, width; + RECT list_rect; + + GetClientRect(list, &list_rect); + width = list_rect.right - GetSystemMetrics(SM_CXVSCROLL); + + ignored = (int)ListView_SetExtendedListViewStyle(list, LVS_EX_FULLROWSELECT); + + memset(&lvc, 0, sizeof(lvc)); + + lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT; + lvc.fmt = LVCFMT_LEFT; + + lvc.cx = width / 2; + lvc.iSubItem = 0; + lvc.pszText = "Hardware ID"; + ignored = ListView_InsertColumn(list, 1, &lvc); + + lvc.iSubItem = 1; + lvc.pszText = "Description"; + ignored = ListView_InsertColumn(list, 2, &lvc); + + lvc.iSubItem = 2; + lvc.pszText = "Manufacturer"; + ignored = ListView_InsertColumn(list, 3, &lvc); + +} + +static bool_t device_list_refresh(pinstall_filter_win_t context, HWND list) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + filter_device_t* device = NULL; + filter_device_t* prev = NULL; + filter_device_t temp; + int dev_index = -1; + bool_t is_service_libusb; + filter_type_e filter_type; + DWORD flags; + bool_t remove; + + if (!context) return FALSE; + + device_list_clean(context, list); + + flags = context->mode == FM_INSTALL ? (DIGCF_ALLCLASSES | DIGCF_PRESENT) : DIGCF_ALLCLASSES; + remove = context->mode == FM_INSTALL ? FALSE : TRUE; + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, flags); + if (dev_info == INVALID_HANDLE_VALUE) + { + MessageBox(GetParent(list), + "failed enumerating devices", + "install-filter error", + MB_OK|MB_ICONERROR); + return FALSE; + } + + while (SetupDiEnumDeviceInfo(dev_info, ++dev_index, &dev_info_data)) + { + if (!usb_registry_is_service_libusb(dev_info, &dev_info_data, &is_service_libusb)) + continue; + + // don't list libusb devices + if (is_service_libusb) + continue; + + memset(&temp, 0, sizeof(temp)); + + // get the compatible ids + if (!usb_registry_get_property(SPDRP_COMPATIBLEIDS, dev_info, &dev_info_data, + temp.device_hwid, sizeof(temp.device_hwid))) + continue; + + usb_registry_mz_string_lower(temp.device_hwid); + + // don't list usb hubs + if (usb_registry_mz_string_find_sub(temp.device_hwid, "class_09")) + continue; + + // get the hardware ids + if (!usb_registry_get_hardware_id(dev_info, &dev_info_data, temp.device_hwid)) + continue; + usb_registry_mz_string_lower(temp.device_hwid); + + // don't list root hubs + if (usb_registry_mz_string_find_sub(temp.device_hwid, "root_hub")) + continue; + + // get the device instance id + if (CM_Get_Device_ID(dev_info_data.DevInst, temp.device_id, sizeof(temp.device_id), 0) != CR_SUCCESS) + continue; + + // get the libusb0 device upper/lower filter type + if (!usb_registry_get_device_filter_type(dev_info, &dev_info_data, &filter_type)) + continue; + + // list devices for removal that currently have a device filter + if (remove && ((filter_type & (FT_DEVICE_UPPERFILTER | FT_DEVICE_LOWERFILTER)) == FT_NONE)) + continue; + + // don't list devices for install that are already filtered + if (!remove && ((filter_type & (FT_DEVICE_UPPERFILTER | FT_DEVICE_LOWERFILTER)) != FT_NONE)) + continue; + + // get the manufacturer + usb_registry_get_property(SPDRP_MFG, dev_info, &dev_info_data, + temp.device_mfg, sizeof(temp.device_mfg)); + + // get the description + usb_registry_get_property(SPDRP_DEVICEDESC, dev_info, &dev_info_data, + temp.device_name, sizeof(temp.device_name)); + + device = (filter_device_t*) malloc(sizeof(filter_device_t)); + memcpy(device, &temp, sizeof(filter_device_t)); + + device_list_add(context, list, device); + if (prev) + prev->next = device; + + prev = device; + } + SetupDiDestroyDeviceInfoList(dev_info); + + return TRUE; +} + +static void device_list_add(pinstall_filter_win_t context, HWND list, filter_device_t *device) +{ + LVITEM item; + int ignored; + char hwid[MAX_PATH]; + char* hwid_ch; + memset(&item, 0, sizeof(item)); + + // strip "usb\" + strcpy(hwid, device->device_hwid+4); + + // replace '&' with ' ' + while( (hwid_ch = strchr(hwid,'&')) ) + *hwid_ch = ' '; + + // replace '_' with ':' + while( (hwid_ch = strchr(hwid,'_')) ) + *hwid_ch = ':'; + + item.mask = LVIF_TEXT | LVIF_PARAM; + item.lParam = (LPARAM)device; + + ignored = ListView_InsertItem(list, &item); + + ListView_SetItemText(list, 0, 0, hwid); + ListView_SetItemText(list, 0, 1, device->device_name); + ListView_SetItemText(list, 0, 2, device->device_mfg); +} + +static void device_list_clean(pinstall_filter_win_t context, HWND list) +{ + LVITEM item; + BOOL ignored; + + memset(&item, 0, sizeof(LVITEM)); + + while (ListView_GetItem(list, &item)) + { + if (item.lParam) + free((void *)item.lParam); + + ignored = ListView_DeleteItem(list, 0); + memset(&item, 0, sizeof(LVITEM)); + } +} + +int device_filter_install(pinstall_filter_win_t context, HWND dialog, filter_device_t *device) +{ + + // TODO + MessageBoxA(dialog, "error","Error Installing Driver", MB_OK|MB_ICONWARNING); + + return 0; +} + +/* +* Create a tooltip for the controls in tool_tips +*/ +HWND create_tooltip(HWND hMain, HINSTANCE hInstance, UINT max_tip_width, create_tooltip_t tool_tips[]) +{ + HWND hTip; + TOOLINFO toolInfo = {0}; + int i; + + // Create the tooltip window + hTip = CreateWindowExA(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hMain, NULL, + hInstance, NULL); + + if (hTip == NULL) { + return (HWND)NULL; + } + + // Associate the tooltip to the control + toolInfo.cbSize = sizeof(toolInfo); + toolInfo.hwnd = hMain; + toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS; + + for (i=0; tool_tips[i].controlID != 0 && tool_tips[i].message != NULL; i++) + { + toolInfo.uId =(UINT_PTR)GetDlgItem(hMain,tool_tips[i].controlID); + toolInfo.lpszText = (LPSTR)tool_tips[i].message; + SendMessage(hTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo); + } + + SendMessage(hTip, TTM_SETMAXTIPWIDTH, 0, max_tip_width); + + return hTip; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.ico b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.ico new file mode 100644 index 0000000..f83815e Binary files /dev/null and b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win.ico differ diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win_rc.rc new file mode 100644 index 0000000..f1450b1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/install_filter_win_rc.rc @@ -0,0 +1,93 @@ + +#ifdef __GNUC__ +#define _WIN32_IE 0x0501 +#endif + +#include +#include + +#define IDR_MAIN_ICON 128 + +#define ID_DIALOG_0 10000 +#define ID_DIALOG_1 10001 + +#define ID_BUTTON_CANCEL 10010 +#define ID_BUTTON_NEXT 10011 +#define ID_BUTTON_BACK 10012 + +#define ID_INFO_TEXT 10020 + +#define ID_LIST 10021 +#define ID_LIST_HEADER_TEXT 10022 + +#define IDC_SHOW_CONNECTED_DEVICES 10100 +#define IDC_SHOW_ALL_DEVICES 10101 + +#define IDC_INSTALL_DEVICE_FILTER 10102 +#define IDC_REMOVE_DEVICE_FILTER 10103 +#define IDC_REMOVE_DEVICE_FILTERS 10104 + +#define IDG_MAIN 11000 +#define IDG_DEVICES 11001 +#define IDG_CLASSES 11002 + +//#define DIALOG_FONT "MS Sans Serif" +#define DIALOG_FONT "Tahoma" +#define DIALOG_FONT_SIZE 8 +#define DIALOG_CAPTION "libusb-win32 filter installer\0" + +#ifndef __INSTALL_FILTER_WIN_C__ + + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR DIALOG_CAPTION +#define RC_FILE_NAME_STR "install-filter-win.exe" + +#include "libusb-win32_version.rc" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAIN_ICON ICON "install_filter_win.ico" + +ID_DIALOG_0 DIALOG DISCARDABLE 0,0,310,200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + DEFPUSHBUTTON "Next >",ID_BUTTON_NEXT,190,175,50,15 + PUSHBUTTON "Cancel",ID_BUTTON_CANCEL,250,175,50,15 + GROUPBOX "Information",IDG_MAIN,10,10,290,70 + LTEXT 0,ID_INFO_TEXT,20,20,270,50 + GROUPBOX "Install/Remove Device Filter(s)",IDG_DEVICES,10,90,130,65 + CONTROL "Install a device filter",IDC_INSTALL_DEVICE_FILTER,"Button",WS_GROUP|BS_AUTORADIOBUTTON,15,105,120,10 + CONTROL "Remove a device filter",IDC_REMOVE_DEVICE_FILTER,"Button",BS_AUTORADIOBUTTON,15,120,120,10 + CONTROL "Remove all device filters",IDC_REMOVE_DEVICE_FILTERS,"Button",BS_AUTORADIOBUTTON,15,135,120,10 +END + +ID_DIALOG_1 DIALOG DISCARDABLE 0, 0, 310, 200 +STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | + WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION DIALOG_CAPTION +FONT DIALOG_FONT_SIZE, DIALOG_FONT +BEGIN + DEFPUSHBUTTON "Next >",ID_BUTTON_NEXT,190,175,50,15 + PUSHBUTTON "< Back",ID_BUTTON_BACK,130,175,50,15 + PUSHBUTTON "Cancel",ID_BUTTON_CANCEL,250,175,50,15 + GROUPBOX "Device Selection",IDG_MAIN,10,10,290,155 + LTEXT 0,ID_LIST_HEADER_TEXT,20,25,270,30 + CONTROL "List2",ID_LIST,WC_LISTVIEW, + WS_BORDER | WS_TABSTOP | LVS_REPORT | LVS_SINGLESEL + | LVS_SHOWSELALWAYS, 20,60,270,95 +END + +ID_MANIFEST RT_MANIFEST "common_controls_admin.manifest" + +#endif + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.h new file mode 100644 index 0000000..1d55aa7 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.h @@ -0,0 +1,18 @@ +/* libusb-win32_version.h ++ auto-generated +*/ +#ifndef __LIBUSB_WIN32_VERSION_H +#define __LIBUSB_WIN32_VERSION_H + +#define __DEFTOSTR(x) #x +#define _DEFTOSTR(x) __DEFTOSTR(x) + +#define VERSION_MAJOR 1 +#define VERSION_MINOR 2 +#define VERSION_MICRO 4 +#define VERSION_NANO 0 +#define VERSION_DATE 04/08/2011 + +#define VERSION VERSION_MAJOR.VERSION_MINOR.VERSION_MICRO.VERSION_NANO +#define RC_VERSION VERSION_MAJOR,VERSION_MINOR,VERSION_MICRO,VERSION_NANO + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.rc new file mode 100644 index 0000000..b265a00 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version.rc @@ -0,0 +1,54 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include "libusb-win32_version.h" + +#define RT_MANIFEST 24 +#define ID_MANIFEST 1 + +VS_VERSION_INFO VERSIONINFO +FILEVERSION RC_VERSION +PRODUCTVERSION RC_VERSION +FILEFLAGSMASK 0x3FL +FILEFLAGS 0x0L +FILEOS VOS_NT_WINDOWS32 +FILETYPE RC_FILE_TYPE +FILESUBTYPE RC_FILE_SUB_TYPE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "http://libusb-win32.sourceforge.net" + VALUE "FileDescription", RC_PRODUCT_STR + VALUE "FileVersion", _DEFTOSTR(VERSION) + VALUE "InternalName", RC_FILE_NAME_STR + VALUE "LegalCopyright", "2002-2009 S. Meyer; 2010 T. Robinson" + VALUE "OriginalFilename",RC_FILE_NAME_STR + VALUE "ProductName", RC_PRODUCT_STR + VALUE "ProductVersion", _DEFTOSTR(VERSION) + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version_h.in b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version_h.in new file mode 100644 index 0000000..6b7e88d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb-win32_version_h.in @@ -0,0 +1,18 @@ +/* libusb-win32_version.h ++ auto-generated +*/ +#ifndef __LIBUSB_WIN32_VERSION_H +#define __LIBUSB_WIN32_VERSION_H + +#define __DEFTOSTR(x) #x +#define _DEFTOSTR(x) __DEFTOSTR(x) + +#define VERSION_MAJOR @VERSION_MAJOR@ +#define VERSION_MINOR @VERSION_MINOR@ +#define VERSION_MICRO @VERSION_MICRO@ +#define VERSION_NANO @VERSION_NANO@ +#define VERSION_DATE @_MM_@/@_DD_@/@_YYYY_@ + +#define VERSION VERSION_MAJOR.VERSION_MINOR.VERSION_MICRO.VERSION_NANO +#define RC_VERSION VERSION_MAJOR,VERSION_MINOR,VERSION_MICRO,VERSION_NANO + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb_dyn.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb_dyn.c new file mode 100644 index 0000000..765af4a --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/libusb_dyn.c @@ -0,0 +1,485 @@ +/* LIBUSB-WIN32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include +#include + +#include "usb.h" + +#define LIBUSB_DLL_NAME "libusb0.dll" + + +typedef usb_dev_handle * (*usb_open_t)(struct usb_device *dev); +typedef int (*usb_close_t)(usb_dev_handle *dev); +typedef int (*usb_get_string_t)(usb_dev_handle *dev, int index, int langid, + char *buf, size_t buflen); +typedef int (*usb_get_string_simple_t)(usb_dev_handle *dev, int index, + char *buf, size_t buflen); +typedef int (*usb_get_descriptor_by_endpoint_t)(usb_dev_handle *udev, int ep, + unsigned char type, + unsigned char index, + void *buf, int size); +typedef int (*usb_get_descriptor_t)(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); +typedef int (*usb_bulk_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_bulk_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_write_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_interrupt_read_t)(usb_dev_handle *dev, int ep, char *bytes, + int size, int timeout); +typedef int (*usb_control_msg_t)(usb_dev_handle *dev, int requesttype, + int request, int value, int index, + char *bytes, int size, int timeout); +typedef int (*usb_set_configuration_t)(usb_dev_handle *dev, int configuration); +typedef int (*usb_claim_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_release_interface_t)(usb_dev_handle *dev, int interface); +typedef int (*usb_set_altinterface_t)(usb_dev_handle *dev, int alternate); +typedef int (*usb_resetep_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_clear_halt_t)(usb_dev_handle *dev, unsigned int ep); +typedef int (*usb_reset_t)(usb_dev_handle *dev); +typedef char * (*usb_strerror_t)(void); +typedef void (*usb_init_t)(void); +typedef void (*usb_set_debug_t)(int level); +typedef int (*usb_find_busses_t)(void); +typedef int (*usb_find_devices_t)(void); +typedef struct usb_device * (*usb_device_t)(usb_dev_handle *dev); +typedef struct usb_bus * (*usb_get_busses_t)(void); +typedef int (*usb_install_service_np_t)(void); +typedef int (*usb_uninstall_service_np_t)(void); +typedef int (*usb_install_driver_np_t)(const char *inf_file); +typedef const struct usb_version * (*usb_get_version_t)(void); +typedef int (*usb_isochronous_setup_async_t)(usb_dev_handle *dev, + void **context, + unsigned char ep, int pktsize); +typedef int (*usb_bulk_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_interrupt_setup_async_t)(usb_dev_handle *dev, void **context, + unsigned char ep); +typedef int (*usb_submit_async_t)(void *context, char *bytes, int size); +typedef int (*usb_reap_async_t)(void *context, int timeout); +typedef int (*usb_free_async_t)(void **context); + + +static usb_open_t _usb_open = NULL; +static usb_close_t _usb_close = NULL; +static usb_get_string_t _usb_get_string = NULL; +static usb_get_string_simple_t _usb_get_string_simple = NULL; +static usb_get_descriptor_by_endpoint_t _usb_get_descriptor_by_endpoint = NULL; +static usb_get_descriptor_t _usb_get_descriptor = NULL; +static usb_bulk_write_t _usb_bulk_write = NULL; +static usb_bulk_read_t _usb_bulk_read = NULL; +static usb_interrupt_write_t _usb_interrupt_write = NULL; +static usb_interrupt_read_t _usb_interrupt_read = NULL; +static usb_control_msg_t _usb_control_msg = NULL; +static usb_set_configuration_t _usb_set_configuration = NULL; +static usb_claim_interface_t _usb_claim_interface = NULL; +static usb_release_interface_t _usb_release_interface = NULL; +static usb_set_altinterface_t _usb_set_altinterface = NULL; +static usb_resetep_t _usb_resetep = NULL; +static usb_clear_halt_t _usb_clear_halt = NULL; +static usb_reset_t _usb_reset = NULL; +static usb_strerror_t _usb_strerror = NULL; +static usb_init_t _usb_init = NULL; +static usb_set_debug_t _usb_set_debug = NULL; +static usb_find_busses_t _usb_find_busses = NULL; +static usb_find_devices_t _usb_find_devices = NULL; +static usb_device_t _usb_device = NULL; +static usb_get_busses_t _usb_get_busses = NULL; +static usb_install_service_np_t _usb_install_service_np = NULL; +static usb_uninstall_service_np_t _usb_uninstall_service_np = NULL; +static usb_install_driver_np_t _usb_install_driver_np = NULL; +static usb_get_version_t _usb_get_version = NULL; +static usb_isochronous_setup_async_t _usb_isochronous_setup_async = NULL; +static usb_bulk_setup_async_t _usb_bulk_setup_async = NULL; +static usb_interrupt_setup_async_t _usb_interrupt_setup_async = NULL; +static usb_submit_async_t _usb_submit_async = NULL; +static usb_reap_async_t _usb_reap_async = NULL; +static usb_free_async_t _usb_free_async = NULL; + + + + +void usb_init(void) +{ + HINSTANCE libusb_dll = LoadLibrary(LIBUSB_DLL_NAME); + + if (!libusb_dll) + return; + + _usb_open = (usb_open_t) + GetProcAddress(libusb_dll, "usb_open"); + _usb_close = (usb_close_t) + GetProcAddress(libusb_dll, "usb_close"); + _usb_get_string = (usb_get_string_t) + GetProcAddress(libusb_dll, "usb_get_string"); + _usb_get_string_simple = (usb_get_string_simple_t) + GetProcAddress(libusb_dll, "usb_get_string_simple"); + _usb_get_descriptor_by_endpoint = (usb_get_descriptor_by_endpoint_t) + GetProcAddress(libusb_dll, "usb_get_descriptor_by_endpoint"); + _usb_get_descriptor = (usb_get_descriptor_t) + GetProcAddress(libusb_dll, "usb_get_descriptor"); + _usb_bulk_write = (usb_bulk_write_t) + GetProcAddress(libusb_dll, "usb_bulk_write"); + _usb_bulk_read = (usb_bulk_read_t) + GetProcAddress(libusb_dll, "usb_bulk_read"); + _usb_interrupt_write = (usb_interrupt_write_t) + GetProcAddress(libusb_dll, "usb_interrupt_write"); + _usb_interrupt_read = (usb_interrupt_read_t) + GetProcAddress(libusb_dll, "usb_interrupt_read"); + _usb_control_msg = (usb_control_msg_t) + GetProcAddress(libusb_dll, "usb_control_msg"); + _usb_set_configuration = (usb_set_configuration_t) + GetProcAddress(libusb_dll, "usb_set_configuration"); + _usb_claim_interface = (usb_claim_interface_t) + GetProcAddress(libusb_dll, "usb_claim_interface"); + _usb_release_interface = (usb_release_interface_t) + GetProcAddress(libusb_dll, "usb_release_interface"); + _usb_set_altinterface = (usb_set_altinterface_t) + GetProcAddress(libusb_dll, "usb_set_altinterface"); + _usb_resetep = (usb_resetep_t) + GetProcAddress(libusb_dll, "usb_resetep"); + _usb_clear_halt = (usb_clear_halt_t) + GetProcAddress(libusb_dll, "usb_clear_halt"); + _usb_reset = (usb_reset_t) + GetProcAddress(libusb_dll, "usb_reset"); + _usb_strerror = (usb_strerror_t) + GetProcAddress(libusb_dll, "usb_strerror"); + _usb_init = (usb_init_t) + GetProcAddress(libusb_dll, "usb_init"); + _usb_set_debug = (usb_set_debug_t) + GetProcAddress(libusb_dll, "usb_set_debug"); + _usb_find_busses = (usb_find_busses_t) + GetProcAddress(libusb_dll, "usb_find_busses"); + _usb_find_devices = (usb_find_devices_t) + GetProcAddress(libusb_dll, "usb_find_devices"); + _usb_device = (usb_device_t) + GetProcAddress(libusb_dll, "usb_device"); + _usb_get_busses = (usb_get_busses_t) + GetProcAddress(libusb_dll, "usb_get_busses"); + _usb_install_service_np = (usb_install_service_np_t) + GetProcAddress(libusb_dll, "usb_install_service_np"); + _usb_uninstall_service_np = (usb_uninstall_service_np_t) + GetProcAddress(libusb_dll, "usb_uninstall_service_np"); + _usb_install_driver_np = (usb_install_driver_np_t) + GetProcAddress(libusb_dll, "usb_install_driver_np"); + _usb_get_version = (usb_get_version_t) + GetProcAddress(libusb_dll, "usb_get_version"); + _usb_isochronous_setup_async = (usb_isochronous_setup_async_t) + GetProcAddress(libusb_dll, "usb_isochronous_setup_async"); + _usb_bulk_setup_async = (usb_bulk_setup_async_t) + GetProcAddress(libusb_dll, "usb_bulk_setup_async"); + _usb_interrupt_setup_async = (usb_interrupt_setup_async_t) + GetProcAddress(libusb_dll, "usb_interrupt_setup_async"); + _usb_submit_async = (usb_submit_async_t) + GetProcAddress(libusb_dll, "usb_submit_async"); + _usb_reap_async = (usb_reap_async_t) + GetProcAddress(libusb_dll, "usb_reap_async"); + _usb_free_async = (usb_free_async_t) + GetProcAddress(libusb_dll, "usb_free_async"); + + if (_usb_init) + _usb_init(); +} + +usb_dev_handle *usb_open(struct usb_device *dev) +{ + if (_usb_open) + return _usb_open(dev); + else + return NULL; +} + +int usb_close(usb_dev_handle *dev) +{ + if (_usb_close) + return _usb_close(dev); + else + return -ENOFILE; +} + +int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen) +{ + if (_usb_get_string) + return _usb_get_string(dev, index, langid, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen) +{ + if (_usb_get_string_simple) + return _usb_get_string_simple(dev, index, buf, buflen); + else + return -ENOFILE; +} + +int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size) +{ + if (_usb_get_descriptor_by_endpoint) + return _usb_get_descriptor_by_endpoint(udev, ep, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size) +{ + if (_usb_get_descriptor) + return _usb_get_descriptor(udev, type, index, buf, size); + else + return -ENOFILE; +} + +int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if (_usb_bulk_write) + return _usb_bulk_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if (_usb_bulk_read) + return _usb_bulk_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if (_usb_interrupt_write) + return _usb_interrupt_write(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + if (_usb_interrupt_read) + return _usb_interrupt_read(dev, ep, bytes, size, timeout); + else + return -ENOFILE; +} + +int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout) +{ + if (_usb_control_msg) + return _usb_control_msg(dev, requesttype, request, value, index, bytes, + size, timeout); + else + return -ENOFILE; +} + +int usb_set_configuration(usb_dev_handle *dev, int configuration) +{ + if (_usb_set_configuration) + return _usb_set_configuration(dev, configuration); + else + return -ENOFILE; +} + +int usb_claim_interface(usb_dev_handle *dev, int interface) +{ + if (_usb_claim_interface) + return _usb_claim_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_release_interface(usb_dev_handle *dev, int interface) +{ + if (_usb_release_interface) + return _usb_release_interface(dev, interface); + else + return -ENOFILE; +} + +int usb_set_altinterface(usb_dev_handle *dev, int alternate) +{ + if (_usb_set_altinterface) + return _usb_set_altinterface(dev, alternate); + else + return -ENOFILE; +} + +int usb_resetep(usb_dev_handle *dev, unsigned int ep) +{ + if (_usb_resetep) + return _usb_resetep(dev, ep); + else + return -ENOFILE; +} + +int usb_clear_halt(usb_dev_handle *dev, unsigned int ep) +{ + if (_usb_clear_halt) + return _usb_clear_halt(dev, ep); + else + return -ENOFILE; +} + +int usb_reset(usb_dev_handle *dev) +{ + if (_usb_reset) + return _usb_reset(dev); + else + return -ENOFILE; +} + +char *usb_strerror(void) +{ + if (_usb_strerror) + return _usb_strerror(); + else + return NULL; +} + +void usb_set_debug(int level) +{ + if (_usb_set_debug) + return _usb_set_debug(level); +} + +int usb_find_busses(void) +{ + if (_usb_find_busses) + return _usb_find_busses(); + else + return -ENOFILE; +} + +int usb_find_devices(void) +{ + if (_usb_find_devices) + return _usb_find_devices(); + else + return -ENOFILE; +} + +struct usb_device *usb_device(usb_dev_handle *dev) +{ + if (_usb_device) + return _usb_device(dev); + else + return NULL; +} + +struct usb_bus *usb_get_busses(void) +{ + if (_usb_get_busses) + return _usb_get_busses(); + else + return NULL; +} + +int usb_install_service_np(void) +{ + if (_usb_install_service_np) + return _usb_install_service_np(); + else + return -ENOFILE; +} + +int usb_uninstall_service_np(void) +{ + if (_usb_uninstall_service_np) + return _usb_uninstall_service_np(); + else + return -ENOFILE; +} + +int usb_install_driver_np(const char *inf_file) +{ + if (_usb_install_driver_np) + return _usb_install_driver_np(inf_file); + else + return -ENOFILE; +} + +const struct usb_version *usb_get_version(void) +{ + if (_usb_get_version) + return _usb_get_version(); + else + return NULL; +} + +int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize) +{ + if (_usb_isochronous_setup_async) + return _usb_isochronous_setup_async(dev, context, ep, pktsize); + else + return -ENOFILE; +} + +int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if (_usb_bulk_setup_async) + return _usb_bulk_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if (_usb_interrupt_setup_async) + return _usb_interrupt_setup_async(dev, context, ep); + else + return -ENOFILE; +} + +int usb_submit_async(void *context, char *bytes, int size) +{ + if (_usb_submit_async) + return _usb_submit_async(context, bytes, size); + else + return -ENOFILE; +} + +int usb_reap_async(void *context, int timeout) +{ + if (_usb_reap_async) + return _usb_reap_async(context, timeout); + else + return -ENOFILE; +} + +int usb_free_async(void **context) +{ + if (_usb_free_async) + return _usb_free_async(context); + else + return -ENOFILE; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.c new file mode 100644 index 0000000..a9781ea --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.c @@ -0,0 +1,1651 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2005 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + +#include +#include +#include +#include +#include + +#ifdef __GNUC__ +#if defined(_WIN64) +#include +#else +#include +#endif +#else +#include +#define strlwr(p) _strlwr(p) +#endif + +#include "registry.h" +#include "error.h" + +#define CLASS_KEY_PATH_NT "SYSTEM\\CurrentControlSet\\Control\\Class\\" +#define CLASS_KEY_PATH_9X "SYSTEM\\CurrentControlSet\\Services\\Class\\" + +#define USB_GET_DRIVER_NAME() \ + usb_registry_is_nt() ? driver_name_nt : driver_name_9x; + +#define DISP_CLASS(FilterClass) (strlen(FilterClass->class_name) ? FilterClass->class_name : FilterClass->class_guid) + +static const char *driver_name_nt = "libusb0"; +static const char *driver_name_9x = "libusb0.sys"; + +static const char *default_class_keys_nt[] = +{ + /* USB devices */ + "{36fc9e60-c465-11cf-8056-444553540000}", + /* HID devices */ + "{745a17a0-74d3-11d0-b6fe-00a0c90f57da}", + /* Network devices */ + "{4d36e972-e325-11ce-bfc1-08002be10318}", + /* Image devices */ + "{6bdd1fc6-810f-11d0-bec7-08002be2092f}", + /* Media devices */ + "{4d36e96c-e325-11ce-bfc1-08002be10318}", + /* Modem devices */ + "{4d36e96d-e325-11ce-bfc1-08002be10318}", + /* SmartCardReader devices*/ + "{50dd5230-ba8a-11d1-bf5d-0000f805f530}", + NULL +}; + +static bool_t usb_registry_set_device_state(DWORD state, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data); + +static bool_t usb_registry_get_filter_device_keys(filter_class_t* filter_class, + HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + filter_device_t** found); + +static bool_t usb_registry_get_class_filter_keys(filter_class_t* filter_class, + HKEY reg_class_hkey); + +bool_t usb_registry_is_nt(void) +{ + return GetVersion() < 0x80000000 ? TRUE : FALSE; +} + +bool_t usb_registry_get_property(DWORD which, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char *buf, int size) +{ + DWORD reg_type; + DWORD length = size; + char *p = NULL; + HKEY reg_key = NULL; + + memset(buf, 0, size); + + if (!SetupDiGetDeviceRegistryProperty(dev_info, dev_info_data, which, + ®_type, (BYTE *)buf, size, &length)) + { + return FALSE; + } + + return TRUE; +} + +bool_t usb_registry_mz_to_sz(char* buf_mz, char new_separator) +{ + bool_t success = FALSE; + + while (buf_mz && *buf_mz) + { + success = TRUE; + buf_mz += strlen(buf_mz); + + if (buf_mz[1]) + *buf_mz = new_separator; + + buf_mz++; + } + return success; +} + +bool_t usb_registry_set_property(DWORD which, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char *buf, int size) +{ + char *val_name = NULL; + char *p = NULL; + HKEY reg_key; + DWORD reg_type; + + switch (which) + { + case SPDRP_LOWERFILTERS: + reg_type = usb_registry_is_nt() ? REG_MULTI_SZ : REG_SZ; + val_name = "LowerFilters"; + break; + case SPDRP_UPPERFILTERS: + reg_type = usb_registry_is_nt() ? REG_MULTI_SZ : REG_SZ; + val_name = "UpperFilters"; + break; + default: + return 0; + } + + if (usb_registry_is_nt()) + { + if (size > 2) + { + if (!SetupDiSetDeviceRegistryProperty(dev_info, dev_info_data, + which, (BYTE *)buf, size)) + { + USBERR("setting property '%s' failed", val_name); + return FALSE; + } + } + else + { + if (!SetupDiSetDeviceRegistryProperty(dev_info, dev_info_data, + which, NULL, 0)) + { + USBERR("deleting property '%s' failed", val_name); + return FALSE; + } + } + } + else + { + p = buf; + + while (*p) + { + if (*p == ',') + { + *p = 0; + } + p += (strlen(p) + 1); + } + + reg_key = SetupDiOpenDevRegKey(dev_info, dev_info_data, + DICS_FLAG_GLOBAL, + 0, DIREG_DEV, KEY_ALL_ACCESS); + + if (reg_key == INVALID_HANDLE_VALUE) + { + USBERR0("reading registry key failed\n"); + return FALSE; + } + + if (size > 3) + { + if (RegSetValueEx(reg_key, val_name, 0, reg_type, (BYTE *)buf, + size) != ERROR_SUCCESS) + { + USBERR("setting property '%s' failed", val_name); + RegCloseKey(reg_key); + return FALSE; + } + } + else + { + if (RegDeleteValue(reg_key, val_name) != ERROR_SUCCESS) + { + USBERR("deleting property '%s' failed", val_name); + RegCloseKey(reg_key); + return FALSE; + } + } + RegCloseKey(reg_key); + } + + return TRUE; +} + +bool_t usb_registry_insert_class_filter(filter_context_t* filter_context) +{ + const char *driver_name; + filter_class_t *key; + char buf[MAX_PATH]; + + driver_name = USB_GET_DRIVER_NAME(); + + if (!filter_context->class_filters) + { + return TRUE; + } + + key = filter_context->class_filters; + + while (key) + { + if (usb_registry_get_mz_value(key->name, "UpperFilters", + buf, sizeof(buf))) + { + if (usb_registry_mz_string_find(buf, driver_name, TRUE)) + { + key = key->next; + continue; + } + } + + USBMSG("inserting class filter %s..\n", DISP_CLASS(key)); + + + usb_registry_mz_string_insert(buf, driver_name); + + if (!usb_registry_set_mz_value(key->name, "UpperFilters", buf, + usb_registry_mz_string_size(buf))) + { + USBERR0("unable to set registry value\n"); + } + else + { + key->action = FT_CLASS_UPPERFILTER; + filter_context->class_filters_modified = TRUE; + } + + key = key->next; + } + + return TRUE; +} + +bool_t usb_registry_remove_class_filter(filter_context_t* filter_context) +{ + const char *driver_name; + filter_class_t *key; + char buf[MAX_PATH]; + + driver_name = USB_GET_DRIVER_NAME(); + + if (!filter_context->class_filters) + { + return TRUE; + } + + key = filter_context->class_filters; + + while (key) + { + if (usb_registry_get_mz_value(key->name, "UpperFilters", + buf, sizeof(buf))) + { + if (usb_registry_mz_string_find(buf, driver_name, TRUE)) + { + key->action = FT_CLASS_UPPERFILTER; + filter_context->class_filters_modified = TRUE; + + USBMSG("removing class filter %s..\n", DISP_CLASS(key)); + usb_registry_mz_string_remove(buf, driver_name, TRUE); + + if (!usb_registry_set_mz_value(key->name, "UpperFilters", buf, usb_registry_mz_string_size(buf))) + { + USBERR("failed removing class filter %s..\n", DISP_CLASS(key)); + } + else + { + key->action = FT_CLASS_UPPERFILTER; + filter_context->class_filters_modified = TRUE; + } + } + } + + key = key->next; + } + + return TRUE; +} + +bool_t usb_registry_remove_device_filter(filter_context_t* filter_context) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + char filters[MAX_PATH]; + char hwid[MAX_PATH]; + const char *driver_name; + bool_t remove_device_filters; + + driver_name = USB_GET_DRIVER_NAME(); + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_index = 0; + + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, DIGCF_ALLCLASSES); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return FALSE; + } + + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (usb_registry_get_hardware_id(dev_info, &dev_info_data, hwid)) + { + if (filter_context->remove_all_device_filters) + { + // remove all device upper/lower filters. + remove_device_filters = TRUE; + } + else if (usb_registry_match_filter_device(&filter_context->device_filters, dev_info, &dev_info_data)) + { + // if not, remove only the ones specified by the user. + remove_device_filters = TRUE; + } + else + { + // skip device filter removal for this device. + remove_device_filters = FALSE; + } + + if (remove_device_filters) + { + /* remove libusb as a device upper filter */ + if (usb_registry_get_property(SPDRP_UPPERFILTERS, dev_info, + &dev_info_data, + filters, sizeof(filters))) + { + if (usb_registry_mz_string_find(filters, driver_name, TRUE)) + { + int size; + USBMSG("removing device upper filter %s..\n", hwid+4); + + usb_registry_mz_string_remove(filters, driver_name, TRUE); + size = usb_registry_mz_string_size(filters); + + usb_registry_set_property(SPDRP_UPPERFILTERS, dev_info, + &dev_info_data, filters, size); + + if (!filter_context->class_filters) + { + USBMSG("restarting device %s..\n", hwid+4); + usb_registry_restart_device(dev_info, &dev_info_data); + } + } + } + + /* remove libusb as a device lower filter */ + if (usb_registry_get_property(SPDRP_LOWERFILTERS, dev_info, + &dev_info_data, + filters, sizeof(filters))) + { + if (usb_registry_mz_string_find(filters, driver_name, TRUE)) + { + int size; + USBMSG("removing device lower filter %s..\n", hwid+4); + usb_registry_mz_string_remove(filters, driver_name, TRUE); + size = usb_registry_mz_string_size(filters); + + usb_registry_set_property(SPDRP_LOWERFILTERS, dev_info, + &dev_info_data, filters, size); + + if (!filter_context->class_filters) + { + USBMSG("restarting device %s..\n", hwid+4); + usb_registry_restart_device(dev_info, &dev_info_data); + } + } + } + } + } + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + return TRUE; +} + +bool_t usb_registry_fill_filter_hwid(const char* hwid, filter_hwid_t* filter_hwid) +{ + const char* hwid_part; + + if ((hwid_part = strstr(hwid, "vid_"))) + sscanf(hwid_part,"vid_%04x",&filter_hwid->vid); + else + filter_hwid->vid = -1; + + if ((hwid_part = strstr(hwid, "pid_"))) + sscanf(hwid_part,"pid_%04x",&filter_hwid->pid); + else + filter_hwid->pid = -1; + + if ((hwid_part = strstr(hwid, "mi_"))) + sscanf(hwid_part,"mi_%02x",&filter_hwid->mi); + else + filter_hwid->mi = -1; + + if ((hwid_part = strstr(hwid, "rev_"))) + sscanf(hwid_part,"rev_%04u",&filter_hwid->rev); + else + filter_hwid->rev = -1; + + return (filter_hwid->vid != -1 && filter_hwid->pid != -1); +} + +filter_device_t* usb_registry_match_filter_device(filter_device_t** head, + HDEVINFO dev_info, PSP_DEVINFO_DATA dev_info_data) +{ + filter_device_t* p = *head; + char devid[MAX_PATH]; + char hwid[MAX_PATH]; + char hwid_find[MAX_PATH]; + filter_hwid_t find_hwid; + filter_hwid_t search_hwid; + + if (CM_Get_Device_ID(dev_info_data->DevInst, devid, sizeof(devid), 0) != CR_SUCCESS) + { + USBERR0("failed getting device id\n"); + return NULL; + } + + if (!usb_registry_get_hardware_id(dev_info, dev_info_data, hwid)) + { + USBERR0("failed getting device id\n"); + return NULL; + } + + _strlwr(hwid); + if (!usb_registry_fill_filter_hwid(hwid, &find_hwid)) + return NULL; + + while(p) + { + if (strlen(p->device_id)) + { + // matching on device instance id + if (_stricmp(devid, p->device_id) == 0) + { + // found a match + return p; + } + } + else + { + // matching on id parts + strcpy(hwid_find, p->device_hwid); + _strlwr(hwid_find); + if (usb_registry_fill_filter_hwid(hwid_find, &search_hwid)) + { + if (find_hwid.vid == search_hwid.vid && + find_hwid.pid == search_hwid.pid && + ((search_hwid.mi == -1) || (find_hwid.mi == search_hwid.mi)) && + ((search_hwid.rev == -1) || (find_hwid.rev == search_hwid.rev))) + { + return p; + } + } + } + p = p->next; + } + + return NULL; +} + +bool_t usb_registry_remove_device_regvalue(HDEVINFO dev_info, SP_DEVINFO_DATA *dev_info_data, const char* key_name) +{ + HKEY reg_key; + reg_key = SetupDiOpenDevRegKey(dev_info, dev_info_data, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_ALL_ACCESS); + if (reg_key) + { + if (RegDeleteValueA(reg_key, key_name) == ERROR_SUCCESS) + { + USBMSG("removed %s from device registry..\n", key_name); + RegCloseKey(reg_key); + return TRUE; + } + RegCloseKey(reg_key); + } + return FALSE; +} + +bool_t usb_registry_insert_device_filter(filter_context_t* filter_context, char* hwid, bool_t upper, + HDEVINFO dev_info, SP_DEVINFO_DATA *dev_info_data) +{ + + const char *driver_name; + DWORD spdrp_filters; + char filters[MAX_PATH]; + int size; + + driver_name = USB_GET_DRIVER_NAME(); + spdrp_filters = upper ? SPDRP_UPPERFILTERS : SPDRP_LOWERFILTERS; + + if (usb_registry_get_property(spdrp_filters, dev_info, dev_info_data, filters, sizeof(filters))) + { + if (usb_registry_mz_string_find(filters, driver_name, TRUE)) + { + if (usb_registry_remove_device_regvalue(dev_info, dev_info_data, "SurpriseRemovalOK")) + { + if (!filter_context->class_filters) + { + USBMSG("restarting device %s..\n", hwid+4); + usb_registry_restart_device(dev_info, dev_info_data); + } + } + return TRUE; + } + } + USBMSG("inserting device %s filter %s..\n", + upper ? "upper" : "lower", hwid+4); + + if(usb_registry_mz_string_insert(filters, driver_name)) + { + size = usb_registry_mz_string_size(filters); + if (usb_registry_set_property(spdrp_filters, dev_info, dev_info_data, filters, size)) + { + usb_registry_remove_device_regvalue(dev_info, dev_info_data, "SurpriseRemovalOK"); + + if (!filter_context->class_filters) + { + USBMSG("restarting device %s..\n", hwid+4); + usb_registry_restart_device(dev_info, dev_info_data); + } + return TRUE; + } + } + + return FALSE; +} + +bool_t usb_registry_insert_device_filters(filter_context_t* filter_context) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + char hwid[MAX_PATH]; + const char *driver_name; + filter_device_t* found; + bool_t is_libusb_service; + + if (!filter_context->device_filters) + return TRUE; + + driver_name = USB_GET_DRIVER_NAME(); + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_index = 0; + + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, DIGCF_ALLCLASSES); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return FALSE; + } + + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (usb_registry_is_service_or_filter_libusb(dev_info, &dev_info_data, &is_libusb_service)) + { + if (!is_libusb_service) + { + if (usb_registry_get_property(SPDRP_HARDWAREID, dev_info, &dev_info_data, hwid, MAX_PATH)) + { + if ((found=usb_registry_match_filter_device(&filter_context->device_filters, dev_info, &dev_info_data))) + { + if (!usb_registry_get_property(SPDRP_DEVICEDESC, dev_info, + &dev_info_data, + found->device_name, sizeof(found->device_name))) + { + USBWRN0("unable to get SPDRP_DEVICEDESC\n"); + } + if (!usb_registry_get_property(SPDRP_MFG, dev_info, + &dev_info_data, + found->device_mfg, sizeof(found->device_mfg))) + { + USBWRN0("unable to get SPDRP_MFG\n"); + } + + if (found->action & FT_DEVICE_UPPERFILTER) + { + if (!usb_registry_insert_device_filter(filter_context, hwid, TRUE, dev_info, &dev_info_data)) + { + USBERR("failed adding upper device filter for %s\n",found->device_hwid); + } + } + if (found->action & FT_DEVICE_LOWERFILTER) + { + if (!usb_registry_insert_device_filter(filter_context, hwid, FALSE, dev_info, &dev_info_data)) + { + USBERR("failed adding lower device filter for %s\n",found->device_hwid); + } + } + } + } + } + } + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + return TRUE; +} +static bool_t usb_registry_set_device_state(DWORD state, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data) +{ + SP_PROPCHANGE_PARAMS prop_params; + + memset(&prop_params, 0, sizeof(SP_PROPCHANGE_PARAMS)); + + prop_params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER); + prop_params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE; + prop_params.StateChange = state; + prop_params.Scope = DICS_FLAG_CONFIGSPECIFIC;//DICS_FLAG_GLOBAL; + prop_params.HwProfile = 0; + + + if (!SetupDiSetClassInstallParams(dev_info, dev_info_data, + (SP_CLASSINSTALL_HEADER *)&prop_params, + sizeof(SP_PROPCHANGE_PARAMS))) + { + USBERR0("setting class install parameters failed\n"); + return FALSE; + } + + + if (!SetupDiCallClassInstaller(DIF_PROPERTYCHANGE, dev_info, dev_info_data)) + { + USBERR0("calling class installer failed\n"); + return FALSE; + } + + return TRUE; +} + +bool_t usb_registry_restart_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data) +{ + return usb_registry_set_device_state(DICS_PROPCHANGE, dev_info, + dev_info_data); +} + +bool_t usb_registry_stop_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data) +{ + return usb_registry_set_device_state(DICS_DISABLE, dev_info, + dev_info_data); +} + +bool_t usb_registry_start_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data) +{ + return usb_registry_set_device_state(DICS_ENABLE, dev_info, + dev_info_data); +} + +bool_t usb_registry_get_device_filter_type(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + filter_type_e* filter_type) +{ + char filters[MAX_PATH]; + const char* driver_name; + + *filter_type = FT_NONE; + driver_name = USB_GET_DRIVER_NAME(); + + if (usb_registry_get_property(SPDRP_UPPERFILTERS, dev_info, + dev_info_data, + filters, sizeof(filters))) + { + if (usb_registry_mz_string_find(filters, driver_name, TRUE)) + { + *filter_type |= FT_DEVICE_UPPERFILTER; + } + } + + if (usb_registry_get_property(SPDRP_LOWERFILTERS, dev_info, + dev_info_data, + filters, sizeof(filters))) + { + if (usb_registry_mz_string_find(filters, driver_name, TRUE)) + { + *filter_type |= FT_DEVICE_LOWERFILTER; + } + } + + return TRUE; +} + +bool_t usb_registry_is_service_libusb(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + bool_t* is_libusb_service) +{ + char service_name[MAX_PATH]; + const char* driver_name; + + driver_name = USB_GET_DRIVER_NAME(); + *is_libusb_service = FALSE; + if (!usb_registry_get_property(SPDRP_SERVICE, dev_info, dev_info_data, + service_name, sizeof(service_name))) + { + return FALSE; + } + + if (_stricmp(service_name, driver_name)==0) + { + *is_libusb_service = TRUE; + } + + return TRUE; +} + +bool_t usb_registry_is_service_or_filter_libusb(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + bool_t* is_libusb_service) +{ + char service_name[MAX_PATH]; + const char* driver_name; + filter_type_e filter_type; + + driver_name = USB_GET_DRIVER_NAME(); + *is_libusb_service = FALSE; + if (!usb_registry_get_property(SPDRP_SERVICE, dev_info, dev_info_data, + service_name, sizeof(service_name))) + { + return FALSE; + } + + if (_stricmp(service_name, driver_name)==0) + { + *is_libusb_service = TRUE; + } + else if ((usb_registry_get_device_filter_type(dev_info, dev_info_data, &filter_type)) && filter_type != FT_NONE) + { + *is_libusb_service = TRUE; + } + + return TRUE; +} + +void usb_registry_stop_libusb_devices(void) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + bool_t is_libusb_service; + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_index = 0; + + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, + DIGCF_ALLCLASSES | DIGCF_PRESENT); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return; + } + + USBMSG0("stopping devices..\n"); + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (usb_registry_is_service_libusb(dev_info, &dev_info_data, &is_libusb_service)) + { + if (is_libusb_service) + { + usb_registry_stop_device(dev_info, &dev_info_data); + } + } + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); +} + +void usb_registry_start_libusb_devices(void) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + bool_t is_libusb_service; + + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_index = 0; + + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, + DIGCF_ALLCLASSES | DIGCF_PRESENT); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return; + } + + USBMSG0("starting devices..\n"); + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (usb_registry_is_service_libusb(dev_info, &dev_info_data, &is_libusb_service)) + { + if (is_libusb_service) + { + usb_registry_start_device(dev_info, &dev_info_data); + } + } + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); +} + +bool_t usb_registry_get_hardware_id(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char* max_path_buffer) +{ + if (!usb_registry_get_property(SPDRP_HARDWAREID, dev_info, dev_info_data, + max_path_buffer, MAX_PATH-1)) + { + USBWRN0("failed\n"); + return FALSE; + } + max_path_buffer[MAX_PATH-1]='\0'; + return TRUE; +} + +bool_t usb_registry_get_mz_value(const char *key, const char *value, + char *buf, int size) +{ + HKEY reg_key = NULL; + DWORD reg_type; + DWORD reg_length = size; + bool_t ret = FALSE; + char *p; + + memset(buf, 0, size); + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_ALL_ACCESS, ®_key) + == ERROR_SUCCESS) + { + if (RegQueryValueEx(reg_key, value, NULL, ®_type, + buf, ®_length) == ERROR_SUCCESS) + { + if (reg_type == REG_SZ) + { + p = buf; + while (*p) + { + if (*p == ',') + { + *p = 0; + } + p++; + } + } + + ret = TRUE; + } + } + + if (reg_key) + { + RegCloseKey(reg_key); + } + + return ret; +} + + +bool_t usb_registry_set_mz_value(const char *key, const char *value, + char *buf, int size) +{ + HKEY reg_key = NULL; + bool_t ret = FALSE; + char *p; + + /* convert REG_MULTI_SZ to REG_SZ */ + if (!usb_registry_is_nt()) + { + p = buf; + + while (*p && *(p + 1)) + { + if (*p == 0) + { + *p = ','; + } + p++; + } + } + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_ALL_ACCESS, ®_key) + == ERROR_SUCCESS) + { + if (size > 2) + { + if (usb_registry_is_nt()) + { + if (RegSetValueEx(reg_key, value, 0, REG_MULTI_SZ, buf, size) + == ERROR_SUCCESS) + { + ret = TRUE; + } + } + else + { + if (RegSetValueEx(reg_key, value, 0, REG_SZ, buf, size) + == ERROR_SUCCESS) + { + ret = TRUE; + } + } + } + else + { + if (RegDeleteValue(reg_key, value) == ERROR_SUCCESS) + { + ret = TRUE; + } + } + } + + if (reg_key) + { + RegCloseKey(reg_key); + } + + return ret; +} + +int usb_registry_mz_string_size(const char *src) +{ + char *p = (char *)src; + + if (!src) + { + return 0; + } + + while (*p) + { + p += (strlen(p) + 1); + } + + return (int)(p - src) + 1; +} + +char *usb_registry_mz_string_find_sub(const char *src, const char *str) +{ + while (*src) + { + if (strstr(src, str)) + { + return (char *)src; + } + src += (strlen(src) + 1); + } + + return NULL; +} + +char *usb_registry_mz_string_find(const char *src, const char *str, bool_t no_case) +{ + int ret; + while (*src) + { + if (no_case) + { + ret = _stricmp(src, str); + } + else + { + ret = strcmp(src, str); + } + if (!ret) + { + return (char *)src; + } + src += strlen(src) + 1; + } + + return NULL; +} + +bool_t usb_registry_mz_string_insert(char *src, const char *str) +{ + while (*src) + { + src += (strlen(src) + 1); + } + + memcpy(src, str, strlen(str)); + + src += strlen(str); + + *src = 0; + *(src + 1) = 0; + + return TRUE; +} + +bool_t usb_registry_mz_string_remove(char *src, const char *str, bool_t no_case) +{ + char *p; + bool_t ret = FALSE; + int size; + + do + { + src = usb_registry_mz_string_find(src, str, no_case); + + if (!src) + { + break; + } + else + { + ret = TRUE; + } + + p = src; + size = 0; + + while (*p) + { + p += strlen(p) + 1; + size += (long)(strlen(p) + 1); + } + + memmove(src, src + strlen(src) + 1, size); + + } + while (1); + + return TRUE; +} + +void usb_registry_mz_string_lower(char *src) +{ + while (*src) + { + strlwr(src); + src += (strlen(src) + 1); + } +} + +bool_t usb_registry_restart_all_devices(void) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index; + char id[MAX_PATH]; + int hub_index = 0; + + dev_index = 0; + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, + DIGCF_ALLCLASSES | DIGCF_PRESENT); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return FALSE; + } + + USBMSG0("restarting devices..\n"); + + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (!usb_registry_get_hardware_id(dev_info, &dev_info_data, id)) + { + dev_index++; + continue; + } + usb_registry_mz_string_lower(id); + + /* restart root hubs */ + if (usb_registry_mz_string_find_sub(id, "root_hub")) + { + USBMSG("restarting root hub #%d..\n",++hub_index); + usb_registry_restart_device(dev_info, &dev_info_data); + } + + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + + return TRUE; +} + +bool_t usb_registry_add_filter_device_keys(filter_device_t** head, + const char* id, + const char* hwid, + const char* name, + const char* mfg, + const char* uppers_mz, + const char* lowers_mz, + filter_device_t** found) +{ + filter_device_t *p = *head; + *found = NULL; + + while (p) + { + if (strlen(id)) + { + if (_stricmp(p->device_id, id)==0) + { + *found = p; + break; + } + } + p = p->next; + } + + if (!(*found)) + { + p = malloc(sizeof(filter_device_t)); + if (!p) + return FALSE; + + memset(p, 0, sizeof(filter_device_t)); + + *found = p; + p->next = *head; + *head = p; + } + + strcpy(p->device_id, id); + strcpy(p->device_hwid, hwid); + + if (strlen(name)) + strcpy(p->device_name, name); + + if (strlen(mfg)) + strcpy(p->device_mfg, mfg); + + if (strlen(uppers_mz)) + memcpy(p->device_uppers, uppers_mz, (size_t)usb_registry_mz_string_size(uppers_mz)); + + if (strlen(lowers_mz)) + memcpy(p->device_lowers, lowers_mz, (size_t)usb_registry_mz_string_size(lowers_mz)); + + return TRUE; +} + +bool_t usb_registry_add_filter_file_keys(filter_file_t** head, + const char* name, + filter_file_t** found) +{ + filter_file_t *p = *head; + *found = NULL; + + while (p) + { + if (_stricmp(p->name, name)==0) + { + *found = p; + return TRUE; + } + p = p->next; + } + + p = malloc(sizeof(filter_file_t)); + + if (!p) + return FALSE; + + memset(p, 0, sizeof(filter_file_t)); + + strcpy(p->name, name); + + *found = p; + p->next = *head; + *head = p; + + return TRUE; +} + +static bool_t usb_registry_get_filter_device_keys(filter_class_t* filter_class, + HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + filter_device_t** found) +{ + + char id[MAX_PATH]; + char hwid[MAX_PATH]; + char name[MAX_PATH]; + char mfg[MAX_PATH]; + char lowers_mz[MAX_PATH]; + char uppers_mz[MAX_PATH]; + + *found = NULL; + if (dev_info && filter_class) + { + if (CM_Get_Device_ID(dev_info_data->DevInst, id, sizeof(id), 0) != CR_SUCCESS) + { + USBWRN0("unable to get device instance id\n"); + return FALSE; + } + + if (!usb_registry_get_property(SPDRP_HARDWAREID, dev_info, + dev_info_data, + hwid, sizeof(hwid))) + { + USBWRN0("unable to get SPDRP_HARDWAREID\n"); + return FALSE; + } + + if (!usb_registry_get_property(SPDRP_DEVICEDESC, dev_info, + dev_info_data, + name, sizeof(name))) + { + USBWRN0("unable to get SPDRP_DEVICEDESC\n"); + } + if (!usb_registry_get_property(SPDRP_MFG, dev_info, + dev_info_data, + mfg, sizeof(mfg))) + { + USBWRN0("unable to get SPDRP_MFG\n"); + } + + usb_registry_get_property(SPDRP_UPPERFILTERS, dev_info, dev_info_data, uppers_mz, sizeof(uppers_mz)); + usb_registry_get_property(SPDRP_LOWERFILTERS, dev_info, dev_info_data, lowers_mz, sizeof(lowers_mz)); + + return usb_registry_add_filter_device_keys(&filter_class->class_filter_devices, + id, hwid, name, mfg, uppers_mz, lowers_mz, found); + } + + return FALSE; +} +bool_t usb_registry_add_usb_class_key(filter_context_t* filter_context, const char* class_guid) +{ + char tmp[MAX_PATH]; + const char *class_path = CLASS_KEY_PATH_NT; + filter_class_t* found = NULL; + + if ((strlen(class_path) + strlen(class_guid)) < sizeof(tmp)) + { + sprintf(tmp, "%s%s", class_path, class_guid); + return usb_registry_add_class_key(&filter_context->class_filters, tmp, "", class_guid, &found, FALSE); + } + return FALSE; +} + +bool_t usb_registry_get_usb_class_keys(filter_context_t* filter_context, bool_t refresh_only) +{ + HDEVINFO dev_info; + SP_DEVINFO_DATA dev_info_data; + int dev_index = 0; + int i; + char class[MAX_PATH]; + char class_name[MAX_PATH]; + char tmp[MAX_PATH]; + DWORD class_property; + const char *class_path; + const char **default_class_keys; + filter_class_t* found = NULL; + filter_device_t* found_device = NULL; + bool_t is_libusb_service; + bool_t add_device_classes = FALSE; + bool_t success; + + class_property = SPDRP_CLASSGUID; + class_path = CLASS_KEY_PATH_NT; + default_class_keys = default_class_keys_nt; + i = 0; + + if (filter_context->switches.add_default_classes) + { + while (default_class_keys[i]) + { + if ((strlen(class_path) + strlen(default_class_keys[i])) < sizeof(tmp)) + { + sprintf(tmp, "%s%s", class_path, default_class_keys[i]); + usb_registry_add_class_key(&filter_context->class_filters, tmp, "", default_class_keys[i], &found, FALSE); + } + i++; + } + } + if (filter_context->filter_mode == FM_INSTALL) + add_device_classes = filter_context->switches.add_device_classes | filter_context->switches.add_all_classes; + else if (filter_context->filter_mode == FM_LIST) + add_device_classes = filter_context->switches.add_device_classes; + else if (filter_context->filter_mode == FM_REMOVE) + return TRUE; + + if (add_device_classes || refresh_only) + { + dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); + dev_info = SetupDiGetClassDevs(NULL, "USB", NULL, + DIGCF_ALLCLASSES); + + if (dev_info == INVALID_HANDLE_VALUE) + { + USBERR0("getting device info set failed\n"); + return FALSE; + } + + while (SetupDiEnumDeviceInfo(dev_info, dev_index, &dev_info_data)) + { + if (filter_context->filter_mode == FM_INSTALL) + success = usb_registry_is_service_or_filter_libusb(dev_info, &dev_info_data, &is_libusb_service); + else + success = usb_registry_is_service_libusb(dev_info, &dev_info_data, &is_libusb_service); + + if (success) + { + if (!is_libusb_service) + { + if (!usb_registry_get_property(SPDRP_CLASSGUID, dev_info, &dev_info_data, class, sizeof(class))) + { + dev_index++; + continue; + } + + strlwr(class); + + usb_registry_get_property(SPDRP_CLASS, dev_info, &dev_info_data, class_name, sizeof(class_name)); + + if ((strlen(class_path) + strlen(class)) < sizeof(tmp)) + { + sprintf(tmp, "%s%s", class_path, class); + usb_registry_add_class_key(&filter_context->class_filters, tmp, class_name, class, &found, + (add_device_classes) ? FALSE : refresh_only); + + if (found) + { + usb_registry_get_filter_device_keys(found, dev_info, &dev_info_data, &found_device); + } + } + } + } + + dev_index++; + } + + SetupDiDestroyDeviceInfoList(dev_info); + } + + return TRUE; +} + +bool_t usb_registry_get_all_class_keys(filter_context_t* filter_context, bool_t refresh_only) +{ + const char *class_path; + HKEY reg_key, reg_class_key; + char class[MAX_PATH]; + char class_name[MAX_PATH]; + char tmp[MAX_PATH]; + filter_class_t* found = NULL; + DWORD reg_type; + bool_t add_all_classes = FALSE; + + switch(filter_context->filter_mode) + { + case FM_INSTALL: + add_all_classes = FALSE; + break; + case FM_REMOVE: + if (!refresh_only && (filter_context->switches.add_all_classes || filter_context->switches.add_device_classes)) + { + add_all_classes = TRUE; + } + break; + case FM_LIST: + add_all_classes = filter_context->switches.add_all_classes; + break; + } + + if (add_all_classes || refresh_only) + { + if (usb_registry_is_nt()) + { + class_path = CLASS_KEY_PATH_NT; + } + else + { + class_path = CLASS_KEY_PATH_9X; + } + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, class_path, 0, KEY_ALL_ACCESS, ®_key) == ERROR_SUCCESS) + { + DWORD i = 0; + DWORD size = sizeof(class); + FILETIME junk; + + memset(class, 0, sizeof(class)); + + while (RegEnumKeyEx(reg_key, i, class, &size, 0, NULL, NULL, &junk) == ERROR_SUCCESS) + { + strlwr(class); + + if ((strlen(class_path) + strlen(class)) < sizeof(tmp)) + { + memset(class_name,0,sizeof(class_name)); + sprintf(tmp, "%s%s", class_path, class); + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, tmp, 0, KEY_ALL_ACCESS, ®_class_key) == ERROR_SUCCESS) + { + size = sizeof(class_name); + RegQueryValueExA(reg_class_key, "Class", NULL, ®_type, class_name, &size); + + usb_registry_add_class_key(&filter_context->class_filters, tmp, class_name, class, &found, + (add_all_classes) ? FALSE : refresh_only); + + if (found) + { + usb_registry_get_class_filter_keys(found, reg_class_key); + } + RegCloseKey(reg_class_key); + } + } + + memset(class, 0, sizeof(class)); + size = sizeof(class); + i++; + } + + RegCloseKey(reg_key); + } + } + return TRUE; +} + +bool_t usb_registry_lookup_class_keys_by_name(filter_class_t** head) +{ + const char *class_path; + HKEY reg_key, reg_class_key; + char class[MAX_PATH]; + char class_name[MAX_PATH]; + char tmp[MAX_PATH]; + filter_class_t* found = NULL; + DWORD reg_type; + + if (usb_registry_is_nt()) + { + class_path = CLASS_KEY_PATH_NT; + } + else + { + class_path = CLASS_KEY_PATH_9X; + } + + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, class_path, 0, KEY_ALL_ACCESS, + ®_key) == ERROR_SUCCESS) + { + DWORD i = 0; + DWORD size = sizeof(class); + FILETIME junk; + + memset(class, 0, sizeof(class)); + + while (RegEnumKeyEx(reg_key, i, class, &size, 0, NULL, NULL, &junk) == ERROR_SUCCESS) + { + strlwr(class); + + if ((strlen(class_path) + strlen(class)) < sizeof(tmp)) + { + memset(class_name,0,sizeof(class_name)); + sprintf(tmp, "%s%s", class_path, class); + if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, tmp, 0, KEY_ALL_ACCESS, ®_class_key) == ERROR_SUCCESS) + { + size = sizeof(class_name); + RegQueryValueExA(reg_class_key, "Class", NULL, ®_type, class_name, &size); + RegCloseKey(reg_class_key); + + usb_registry_add_class_key(head, tmp, class_name, class, &found, TRUE); + } + } + + memset(class, 0, sizeof(class)); + size = sizeof(class); + i++; + } + + RegCloseKey(reg_key); + } + + return TRUE; +} + +bool_t usb_registry_add_class_key(filter_class_t **head, + const char *key, + const char *class_name, + const char *class_guid, + filter_class_t **found, + bool_t update_only) +{ + filter_class_t *p = *head; + *found = NULL; + if (key) + { + + if (strlen(key) >= MAX_PATH) + return FALSE; + + while (p) + { + if (!strlen(p->name)) + { + if (!_stricmp(p->class_name, class_name)) + { + *found = p; + } + } + else + { + if (!_stricmp(p->name, key)) + { + *found = p; + } + } + if (*found) + { + strcpy(p->name, key); + strcpy(p->class_guid, class_guid); + strcpy(p->class_name, class_name); + + return TRUE; + } + p = p->next; + } + + if (update_only) + return TRUE; + + p = malloc(sizeof(filter_class_t)); + + if (!p) + return FALSE; + + memset(p, 0, sizeof(filter_class_t)); + strcpy(p->name, key); + strcpy(p->class_guid, class_guid); + strcpy(p->class_name, class_name); + + *found = p; + p->next = *head; + *head = p; + + return TRUE; + } + + return FALSE; +} + +bool_t usb_registry_free_class_keys(filter_class_t **head) +{ + filter_class_t *p = *head; + filter_class_t *q; + + while (p) + { + q = p->next; + usb_registry_free_filter_devices(&p->class_filter_devices); + free(p); + p = q; + } + + *head = NULL; + + return TRUE; +} + +bool_t usb_registry_free_filter_files(filter_file_t **head) +{ + filter_file_t *p = *head; + filter_file_t *q; + + while (p) + { + q = p->next; + free(p); + p = q; + } + + *head = NULL; + + return TRUE; +} + +bool_t usb_registry_free_filter_devices(filter_device_t **head) +{ + filter_device_t *p = *head; + filter_device_t *q; + + while (p) + { + q = p->next; + free(p); + p = q; + } + + *head = NULL; + + return TRUE; +} + +static bool_t usb_registry_get_class_filter_keys(filter_class_t* filter_class, HKEY reg_class_hkey) +{ + DWORD reg_type; + DWORD size; + + // Get the class filters. A non-existent key means no filters + size = sizeof(filter_class->class_uppers) - 1; + if (RegQueryValueExA(reg_class_hkey, "UpperFilters", NULL, ®_type, filter_class->class_uppers, &size) != ERROR_SUCCESS) + { + memset(filter_class->class_uppers, 0, sizeof(filter_class->class_uppers)); + } + + size = sizeof(filter_class->class_lowers) - 1; + if (RegQueryValueExA(reg_class_hkey, "LowerFilters", NULL, ®_type, filter_class->class_lowers, &size) != ERROR_SUCCESS) + { + memset(filter_class->class_lowers, 0, sizeof(filter_class->class_lowers)); + } + return TRUE; +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.h new file mode 100644 index 0000000..7a37b79 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/registry.h @@ -0,0 +1,221 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2005 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + + + +#ifndef __USB_REGISTRY_H__ +#define __USB_REGISTRY_H__ + +#include +#include + + +#define LIBUSB_DRIVER_NAME_NT "libusb0" +#define LIBUSB_DRIVER_NAME_9X "libusb0.sys" + +typedef int bool_t; + +#ifndef FALSE +#define FALSE 0 +#endif +#ifndef TRUE +#define TRUE (!(FALSE)) +#endif + +#define REGISTRY_BUF_SIZE 512 + +typedef struct _filter_file_t filter_file_t; +struct _filter_file_t +{ + filter_file_t* next; + char name[MAX_PATH]; +}; + +typedef int filter_mode_e; +enum _filter_mode_e +{ + FM_NONE = 0, + FM_LIST = 1 << 0, + FM_INSTALL = 1 << 1, + FM_REMOVE = 1 << 2, +}; + +typedef int filter_type_e; +enum _filter_type_e +{ + FT_NONE = 0, + FT_CLASS_UPPERFILTER = 1 << 0, + FT_CLASS_LOWERFILTER = 1 << 1, + FT_DEVICE_UPPERFILTER = 1 << 2, + FT_DEVICE_LOWERFILTER = 1 << 3, +}; + +typedef struct _filter_hwid_t filter_hwid_t; +struct _filter_hwid_t +{ + int vid; + int pid; + int mi; + int rev; +}; + +typedef struct _filter_device_t filter_device_t; +struct _filter_device_t +{ + filter_device_t* next; + + char device_name[MAX_PATH]; + char device_hwid[MAX_PATH]; + char device_mfg[MAX_PATH]; + char device_uppers[MAX_PATH]; + char device_lowers[MAX_PATH]; + char device_id[MAX_PATH]; + + filter_type_e action; +}; + +typedef struct _filter_class_t filter_class_t; +struct _filter_class_t +{ + filter_class_t* next; + + char name[MAX_PATH]; // key + + char class_name[MAX_PATH]; + char class_guid[MAX_PATH]; + char class_uppers[MAX_PATH]; + char class_lowers[MAX_PATH]; + filter_device_t* class_filter_devices; + filter_type_e action; +}; + +typedef struct _filter_context_t filter_context_t; +struct _filter_context_t +{ + union + { + int switches_value; + struct + { + bool_t add_all_classes:1; + bool_t add_device_classes:1; + bool_t add_default_classes:1; + }; + }switches; + + filter_mode_e filter_mode; + filter_class_t* class_filters; + filter_device_t* device_filters; + filter_file_t* inf_files; + bool_t show_help_only; + bool_t remove_all_device_filters; + bool_t class_filters_modified; + char* prompt_string; + char* wait_string; +}; + +bool_t usb_registry_is_nt(void); + +bool_t usb_registry_restart_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data); +bool_t usb_registry_stop_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data); +bool_t usb_registry_start_device(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data); + +bool_t usb_registry_get_property(DWORD which, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char *buf, int size); +bool_t usb_registry_set_property(DWORD which, HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char *buf, int size); + +bool_t usb_registry_restart_all_devices(void); + + +void usb_registry_stop_libusb_devices(void); +void usb_registry_start_libusb_devices(void); + +bool_t usb_registry_get_mz_value(const char *key, const char *value, + char *buf, int size); +bool_t usb_registry_set_mz_value(const char *key, const char *value, + char *buf, int size); +int usb_registry_mz_string_size(const char *src); +char *usb_registry_mz_string_find(const char *src, const char *str, bool_t no_case); +char *usb_registry_mz_string_find_sub(const char *src, const char *str); +bool_t usb_registry_mz_string_insert(char *src, const char *str); +bool_t usb_registry_mz_string_remove(char *src, const char *str, bool_t no_case); +void usb_registry_mz_string_lower(char *src); + +bool_t usb_registry_get_hardware_id(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + char* max_path_buffer); +bool_t usb_registry_is_service_libusb(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + bool_t* is_libusb_service); +bool_t usb_registry_is_service_or_filter_libusb(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + bool_t* is_libusb_service); + +bool_t usb_registry_insert_class_filter(filter_context_t* filter_context); +bool_t usb_registry_remove_class_filter(filter_context_t* filter_context); +bool_t usb_registry_remove_device_filter(filter_context_t* filter_context); +bool_t usb_registry_free_class_keys(filter_class_t **head); +bool_t usb_registry_get_usb_class_keys(filter_context_t* filter_context, bool_t refresh_only); +bool_t usb_registry_get_all_class_keys(filter_context_t* filter_context, bool_t refresh_only); +bool_t usb_registry_get_device_filter_type(HDEVINFO dev_info, + SP_DEVINFO_DATA *dev_info_data, + filter_type_e* filter_type); + +bool_t usb_registry_add_usb_class_key(filter_context_t* filter_context, const char* class_guid); +bool_t usb_registry_add_filter_device_keys(filter_device_t** head, + const char* id, + const char* hwid, + const char* name, + const char* mfg, + const char* uppers_mz, + const char* lowers_mz, + filter_device_t** found); + +bool_t usb_registry_add_filter_file_keys(filter_file_t** head, + const char* name, + filter_file_t** found); + +bool_t usb_registry_lookup_class_keys_by_name(filter_class_t** head); +bool_t usb_registry_add_class_key(filter_class_t **head, + const char *key, + const char *class_name, + const char *class_guid, + filter_class_t **found, + bool_t update_only); + +bool_t usb_registry_insert_device_filters(filter_context_t* filter_context); +bool_t usb_registry_insert_device_filter(filter_context_t* filter_context, char* hwid, bool_t upper, + HDEVINFO dev_info, SP_DEVINFO_DATA *dev_info_data); + +bool_t usb_registry_free_filter_devices(filter_device_t **head); +bool_t usb_registry_free_filter_files(filter_file_t **head); + +filter_device_t* usb_registry_match_filter_device(filter_device_t** head, + HDEVINFO dev_info, PSP_DEVINFO_DATA dev_info_data); + +bool_t usb_registry_mz_to_sz(char* buf_mz, char separator); +bool_t usb_registry_fill_filter_hwid(const char* hwid, filter_hwid_t* filter_hwid); + +#endif diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/resource.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/resource.rc new file mode 100644 index 0000000..051e03e --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/resource.rc @@ -0,0 +1,26 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define RC_FILE_TYPE VFT_DLL +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "libusb-win32 - DLL" +#define RC_FILE_NAME_STR "libusb0.dll" + +#include "libusb-win32_version.rc" + + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.c new file mode 100644 index 0000000..86191c1 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.c @@ -0,0 +1,317 @@ +/* + * Main API entry point + * + * Copyright (c) 2000-2003 Johannes Erdfelt + * + * This library is covered by the LGPL, read LICENSE for details. + */ + +#include /* getenv */ +#include /* stderr */ +#include /* strcmp */ +#include + +#include "usbi.h" + +int usb_debug = 0; +struct usb_bus *_usb_busses = NULL; + +int usb_find_busses(void) +{ + struct usb_bus *busses, *bus; + int ret, changes = 0; + + ret = usb_os_find_busses(&busses); + if (ret < 0) + return ret; + + /* + * Now walk through all of the busses we know about and compare against + * this new list. Any duplicates will be removed from the new list. + * If we don't find it in the new list, the bus was removed. Any + * busses still in the new list, are new to us. + */ + bus = _usb_busses; + while (bus) + { + int found = 0; + struct usb_bus *nbus, *tbus = bus->next; + + nbus = busses; + while (nbus) + { + struct usb_bus *tnbus = nbus->next; + + if (!strcmp(bus->dirname, nbus->dirname)) + { + /* Remove it from the new busses list */ + LIST_DEL(busses, nbus); + + usb_free_bus(nbus); + found = 1; + break; + } + + nbus = tnbus; + } + + if (!found) + { + /* The bus was removed from the system */ + LIST_DEL(_usb_busses, bus); + usb_free_bus(bus); + changes++; + } + + bus = tbus; + } + + /* + * Anything on the *busses list is new. So add them to usb_busses and + * process them like the new bus it is. + */ + bus = busses; + while (bus) + { + struct usb_bus *tbus = bus->next; + + /* + * Remove it from the temporary list first and add it to the real + * usb_busses list. + */ + LIST_DEL(busses, bus); + + LIST_ADD(_usb_busses, bus); + + changes++; + + bus = tbus; + } + + return changes; +} + +int usb_find_devices(void) +{ + struct usb_bus *bus; + int ret, changes = 0; + + for (bus = usb_busses; bus; bus = bus->next) + { + struct usb_device *devices, *dev; + + /* Find all of the devices and put them into a temporary list */ + ret = usb_os_find_devices(bus, &devices); + if (ret < 0) + return ret; + + /* + * Now walk through all of the devices we know about and compare + * against this new list. Any duplicates will be removed from the new + * list. If we don't find it in the new list, the device was removed. + * Any devices still in the new list, are new to us. + */ + dev = bus->devices; + while (dev) + { + int found = 0; + struct usb_device *ndev, *tdev = dev->next; + + ndev = devices; + while (ndev) + { + struct usb_device *tndev = ndev->next; + + if (!strcmp(dev->filename, ndev->filename)) + { + /* Remove it from the new devices list */ + LIST_DEL(devices, ndev); + + usb_free_dev(ndev); + found = 1; + break; + } + + ndev = tndev; + } + + if (!found) + { + /* The device was removed from the system */ + LIST_DEL(bus->devices, dev); + usb_free_dev(dev); + changes++; + } + + dev = tdev; + } + + /* + * Anything on the *devices list is new. So add them to bus->devices and + * process them like the new device it is. + */ + dev = devices; + while (dev) + { + struct usb_device *tdev = dev->next; + + /* + * Remove it from the temporary list first and add it to the real + * bus->devices list. + */ + LIST_DEL(devices, dev); + + /* + * Some ports fetch the descriptors on scanning (like Linux) so we don't + * need to fetch them again. + */ + if (!dev->config) + { + usb_dev_handle *udev; + + udev = usb_open(dev); + if (udev) + { + usb_fetch_and_parse_descriptors(udev); + + usb_close(udev); + } + } + + // [ID:2928293 Tim Green] + // + if (dev->config) + { + LIST_ADD(bus->devices, dev); + changes++; + } + + dev = tdev; + } + + usb_os_determine_children(bus); + } + + return changes; +} + +void usb_init(void) +{ + if (getenv("USB_DEBUG")) + usb_set_debug(atoi(getenv("USB_DEBUG"))); + + usb_os_init(); +} + +usb_dev_handle *usb_open(struct usb_device *dev) +{ + usb_dev_handle *udev; + + udev = malloc(sizeof(*udev)); + if (!udev) + return NULL; + + udev->fd = -1; + udev->device = dev; + udev->bus = dev->bus; + udev->config = udev->interface = udev->altsetting = -1; + + if (usb_os_open(udev) < 0) + { + free(udev); + return NULL; + } + + return udev; +} + +int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen) +{ + /* + * We can't use usb_get_descriptor() because it's lacking the index + * parameter. This will be fixed in libusb 1.0 + */ + return usb_control_msg(dev, USB_ENDPOINT_IN, USB_REQ_GET_DESCRIPTOR, + (USB_DT_STRING << 8) + index, langid, buf, (int)buflen, 1000); +} + +int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, size_t buflen) +{ + char tbuf[255]; /* Some devices choke on size > 255 */ + int ret, langid, si, di; + + /* + * Asking for the zero'th index is special - it returns a string + * descriptor that contains all the language IDs supported by the + * device. Typically there aren't many - often only one. The + * language IDs are 16 bit numbers, and they start at the third byte + * in the descriptor. See USB 2.0 specification, section 9.6.7, for + * more information on this. */ + ret = usb_get_string(dev, 0, 0, tbuf, sizeof(tbuf)); + if (ret < 0) + return ret; + + if (ret < 4) + return -EIO; + + langid = tbuf[2] | (tbuf[3] << 8); + + ret = usb_get_string(dev, index, langid, tbuf, sizeof(tbuf)); + if (ret < 0) + return ret; + + if (tbuf[1] != USB_DT_STRING) + return -EIO; + + if (tbuf[0] > ret) + return -EFBIG; + + for (di = 0, si = 2; si < tbuf[0]; si += 2) + { + if (di >= ((int)buflen - 1)) + break; + + if (tbuf[si + 1]) /* high byte */ + buf[di++] = '?'; + else + buf[di++] = tbuf[si]; + } + + buf[di] = 0; + + return di; +} + +int usb_close(usb_dev_handle *dev) +{ + int ret; + + ret = usb_os_close(dev); + free(dev); + + return ret; +} + +struct usb_device *usb_device(usb_dev_handle *dev) +{ + return dev->device; +} + +void usb_free_dev(struct usb_device *dev) +{ + usb_destroy_configuration(dev); + free(dev->children); + free(dev); +} + +struct usb_bus *usb_get_busses(void) +{ + return _usb_busses; +} + +void usb_free_bus(struct usb_bus *bus) +{ + free(bus); +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.h new file mode 100644 index 0000000..e9875bb --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usb.h @@ -0,0 +1,416 @@ +#ifndef __USB_H__ +#define __USB_H__ + +#include +#include + +/* + * 'interface' is defined somewhere in the Windows header files. This macro + * is deleted here to avoid conflicts and compile errors. + */ + +#ifdef interface +#undef interface +#endif + +/* + * PATH_MAX from limits.h can't be used on Windows if the dll and + * import libraries are build/used by different compilers + */ + +#define LIBUSB_PATH_MAX 512 + + +/* + * USB spec information + * + * This is all stuff grabbed from various USB specs and is pretty much + * not subject to change + */ + +/* + * Device and/or Interface Class codes + */ +#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ +#define USB_CLASS_AUDIO 1 +#define USB_CLASS_COMM 2 +#define USB_CLASS_HID 3 +#define USB_CLASS_PRINTER 7 +#define USB_CLASS_MASS_STORAGE 8 +#define USB_CLASS_HUB 9 +#define USB_CLASS_DATA 10 +#define USB_CLASS_VENDOR_SPEC 0xff + +/* + * Descriptor types + */ +#define USB_DT_DEVICE 0x01 +#define USB_DT_CONFIG 0x02 +#define USB_DT_STRING 0x03 +#define USB_DT_INTERFACE 0x04 +#define USB_DT_ENDPOINT 0x05 + +#define USB_DT_HID 0x21 +#define USB_DT_REPORT 0x22 +#define USB_DT_PHYSICAL 0x23 +#define USB_DT_HUB 0x29 + +/* + * Descriptor sizes per descriptor type + */ +#define USB_DT_DEVICE_SIZE 18 +#define USB_DT_CONFIG_SIZE 9 +#define USB_DT_INTERFACE_SIZE 9 +#define USB_DT_ENDPOINT_SIZE 7 +#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ +#define USB_DT_HUB_NONVAR_SIZE 7 + + +/* ensure byte-packed structures */ +#include + + +/* All standard descriptors have these 2 fields in common */ +struct usb_descriptor_header +{ + unsigned char bLength; + unsigned char bDescriptorType; +}; + +/* String descriptor */ +struct usb_string_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wData[1]; +}; + +/* HID descriptor */ +struct usb_hid_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdHID; + unsigned char bCountryCode; + unsigned char bNumDescriptors; +}; + +/* Endpoint descriptor */ +#define USB_MAXENDPOINTS 32 +struct usb_endpoint_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bEndpointAddress; + unsigned char bmAttributes; + unsigned short wMaxPacketSize; + unsigned char bInterval; + unsigned char bRefresh; + unsigned char bSynchAddress; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */ +#define USB_ENDPOINT_DIR_MASK 0x80 + +#define USB_ENDPOINT_TYPE_MASK 0x03 /* in bmAttributes */ +#define USB_ENDPOINT_TYPE_CONTROL 0 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1 +#define USB_ENDPOINT_TYPE_BULK 2 +#define USB_ENDPOINT_TYPE_INTERRUPT 3 + +/* Interface descriptor */ +#define USB_MAXINTERFACES 32 +struct usb_interface_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned char bInterfaceNumber; + unsigned char bAlternateSetting; + unsigned char bNumEndpoints; + unsigned char bInterfaceClass; + unsigned char bInterfaceSubClass; + unsigned char bInterfaceProtocol; + unsigned char iInterface; + + struct usb_endpoint_descriptor *endpoint; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +#define USB_MAXALTSETTING 128 /* Hard limit */ + +struct usb_interface +{ + struct usb_interface_descriptor *altsetting; + + int num_altsetting; +}; + +/* Configuration descriptor information.. */ +#define USB_MAXCONFIG 8 +struct usb_config_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short wTotalLength; + unsigned char bNumInterfaces; + unsigned char bConfigurationValue; + unsigned char iConfiguration; + unsigned char bmAttributes; + unsigned char MaxPower; + + struct usb_interface *interface; + + unsigned char *extra; /* Extra descriptors */ + int extralen; +}; + +/* Device descriptor */ +struct usb_device_descriptor +{ + unsigned char bLength; + unsigned char bDescriptorType; + unsigned short bcdUSB; + unsigned char bDeviceClass; + unsigned char bDeviceSubClass; + unsigned char bDeviceProtocol; + unsigned char bMaxPacketSize0; + unsigned short idVendor; + unsigned short idProduct; + unsigned short bcdDevice; + unsigned char iManufacturer; + unsigned char iProduct; + unsigned char iSerialNumber; + unsigned char bNumConfigurations; +}; + +struct usb_ctrl_setup +{ + unsigned char bRequestType; + unsigned char bRequest; + unsigned short wValue; + unsigned short wIndex; + unsigned short wLength; +}; + +/* + * Standard requests + */ +#define USB_REQ_GET_STATUS 0x00 +#define USB_REQ_CLEAR_FEATURE 0x01 +/* 0x02 is reserved */ +#define USB_REQ_SET_FEATURE 0x03 +/* 0x04 is reserved */ +#define USB_REQ_SET_ADDRESS 0x05 +#define USB_REQ_GET_DESCRIPTOR 0x06 +#define USB_REQ_SET_DESCRIPTOR 0x07 +#define USB_REQ_GET_CONFIGURATION 0x08 +#define USB_REQ_SET_CONFIGURATION 0x09 +#define USB_REQ_GET_INTERFACE 0x0A +#define USB_REQ_SET_INTERFACE 0x0B +#define USB_REQ_SYNCH_FRAME 0x0C + +#define USB_TYPE_STANDARD (0x00 << 5) +#define USB_TYPE_CLASS (0x01 << 5) +#define USB_TYPE_VENDOR (0x02 << 5) +#define USB_TYPE_RESERVED (0x03 << 5) + +#define USB_RECIP_DEVICE 0x00 +#define USB_RECIP_INTERFACE 0x01 +#define USB_RECIP_ENDPOINT 0x02 +#define USB_RECIP_OTHER 0x03 + +/* + * Various libusb API related stuff + */ + +#define USB_ENDPOINT_IN 0x80 +#define USB_ENDPOINT_OUT 0x00 + +/* Error codes */ +#define USB_ERROR_BEGIN 500000 + +/* + * This is supposed to look weird. This file is generated from autoconf + * and I didn't want to make this too complicated. + */ +#define USB_LE16_TO_CPU(x) + +/* Data types */ +/* struct usb_device; */ +/* struct usb_bus; */ + +struct usb_device +{ + struct usb_device *next, *prev; + + char filename[LIBUSB_PATH_MAX]; + + struct usb_bus *bus; + + struct usb_device_descriptor descriptor; + struct usb_config_descriptor *config; + + void *dev; /* Darwin support */ + + unsigned char devnum; + + unsigned char num_children; + struct usb_device **children; +}; + +struct usb_bus +{ + struct usb_bus *next, *prev; + + char dirname[LIBUSB_PATH_MAX]; + + struct usb_device *devices; + unsigned long location; + + struct usb_device *root_dev; +}; + +/* Version information, Windows specific */ +struct usb_version +{ + struct + { + int major; + int minor; + int micro; + int nano; + } dll; + struct + { + int major; + int minor; + int micro; + int nano; + } driver; +}; + + +struct usb_dev_handle; +typedef struct usb_dev_handle usb_dev_handle; + +/* Variables */ +#ifndef __USB_C__ +#define usb_busses usb_get_busses() +#endif + + + +#include + + +#ifdef __cplusplus +extern "C" +{ +#endif + + /* Function prototypes */ + + /* usb.c */ + usb_dev_handle *usb_open(struct usb_device *dev); + int usb_close(usb_dev_handle *dev); + int usb_get_string(usb_dev_handle *dev, int index, int langid, char *buf, + size_t buflen); + int usb_get_string_simple(usb_dev_handle *dev, int index, char *buf, + size_t buflen); + + /* descriptors.c */ + int usb_get_descriptor_by_endpoint(usb_dev_handle *udev, int ep, + unsigned char type, unsigned char index, + void *buf, int size); + int usb_get_descriptor(usb_dev_handle *udev, unsigned char type, + unsigned char index, void *buf, int size); + + /* .c */ + int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout); + int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, + int timeout); + int usb_set_configuration(usb_dev_handle *dev, int configuration); + int usb_claim_interface(usb_dev_handle *dev, int interface); + int usb_release_interface(usb_dev_handle *dev, int interface); + int usb_set_altinterface(usb_dev_handle *dev, int alternate); + int usb_resetep(usb_dev_handle *dev, unsigned int ep); + int usb_clear_halt(usb_dev_handle *dev, unsigned int ep); + int usb_reset(usb_dev_handle *dev); + + char *usb_strerror(void); + + void usb_init(void); + void usb_set_debug(int level); + int usb_find_busses(void); + int usb_find_devices(void); + struct usb_device *usb_device(usb_dev_handle *dev); + struct usb_bus *usb_get_busses(void); + + + /* Windows specific functions */ + +#define LIBUSB_HAS_INSTALL_SERVICE_NP 1 + int usb_install_service_np(void); + void CALLBACK usb_install_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_UNINSTALL_SERVICE_NP 1 + int usb_uninstall_service_np(void); + void CALLBACK usb_uninstall_service_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_DRIVER_NP 1 + int usb_install_driver_np(const char *inf_file); + void CALLBACK usb_install_driver_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_TOUCH_INF_FILE_NP 1 + int usb_touch_inf_file_np(const char *inf_file); + void CALLBACK usb_touch_inf_file_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + +#define LIBUSB_HAS_INSTALL_NEEDS_RESTART_NP 1 + int usb_install_needs_restart_np(void); + +#define LIBUSB_HAS_INSTALL_NP 1 + int usb_install_npW(HWND hwnd, HINSTANCE instance, LPCWSTR cmd_line, int starg_arg); + int usb_install_npA(HWND hwnd, HINSTANCE instance, LPCSTR cmd_line, int starg_arg); + #define usb_install_np usb_install_npA + void CALLBACK usb_install_np_rundll(HWND wnd, HINSTANCE instance, + LPSTR cmd_line, int cmd_show); + + const struct usb_version *usb_get_version(void); + + int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize); + int usb_bulk_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep); + + int usb_submit_async(void *context, char *bytes, int size); + int usb_reap_async(void *context, int timeout); + int usb_reap_async_nocancel(void *context, int timeout); + int usb_cancel_async(void *context); + int usb_free_async(void **context); + + +#ifdef __cplusplus +} +#endif + +#endif /* __USB_H__ */ + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usbi.h b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usbi.h new file mode 100644 index 0000000..578dfc9 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/usbi.h @@ -0,0 +1,79 @@ +#ifndef _USBI_H_ +#define _USBI_H_ + +#include "usb.h" + +#include "error.h" + +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; + +extern int usb_debug; + +/* Some quick and generic macros for the simple kind of lists we use */ +#define LIST_ADD(begin, ent) \ + do { \ + if (begin) { \ + ent->next = begin; \ + ent->next->prev = ent; \ + } else \ + ent->next = NULL; \ + ent->prev = NULL; \ + begin = ent; \ + } while(0) + +#define LIST_DEL(begin, ent) \ + do { \ + if (ent->prev) \ + ent->prev->next = ent->next; \ + else \ + begin = ent->next; \ + if (ent->next) \ + ent->next->prev = ent->prev; \ + ent->prev = NULL; \ + ent->next = NULL; \ + } while (0) + +#define DESC_HEADER_LENGTH 2 +#define DEVICE_DESC_LENGTH 18 +#define CONFIG_DESC_LENGTH 9 +#define INTERFACE_DESC_LENGTH 9 +#define ENDPOINT_DESC_LENGTH 7 +#define ENDPOINT_AUDIO_DESC_LENGTH 9 + +struct usb_dev_handle +{ + int fd; + + struct usb_bus *bus; + struct usb_device *device; + + int config; + int interface; + int altsetting; + + /* Added by RMT so implementations can store other per-open-device data */ + void *impl_info; +}; + +/* descriptors.c */ +int usb_parse_descriptor(unsigned char *source, char *description, void *dest); +int usb_parse_configuration(struct usb_config_descriptor *config, + unsigned char *buffer); +void usb_fetch_and_parse_descriptors(usb_dev_handle *udev); +void usb_destroy_configuration(struct usb_device *dev); + +/* OS specific routines */ +int usb_os_find_busses(struct usb_bus **busses); +int usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices); +int usb_os_determine_children(struct usb_bus *bus); +void usb_os_init(void); +int usb_os_open(usb_dev_handle *dev); +int usb_os_close(usb_dev_handle *dev); + +void usb_free_dev(struct usb_device *dev); +void usb_free_bus(struct usb_bus *bus); + +#endif /* _USBI_H_ */ + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/windows.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/windows.c new file mode 100644 index 0000000..742e4b6 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/src/windows.c @@ -0,0 +1,1257 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2005 Stephan Meyer + * Copyright (c) 2000-2005 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "usb.h" +#include "error.h" +#include "usbi.h" +#include "driver_api.h" +#include "registry.h" +#include "libusb-win32_version.h" + +#define LIBUSB_WIN32_DLL_LARGE_TRANSFER_SUPPORT + +#define LIBUSB_DEFAULT_TIMEOUT 5000 +#define LIBUSB_DEVICE_NAME "\\\\.\\libusb0-" +#define LIBUSB_BUS_NAME "bus-0" +#define LIBUSB_MAX_DEVICES 256 + +typedef struct +{ + usb_dev_handle *dev; + libusb_request req; + char *bytes; + int size; + DWORD control_code; + OVERLAPPED ol; +} usb_context_t; + + +static struct usb_version _usb_version = +{ + { VERSION_MAJOR, + VERSION_MINOR, + VERSION_MICRO, + VERSION_NANO }, + { -1, -1, -1, -1 } +}; + + +static int _usb_setup_async(usb_dev_handle *dev, void **context, + DWORD control_code, + unsigned char ep, int pktsize); +static int _usb_transfer_sync(usb_dev_handle *dev, int control_code, + int ep, int pktsize, char *bytes, int size, + int timeout); + +static int usb_get_configuration(usb_dev_handle *dev, bool_t cached); +static int _usb_cancel_io(usb_context_t *context); +static int _usb_abort_ep(usb_dev_handle *dev, unsigned int ep); + +static int _usb_io_sync(HANDLE dev, unsigned int code, void *in, int in_size, + void *out, int out_size, int *ret); +static int _usb_reap_async(void *context, int timeout, int cancel); +static int _usb_add_virtual_hub(struct usb_bus *bus); + +static void _usb_free_bus_list(struct usb_bus *bus); +static void _usb_free_dev_list(struct usb_device *dev); +static void _usb_deinit(void); + +/* DLL main entry point */ +BOOL WINAPI DllMain(HANDLE module, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + break; + case DLL_PROCESS_DETACH: + _usb_deinit(); + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + default: + break; + } + return TRUE; +} + + +static int usb_get_configuration(usb_dev_handle *dev, bool_t cached) +{ + int ret; + char config; + libusb_request request; + + if (cached) + { + memset(&request, 0, sizeof(request)); + request.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_GET_CACHED_CONFIGURATION, + &request, sizeof(request), &request, sizeof(request), &ret)) + { + USBERR("sending get cached configuration ioctl failed, win error: %s\n", usb_win_error_to_string()); + ret = -usb_win_error_to_errno(); + } + + if (ret < 1) + ret = -EINVAL; + else + config = *((char*)&request); + } + else + { + ret = usb_control_msg(dev, USB_RECIP_DEVICE | USB_ENDPOINT_IN, + USB_REQ_GET_CONFIGURATION, 0, 0, &config, 1, + LIBUSB_DEFAULT_TIMEOUT); + } + + if(ret < 0) + return ret; + + return config; +} + +int usb_os_open(usb_dev_handle *dev) +{ + char dev_name[LIBUSB_PATH_MAX]; + char *p; + int config; + if (!dev) + { + USBERR("invalid device handle %p", dev); + return -EINVAL; + } + + dev->impl_info = INVALID_HANDLE_VALUE; + dev->config = 0; + dev->interface = -1; + dev->altsetting = -1; + + if (!dev->device->filename) + { + USBERR0("invalid file name\n"); + return -ENOENT; + } + + /* build the Windows file name from the unique device name */ + strcpy(dev_name, dev->device->filename); + + p = strstr(dev_name, "--"); + + if (!p) + { + USBERR("invalid file name %s\n", dev->device->filename); + return -ENOENT; + } + + *p = 0; + + dev->impl_info = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR("failed to open %s: win error: %s", + dev->device->filename, usb_win_error_to_string()); + return -ENOENT; + } + + // get the cached configuration (no device i/o) + config = usb_get_configuration(dev, TRUE); + if (config > 0) + { + dev->config = config; + dev->interface = -1; + dev->altsetting = -1; + } + + return 0; +} + +int usb_os_close(usb_dev_handle *dev) +{ + if (dev->impl_info != INVALID_HANDLE_VALUE) + { + if (dev->interface >= 0) + { + usb_release_interface(dev, dev->interface); + } + + CloseHandle(dev->impl_info); + dev->impl_info = INVALID_HANDLE_VALUE; + dev->interface = -1; + dev->altsetting = -1; + } + + return 0; +} + +int usb_set_configuration(usb_dev_handle *dev, int configuration) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("error: device not open\n"); + return -EINVAL; + } + + if (dev->config == configuration) + { + return 0; + } + + if (dev->interface >= 0) + { + USBERR0("can't change configuration, an interface is still in use (claimed)\n"); + return -EINVAL; + } + + req.configuration.configuration = configuration; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_SET_CONFIGURATION, + &req, sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not set config %d: " + "win error: %s", configuration, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + dev->config = configuration; + dev->interface = -1; + dev->altsetting = -1; + + return 0; +} + +int usb_claim_interface(usb_dev_handle *dev, int interface) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + if (!dev->config) + { + USBERR("could not claim interface %d, invalid configuration %d\n", interface, dev->config); + return -EINVAL; + } + + if (dev->interface == interface) + { + return 0; + } + + req.interface.interface = interface; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_CLAIM_INTERFACE, + &req, sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not claim interface %d, " + "win error: %s", interface, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + else + { + dev->interface = interface; + dev->altsetting = 0; + return 0; + } +} + +int usb_release_interface(usb_dev_handle *dev, int interface) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + if (!dev->config) + { + USBERR("could not release interface %d, invalid configuration %d\n", interface, dev->config); + return -EINVAL; + } + + req.interface.interface = interface; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_RELEASE_INTERFACE, + &req, sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not release interface %d, " + "win error: %s", interface, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + else + { + dev->interface = -1; + dev->altsetting = -1; + + return 0; + } +} + +int usb_set_altinterface(usb_dev_handle *dev, int alternate) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + if (dev->config <= 0) + { + USBERR("could not set alt interface %d: invalid configuration %d\n", alternate, dev->config); + return -EINVAL; + } + + if (dev->interface < 0) + { + USBERR("could not set alt interface %d: no interface claimed\n", alternate); + return -EINVAL; + } + + req.interface.interface = dev->interface; + req.interface.altsetting = alternate; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_SET_INTERFACE, + &req, sizeof(libusb_request), + NULL, 0, NULL)) + { + USBERR("could not set alt interface " + "%d/%d: win error: %s", + dev->interface, alternate, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + dev->altsetting = alternate; + + return 0; +} + +static int _usb_setup_async(usb_dev_handle *dev, void **context, + DWORD control_code, + unsigned char ep, int pktsize) +{ + usb_context_t **c = (usb_context_t **)context; + + if (((control_code == LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE) + || (control_code == LIBUSB_IOCTL_ISOCHRONOUS_WRITE)) + && (ep & USB_ENDPOINT_IN)) + { + USBERR("invalid endpoint 0x%02x", ep); + return -EINVAL; + } + + if (((control_code == LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ) + || (control_code == LIBUSB_IOCTL_ISOCHRONOUS_READ)) + && !(ep & USB_ENDPOINT_IN)) + { + USBERR("invalid endpoint 0x%02x\n", ep); + return -EINVAL; + } + + *c = malloc(sizeof(usb_context_t)); + + if (!*c) + { + USBERR0("memory allocation error\n"); + return -ENOMEM; + } + + memset(*c, 0, sizeof(usb_context_t)); + + (*c)->dev = dev; + (*c)->req.endpoint.endpoint = ep; + (*c)->req.endpoint.packet_size = pktsize; + (*c)->control_code = control_code; + + (*c)->ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + + if (!(*c)->ol.hEvent) + { + free(*c); + *c = NULL; + USBERR("creating event failed: win error: %s", + usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return 0; +} + +int usb_submit_async(void *context, char *bytes, int size) +{ + usb_context_t *c = (usb_context_t *)context; + + if (!c) + { + USBERR0("invalid context"); + return -EINVAL; + } + + if (c->dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + if (c->dev->config <= 0) + { + USBERR("invalid configuration %d\n", c->dev->config); + return -EINVAL; + } + + if (c->dev->interface < 0) + { + USBERR("invalid interface %d\n", c->dev->interface); + return -EINVAL; + } + + + c->ol.Offset = 0; + c->ol.OffsetHigh = 0; + c->bytes = bytes; + c->size = size; + + ResetEvent(c->ol.hEvent); + + if (!DeviceIoControl(c->dev->impl_info, + c->control_code, + &c->req, sizeof(libusb_request), + c->bytes, + c->size, NULL, &c->ol)) + { + if (GetLastError() != ERROR_IO_PENDING) + { + USBERR("submitting request failed, " + "win error: %s", usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + } + + return 0; +} + +static int _usb_reap_async(void *context, int timeout, int cancel) +{ + usb_context_t *c = (usb_context_t *)context; + ULONG ret = 0; + + if (!c) + { + USBERR0("invalid context\n"); + return -EINVAL; + } + + if (WaitForSingleObject(c->ol.hEvent, timeout) == WAIT_TIMEOUT) + { + /* request timed out */ + if (cancel) + { + _usb_cancel_io(c); + } + + USBERR0("timeout error\n"); + return -ETRANSFER_TIMEDOUT; + } + + if (!GetOverlappedResult(c->dev->impl_info, &c->ol, &ret, TRUE)) + { + USBERR("reaping request failed, win error: %s\n",usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return ret; +} + +int usb_reap_async(void *context, int timeout) +{ + return _usb_reap_async(context, timeout, TRUE); +} + +int usb_reap_async_nocancel(void *context, int timeout) +{ + return _usb_reap_async(context, timeout, FALSE); +} + + +int usb_cancel_async(void *context) +{ + /* NOTE that this function will cancel all pending URBs */ + /* on the same endpoint as this particular context, or even */ + /* all pending URBs for this particular device. */ + + usb_context_t *c = (usb_context_t *)context; + + if (!c) + { + USBERR0("invalid context\n"); + return -EINVAL; + } + + if (c->dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + _usb_cancel_io(c); + + return 0; +} + +int usb_free_async(void **context) +{ + usb_context_t **c = (usb_context_t **)context; + + if (!*c) + { + USBERR0("invalid context\n"); + return -EINVAL; + } + + CloseHandle((*c)->ol.hEvent); + + free(*c); + *c = NULL; + + return 0; +} + +static int _usb_transfer_sync(usb_dev_handle *dev, int control_code, + int ep, int pktsize, char *bytes, int size, + int timeout) +{ + void *context = NULL; + int transmitted = 0; + int ret; + int requested; + + ret = _usb_setup_async(dev, &context, control_code, (unsigned char )ep, + pktsize); + + if (ret < 0) + { + return ret; + } + + do + { +#ifdef LIBUSB_WIN32_DLL_LARGE_TRANSFER_SUPPORT + requested = size > LIBUSB_MAX_READ_WRITE ? LIBUSB_MAX_READ_WRITE : size; +#else + requested = size; +#endif + ret = usb_submit_async(context, bytes, requested); + + if (ret < 0) + { + transmitted = ret; + break; + } + + ret = usb_reap_async(context, timeout); + + if (ret < 0) + { + transmitted = ret; + break; + } + + transmitted += ret; + bytes += ret; + size -= ret; + } + while (size > 0 && ret == requested); + + usb_free_async(&context); + + return transmitted; +} + +int usb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + return _usb_transfer_sync(dev, LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE, + ep, 0, bytes, size, timeout); +} + +int usb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + return _usb_transfer_sync(dev, LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ, + ep, 0, bytes, size, timeout); +} + +int usb_interrupt_write(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + return _usb_transfer_sync(dev, LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE, + ep, 0, bytes, size, timeout); +} + +int usb_interrupt_read(usb_dev_handle *dev, int ep, char *bytes, int size, + int timeout) +{ + return _usb_transfer_sync(dev, LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ, + ep, 0, bytes, size, timeout); +} + +int usb_isochronous_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep, int pktsize) +{ + if (ep & 0x80) + return _usb_setup_async(dev, context, LIBUSB_IOCTL_ISOCHRONOUS_READ, + ep, pktsize); + else + return _usb_setup_async(dev, context, LIBUSB_IOCTL_ISOCHRONOUS_WRITE, + ep, pktsize); +} + +int usb_bulk_setup_async(usb_dev_handle *dev, void **context, unsigned char ep) +{ + if (ep & 0x80) + return _usb_setup_async(dev, context, LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ, + ep, 0); + else + return _usb_setup_async(dev, context, LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE, + ep, 0); +} + +int usb_interrupt_setup_async(usb_dev_handle *dev, void **context, + unsigned char ep) +{ + if (ep & 0x80) + return _usb_setup_async(dev, context, LIBUSB_IOCTL_INTERRUPT_OR_BULK_READ, + ep, 0); + else + return _usb_setup_async(dev, context, LIBUSB_IOCTL_INTERRUPT_OR_BULK_WRITE, + ep, 0); +} + +int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, + int value, int index, char *bytes, int size, int timeout) +{ + int read = 0; + libusb_request req; + void *out = &req; + int out_size = sizeof(libusb_request); + void *in = bytes; + int in_size = size; + int code; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + req.timeout = timeout; + + /* windows doesn't support generic control messages, so it needs to be */ + /* split up */ + switch (requesttype & (0x03 << 5)) + { + case USB_TYPE_STANDARD: + switch (request) + { + case USB_REQ_GET_STATUS: + req.status.recipient = requesttype & 0x1F; + req.status.index = index; + code = LIBUSB_IOCTL_GET_STATUS; + break; + + case USB_REQ_CLEAR_FEATURE: + req.feature.recipient = requesttype & 0x1F; + req.feature.feature = value; + req.feature.index = index; + code = LIBUSB_IOCTL_CLEAR_FEATURE; + break; + + case USB_REQ_SET_FEATURE: + req.feature.recipient = requesttype & 0x1F; + req.feature.feature = value; + req.feature.index = index; + code = LIBUSB_IOCTL_SET_FEATURE; + break; + + case USB_REQ_GET_DESCRIPTOR: + req.descriptor.recipient = requesttype & 0x1F; + req.descriptor.type = (value >> 8) & 0xFF; + req.descriptor.index = value & 0xFF; + req.descriptor.language_id = index; + code = LIBUSB_IOCTL_GET_DESCRIPTOR; + break; + + case USB_REQ_SET_DESCRIPTOR: + req.descriptor.recipient = requesttype & 0x1F; + req.descriptor.type = (value >> 8) & 0xFF; + req.descriptor.index = value & 0xFF; + req.descriptor.language_id = index; + code = LIBUSB_IOCTL_SET_DESCRIPTOR; + break; + + case USB_REQ_GET_CONFIGURATION: + code = LIBUSB_IOCTL_GET_CONFIGURATION; + break; + + case USB_REQ_SET_CONFIGURATION: + req.configuration.configuration = value; + code = LIBUSB_IOCTL_SET_CONFIGURATION; + break; + + case USB_REQ_GET_INTERFACE: + req.interface.interface = index; + code = LIBUSB_IOCTL_GET_INTERFACE; + break; + + case USB_REQ_SET_INTERFACE: + req.interface.interface = index; + req.interface.altsetting = value; + code = LIBUSB_IOCTL_SET_INTERFACE; + break; + + default: + USBERR("invalid request 0x%x", request); + return -EINVAL; + } + break; + + case USB_TYPE_VENDOR: + case USB_TYPE_CLASS: + + req.vendor.type = (requesttype >> 5) & 0x03; + req.vendor.recipient = requesttype & 0x1F; + req.vendor.request = request; + req.vendor.value = value; + req.vendor.index = index; + + if (requesttype & 0x80) + code = LIBUSB_IOCTL_VENDOR_READ; + else + code = LIBUSB_IOCTL_VENDOR_WRITE; + break; + + case USB_TYPE_RESERVED: + default: + USBERR("invalid or unsupported request type: %x", + requesttype); + return -EINVAL; + } + + /* out request? */ + if (!(requesttype & USB_ENDPOINT_IN)) + { + if (!(out = malloc(sizeof(libusb_request) + size))) + { + USBERR0("memory allocation failed\n"); + return -ENOMEM; + } + + memcpy(out, &req, sizeof(libusb_request)); + memcpy((char *)out + sizeof(libusb_request), bytes, size); + out_size = sizeof(libusb_request) + size; + in = NULL; + in_size = 0; + } + + if (!_usb_io_sync(dev->impl_info, code, out, out_size, in, in_size, &read)) + { + USBERR("sending control message failed, win error: %s\n", usb_win_error_to_string()); + if (!(requesttype & USB_ENDPOINT_IN)) + { + free(out); + } + return -usb_win_error_to_errno(); + } + + /* out request? */ + if (!(requesttype & USB_ENDPOINT_IN)) + { + free(out); + return size; + } + else + return read; +} + + +int usb_os_find_busses(struct usb_bus **busses) +{ + struct usb_bus *bus = NULL; + + /* create one 'virtual' bus */ + + bus = malloc(sizeof(struct usb_bus)); + + if (!bus) + { + USBERR0("memory allocation failed\n"); + return -ENOMEM; + } + + memset(bus, 0, sizeof(*bus)); + strcpy(bus->dirname, LIBUSB_BUS_NAME); + + USBMSG("found %s\n", bus->dirname); + + *busses = bus; + + return 0; +} + +int usb_os_find_devices(struct usb_bus *bus, struct usb_device **devices) +{ + int i; + struct usb_device *dev, *fdev = NULL; + char dev_name[LIBUSB_PATH_MAX]; + int ret; + HANDLE handle; + libusb_request req; + + for (i = 1; i < LIBUSB_MAX_DEVICES; i++) + { + ret = 0; + + _snprintf(dev_name, sizeof(dev_name) - 1,"%s%04d", + LIBUSB_DEVICE_NAME, i); + + if (!(dev = malloc(sizeof(*dev)))) + { + USBERR0("memory allocation failed\n"); + return -ENOMEM; + } + + memset(dev, 0, sizeof(*dev)); + dev->bus = bus; + dev->devnum = (unsigned char)i; + + handle = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + + if (handle == INVALID_HANDLE_VALUE) + { + free(dev); + continue; + } + + /* retrieve device descriptor */ + req.descriptor.type = USB_DT_DEVICE; + req.descriptor.recipient = USB_RECIP_DEVICE; + req.descriptor.index = 0; + req.descriptor.language_id = 0; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + _usb_io_sync(handle, LIBUSB_IOCTL_GET_DESCRIPTOR, + &req, sizeof(libusb_request), + &dev->descriptor, USB_DT_DEVICE_SIZE, &ret); + + if (ret < USB_DT_DEVICE_SIZE) + { + USBERR0("couldn't read device descriptor\n"); + free(dev); + CloseHandle(handle); + continue; + } + + _snprintf(dev->filename, LIBUSB_PATH_MAX - 1, "%s--0x%04x-0x%04x", + dev_name, dev->descriptor.idVendor, dev->descriptor.idProduct); + + CloseHandle(handle); + + LIST_ADD(fdev, dev); + + USBMSG("found %s on %s\n", dev->filename, bus->dirname); + } + + *devices = fdev; + + return 0; +} + + +void usb_os_init(void) +{ + HANDLE dev; + libusb_request req; + int i; + int ret; + char dev_name[LIBUSB_PATH_MAX]; + + USBMSG("dll version: %d.%d.%d.%d\n", + VERSION_MAJOR, VERSION_MINOR, + VERSION_MICRO, VERSION_NANO); + + + for (i = 1; i < LIBUSB_MAX_DEVICES; i++) + { + /* build the Windows file name */ + _snprintf(dev_name, sizeof(dev_name) - 1,"%s%04d", + LIBUSB_DEVICE_NAME, i); + + dev = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + + if (dev == INVALID_HANDLE_VALUE) + { + continue; + } + + if (!_usb_io_sync(dev, LIBUSB_IOCTL_GET_VERSION, + &req, sizeof(libusb_request), + &req, sizeof(libusb_request), &ret) + || (ret < sizeof(libusb_request))) + { + USBERR0("getting driver version failed\n"); + CloseHandle(dev); + continue; + } + else + { + _usb_version.driver.major = req.version.major; + _usb_version.driver.minor = req.version.minor; + _usb_version.driver.micro = req.version.micro; + _usb_version.driver.nano = req.version.nano; + + USBMSG("driver version: %d.%d.%d.%d\n", + req.version.major, req.version.minor, + req.version.micro, req.version.nano); + + /* set debug level */ + req.timeout = 0; + req.debug.level = usb_log_get_level(); + + if (!_usb_io_sync(dev, LIBUSB_IOCTL_SET_DEBUG_LEVEL, + &req, sizeof(libusb_request), + NULL, 0, NULL)) + { + USBERR0("setting debug level failed"); + } + + CloseHandle(dev); + break; + } + } +} + + +int usb_resetep(usb_dev_handle *dev, unsigned int ep) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + req.endpoint.endpoint = (int)ep; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_ABORT_ENDPOINT, &req, + sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not abort ep 0x%02x, win error: %s\n", ep, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_RESET_ENDPOINT, &req, + sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not reset ep 0x%02x, win error: %s\n", ep, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return 0; +} + +int usb_clear_halt(usb_dev_handle *dev, unsigned int ep) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + req.endpoint.endpoint = (int)ep; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_RESET_ENDPOINT, &req, + sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not clear halt, ep 0x%02x, " + "win error: %s", ep, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return 0; +} + +int usb_reset(usb_dev_handle *dev) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open\n"); + return -EINVAL; + } + + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_RESET_DEVICE, + &req, sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not reset device, win error: %s\n", usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return 0; +} + +const struct usb_version *usb_get_version(void) +{ + return &_usb_version; +} + +void usb_set_debug(int level) +{ + HANDLE dev; + libusb_request req; + int i; + char dev_name[LIBUSB_PATH_MAX]; + + if (usb_log_get_level() || level) + { + USBMSG("setting debugging level to %d (%s)\n", + level, level ? "on" : "off"); + } + + usb_log_set_level(level); + + /* find a valid device */ + for (i = 1; i < LIBUSB_MAX_DEVICES; i++) + { + /* build the Windows file name */ + _snprintf(dev_name, sizeof(dev_name) - 1,"%s%04d", + LIBUSB_DEVICE_NAME, i); + + dev = CreateFile(dev_name, 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_OVERLAPPED, NULL); + + if (dev == INVALID_HANDLE_VALUE) + { + continue; + } + + /* set debug level */ + req.timeout = 0; + req.debug.level = usb_log_get_level(); + + if (!_usb_io_sync(dev, LIBUSB_IOCTL_SET_DEBUG_LEVEL, + &req, sizeof(libusb_request), + NULL, 0, NULL)) + { + USBERR0("setting debug level failed\n"); + } + + CloseHandle(dev); + + break; + } +} + +int usb_os_determine_children(struct usb_bus *bus) +{ + struct usb_device *dev; + int i = 0; + + /* add a virtual hub to the bus to emulate this feature */ + if (_usb_add_virtual_hub(bus)) + { + if (bus->root_dev->children) + { + free(bus->root_dev->children); + } + + bus->root_dev->num_children = 0; + for (dev = bus->devices; dev; dev = dev->next) + bus->root_dev->num_children++; + + bus->root_dev->children + = malloc(sizeof(struct usb_device *) * bus->root_dev->num_children); + + for (dev = bus->devices; dev; dev = dev->next) + bus->root_dev->children[i++] = dev; + } + + return 0; +} + +static int _usb_cancel_io(usb_context_t *context) +{ + int ret; + ret = _usb_abort_ep(context->dev, context->req.endpoint.endpoint); + WaitForSingleObject(context->ol.hEvent, 0); + return ret; +} + +static int _usb_abort_ep(usb_dev_handle *dev, unsigned int ep) +{ + libusb_request req; + + if (dev->impl_info == INVALID_HANDLE_VALUE) + { + USBERR0("device not open"); + return -EINVAL; + } + + req.endpoint.endpoint = (int)ep; + req.timeout = LIBUSB_DEFAULT_TIMEOUT; + + if (!_usb_io_sync(dev->impl_info, LIBUSB_IOCTL_ABORT_ENDPOINT, &req, + sizeof(libusb_request), NULL, 0, NULL)) + { + USBERR("could not abort ep 0x%02x, win error: %s\n", ep, usb_win_error_to_string()); + return -usb_win_error_to_errno(); + } + + return 0; +} + +static int _usb_io_sync(HANDLE dev, unsigned int code, void *out, int out_size, + void *in, int in_size, int *ret) +{ + OVERLAPPED ol; + DWORD _ret; + + memset(&ol, 0, sizeof(ol)); + + if (ret) + *ret = 0; + + ol.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + + if (!ol.hEvent) + return FALSE; + + if (!DeviceIoControl(dev, code, out, out_size, in, in_size, NULL, &ol)) + { + if (GetLastError() != ERROR_IO_PENDING) + { + CloseHandle(ol.hEvent); + return FALSE; + } + } + + if (GetOverlappedResult(dev, &ol, &_ret, TRUE)) + { + if (ret) + *ret = (int)_ret; + CloseHandle(ol.hEvent); + return TRUE; + } + + CloseHandle(ol.hEvent); + return FALSE; +} + +static int _usb_add_virtual_hub(struct usb_bus *bus) +{ + struct usb_device *dev; + + if (!bus->root_dev) + { + if (!(dev = malloc(sizeof(*dev)))) + return FALSE; + + memset(dev, 0, sizeof(*dev)); + strcpy(dev->filename, "virtual-hub"); + dev->bus = bus; + + dev->descriptor.bLength = USB_DT_DEVICE_SIZE; + dev->descriptor.bDescriptorType = USB_DT_DEVICE; + dev->descriptor.bcdUSB = 0x0200; + dev->descriptor.bDeviceClass = USB_CLASS_HUB; + dev->descriptor.bDeviceSubClass = 0; + dev->descriptor.bDeviceProtocol = 0; + dev->descriptor.bMaxPacketSize0 = 64; + dev->descriptor.idVendor = 0; + dev->descriptor.idProduct = 0; + dev->descriptor.bcdDevice = 0x100; + dev->descriptor.iManufacturer = 0; + dev->descriptor.iProduct = 0; + dev->descriptor.iSerialNumber = 0; + dev->descriptor.bNumConfigurations = 0; + + bus->root_dev = dev; + } + + return TRUE; +} + +static void _usb_free_bus_list(struct usb_bus *bus) +{ + if (bus) + { + _usb_free_bus_list(bus->next); + if (bus->root_dev) + usb_free_dev(bus->root_dev); + _usb_free_dev_list(bus->devices); + usb_free_bus(bus); + } +} + +static void _usb_free_dev_list(struct usb_device *dev) +{ + if (dev) + { + _usb_free_dev_list(dev->next); + usb_free_dev(dev); + } +} + +static void _usb_deinit(void) +{ + _usb_free_bus_list(usb_get_busses()); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb.c new file mode 100644 index 0000000..6df79c8 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb.c @@ -0,0 +1,196 @@ +/* + * testlibusb.c + * + * Test suite program + */ + +#include +#include +#include + +int verbose = 0; + +void print_endpoint(struct usb_endpoint_descriptor *endpoint) +{ + printf(" bEndpointAddress: %02xh\n", endpoint->bEndpointAddress); + printf(" bmAttributes: %02xh\n", endpoint->bmAttributes); + printf(" wMaxPacketSize: %d\n", endpoint->wMaxPacketSize); + printf(" bInterval: %d\n", endpoint->bInterval); + printf(" bRefresh: %d\n", endpoint->bRefresh); + printf(" bSynchAddress: %d\n", endpoint->bSynchAddress); +} + +void print_altsetting(struct usb_interface_descriptor *interface) +{ + int i; + + printf(" bInterfaceNumber: %d\n", interface->bInterfaceNumber); + printf(" bAlternateSetting: %d\n", interface->bAlternateSetting); + printf(" bNumEndpoints: %d\n", interface->bNumEndpoints); + printf(" bInterfaceClass: %d\n", interface->bInterfaceClass); + printf(" bInterfaceSubClass: %d\n", interface->bInterfaceSubClass); + printf(" bInterfaceProtocol: %d\n", interface->bInterfaceProtocol); + printf(" iInterface: %d\n", interface->iInterface); + + for (i = 0; i < interface->bNumEndpoints; i++) + print_endpoint(&interface->endpoint[i]); +} + +void print_interface(struct usb_interface *interface) +{ + int i; + + for (i = 0; i < interface->num_altsetting; i++) + print_altsetting(&interface->altsetting[i]); +} + +void print_configuration(struct usb_config_descriptor *config) +{ + int i; + + printf(" wTotalLength: %d\n", config->wTotalLength); + printf(" bNumInterfaces: %d\n", config->bNumInterfaces); + printf(" bConfigurationValue: %d\n", config->bConfigurationValue); + printf(" iConfiguration: %d\n", config->iConfiguration); + printf(" bmAttributes: %02xh\n", config->bmAttributes); + printf(" MaxPower: %d\n", config->MaxPower); + + for (i = 0; i < config->bNumInterfaces; i++) + print_interface(&config->interface[i]); +} + +void print_device_descriptor(struct usb_device_descriptor *desc, int indent) +{ + printf("%.*sbLength: %u\n", indent, " ", desc->bLength); + printf("%.*sbDescriptorType: %02Xh\n", indent, " ", desc->bDescriptorType); + printf("%.*sbcdUSB: %04Xh\n", indent, " ", desc->bcdUSB); + printf("%.*sbDeviceClass: %02Xh\n", indent, " ", desc->bDeviceClass); + printf("%.*sbDeviceSubClass: %02Xh\n", indent, " ", desc->bDeviceSubClass); + printf("%.*sbDeviceProtocol: %02Xh\n", indent, " ", desc->bDeviceProtocol); + printf("%.*sbMaxPacketSize0: %02Xh\n", indent, " ", desc->bMaxPacketSize0); + printf("%.*sidVendor: %04Xh\n", indent, " ", desc->idVendor); + printf("%.*sidProduct: %04Xh\n", indent, " ", desc->idProduct); + printf("%.*sbcdDevice: %04Xh\n", indent, " ", desc->bcdDevice); + printf("%.*siManufacturer: %u\n", indent, " ", desc->iManufacturer); + printf("%.*siProduct: %u\n", indent, " ", desc->iProduct); + printf("%.*siSerialNumber: %u\n", indent, " ", desc->iSerialNumber); + printf("%.*sbNumConfigurations: %u\n", indent, " ", desc->bNumConfigurations); +} + +int print_device(struct usb_device *dev, int level) +{ + usb_dev_handle *udev; + char description[256]; + char string[256]; + int ret, i; + + udev = usb_open(dev); + if (udev) + { + if (dev->descriptor.iManufacturer) + { + ret = usb_get_string_simple(udev, dev->descriptor.iManufacturer, string, + sizeof(string)); + if (ret > 0) + snprintf(description, sizeof(description), "%s - ", string); + else + snprintf(description, sizeof(description), "%04X - ", + dev->descriptor.idVendor); + } + else + snprintf(description, sizeof(description), "%04X - ", + dev->descriptor.idVendor); + + if (dev->descriptor.iProduct) + { + ret = usb_get_string_simple(udev, dev->descriptor.iProduct, string, + sizeof(string)); + if (ret > 0) + snprintf(description + strlen(description), sizeof(description) - + strlen(description), "%s", string); + else + snprintf(description + strlen(description), sizeof(description) - + strlen(description), "%04X", dev->descriptor.idProduct); + } + else + snprintf(description + strlen(description), sizeof(description) - + strlen(description), "%04X", dev->descriptor.idProduct); + + } + else + snprintf(description, sizeof(description), "%04X - %04X", + dev->descriptor.idVendor, dev->descriptor.idProduct); + + printf("\n%.*sDev #%d: %s", level * 2, " ", dev->devnum, + description); + + if (udev && verbose) + { + if (dev->descriptor.iSerialNumber) + { + ret = usb_get_string_simple(udev, dev->descriptor.iSerialNumber, string, + sizeof(string)); + if (ret > 0) + printf(" - Serial Number: %s\n", string); + } + else + printf("\n"); + } + else + printf("\n"); + + if (verbose) + print_device_descriptor(&dev->descriptor, level * 2); + + if (udev) + usb_close(udev); + + if (verbose) + { + if (!dev->config) + { + printf(" Couldn't retrieve descriptors\n"); + return 0; + } + + for (i = 0; i < dev->descriptor.bNumConfigurations; i++) + print_configuration(&dev->config[i]); + } + else + { + for (i = 0; i < dev->num_children; i++) + print_device(dev->children[i], level + 1); + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + struct usb_bus *bus; + + if (argc > 1 && !strcmp(argv[1], "-v")) + verbose = 1; + + usb_init(); + usb_set_debug(255); + + usb_find_busses(); + usb_find_devices(); + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + if (bus->root_dev && !verbose) + print_device(bus->root_dev, 0); + else + { + struct usb_device *dev; + + for (dev = bus->devices; dev; dev = dev->next) + print_device(dev, 0); + } + } + + return 0; +} + diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_rc.rc new file mode 100644 index 0000000..2c6018d --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_rc.rc @@ -0,0 +1,25 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2006 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "libusb-win32 - Test Program" +#define RC_FILE_NAME_STR "testlibusb.exe" + +#include "libusb-win32_version.rc" diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win.c b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win.c new file mode 100644 index 0000000..00e8321 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win.c @@ -0,0 +1,475 @@ +/* libusb-win32, Generic Windows USB Library + * Copyright (c) 2002-2004 Stephan Meyer + * Copyright (c) 2000-2004 Johannes Erdfelt + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#ifdef __GNUC__ + #ifndef WINVER + #define WINVER 0x0500 + #endif +#endif + +#define INITGUID + +#include +#include +#include +#include + +#include "usb.h" + + +#define LIBUSB_WINDOW_CLASS "LIBUSB_WINDOW_CLASS" +#define LIBUSB_BUTTON_HEIGHT 30 +#define LIBUSB_BUTTON_WIDTH 70 +#define LIBUSB_BORDER 10 + +DEFINE_GUID(GUID_DEVINTERFACE_USB_HUB, 0xf18a0e88, 0xc30c, 0x11d0, 0x88, \ + 0x15, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0xd8); + +DEFINE_GUID(GUID_DEVINTERFACE_USB_DEVICE, 0xA5DCBF10L, 0x6530, 0x11D2, \ + 0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED); + +#define EDIT_BUF_INCREMENT 1024 + +enum +{ + ID_EXIT = 100, + ID_REFRESH, + ID_EDIT +}; + +static char *edit_buffer = NULL; +static int edit_buffer_size = 0; +static int edit_buffer_pos = 0; + +static HWND main_win; +static HWND exit_button; +static HWND refresh_button; +static HWND edit_box; + +static HDEVNOTIFY notification_handle_hub, notification_handle_dev; + +LRESULT CALLBACK win_proc(HWND handle, UINT message, WPARAM w_param, + LPARAM l_param); + +static void on_size(int width, int height); +static void on_refresh(void); + +static void edit_printf_init(void); +static void edit_printf_free(void); +static void edit_printf(const char *s, ...); + +static void print_configuration(struct usb_config_descriptor *config); +static void print_interface(struct usb_interface *interface); +static void print_altsetting(struct usb_interface_descriptor *interface); +static void print_endpoint(struct usb_endpoint_descriptor *endpoint); +static void print_device_descriptor(struct usb_device_descriptor *desc, int indent); + +int APIENTRY WinMain(HINSTANCE instance, HINSTANCE prev_instance, + LPSTR cmd_line, int cmd_show) +{ + MSG msg; + WNDCLASSEX win_class; + DEV_BROADCAST_DEVICEINTERFACE dev_if; + + LoadLibrary("comctl32.dll"); + + win_class.cbSize = sizeof(WNDCLASSEX); + + win_class.style = CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS ; + win_class.lpfnWndProc = win_proc; + win_class.cbClsExtra = 0; + win_class.cbWndExtra = 0; + win_class.hInstance = instance; + win_class.hIcon = NULL; + win_class.hCursor = LoadCursor(NULL, IDC_ARROW); + win_class.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); + win_class.lpszMenuName = NULL; + win_class.lpszClassName = LIBUSB_WINDOW_CLASS; + win_class.hIconSm = NULL; + + RegisterClassEx(&win_class); + + main_win = CreateWindowEx(WS_EX_APPWINDOW| WS_EX_CONTROLPARENT, + LIBUSB_WINDOW_CLASS, + "TestLibUsb - Windows Version", + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN + | WS_DLGFRAME, + CW_USEDEFAULT, 0, 500, 500, NULL, NULL, + instance, NULL); + if (!main_win) + { + return FALSE; + } + + + exit_button = CreateWindow("BUTTON", "Exit", + WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, + 10, 10, + LIBUSB_BUTTON_WIDTH, LIBUSB_BUTTON_HEIGHT, + main_win, (HMENU) ID_EXIT, instance, NULL); + + refresh_button = CreateWindow("BUTTON", "Refresh", + WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, + 10, 100, + LIBUSB_BUTTON_WIDTH, LIBUSB_BUTTON_HEIGHT, + main_win, (HMENU) ID_REFRESH, instance, + NULL); + + edit_box = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", NULL, + WS_CHILD | WS_VISIBLE | WS_VSCROLL | + ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL + | ES_AUTOHSCROLL | ES_READONLY, + CW_USEDEFAULT, CW_USEDEFAULT, + CW_USEDEFAULT, CW_USEDEFAULT, + main_win, (HMENU) ID_EDIT, instance, NULL); + + SendMessage(edit_box, WM_SETFONT, (WPARAM) CreateFont(13, 8, 0, 0, + 400, 0, 0, 0, + 0, 1, 2, 1, + 49, "Courier"), 0); + + ShowWindow(main_win, cmd_show); + UpdateWindow(main_win); + BringWindowToTop(main_win); + + usb_set_debug(4); + usb_init(); + usb_find_busses(); + + on_refresh(); + + dev_if.dbcc_size = sizeof(dev_if); + dev_if.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_HUB; + + notification_handle_hub = RegisterDeviceNotification(main_win, &dev_if, 0); + + dev_if.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE; + + notification_handle_dev = RegisterDeviceNotification(main_win, &dev_if, 0); + + while (GetMessage(&msg, NULL, 0, 0) ) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + DestroyWindow(main_win); + UnregisterClass(LIBUSB_WINDOW_CLASS, instance); + + return 0; +} + + +LRESULT CALLBACK win_proc(HWND win, UINT message, WPARAM w_param, + LPARAM l_param) +{ + DEV_BROADCAST_HDR *hdr = (DEV_BROADCAST_HDR *) l_param; + + switch (message) + { + case WM_DESTROY: + if (notification_handle_hub) + UnregisterDeviceNotification(notification_handle_hub); + if (notification_handle_dev) + UnregisterDeviceNotification(notification_handle_dev); + + PostQuitMessage(0); + break; + + case WM_SIZE: + on_size(LOWORD(l_param), HIWORD(l_param)); + break; + + case WM_COMMAND: + switch (LOWORD(w_param)) + { + case ID_EXIT: + PostQuitMessage(0); + break; + case ID_REFRESH: + on_refresh(); + break; + default: + return DefWindowProc(win, message, w_param, l_param ); + } + break; + + case WM_DEVICECHANGE: + switch (w_param) + { + case DBT_DEVICEREMOVECOMPLETE: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + on_refresh(); + break; + case DBT_DEVICEARRIVAL: + if (hdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) + on_refresh(); + break; + default: + ; + } + break; + + default: + return DefWindowProc(win, message, w_param, l_param); + } + + return 0; +} + +static void on_size(int width, int height) +{ + int _width, _height, _x, _y; + + _width = LIBUSB_BUTTON_WIDTH; + _height = LIBUSB_BUTTON_HEIGHT; + _x = width - LIBUSB_BORDER - LIBUSB_BUTTON_WIDTH; + _y = height - LIBUSB_BORDER - LIBUSB_BUTTON_HEIGHT; + + SetWindowPos(exit_button, HWND_TOP, _x, _y, _width, _height, + SWP_SHOWWINDOW); + + _x -= LIBUSB_BUTTON_WIDTH + LIBUSB_BORDER; + SetWindowPos(refresh_button, HWND_TOP, _x, _y, _width, _height, + SWP_SHOWWINDOW); + + _width = width - 2 * LIBUSB_BORDER; + _height = height - 4 * LIBUSB_BORDER - LIBUSB_BUTTON_HEIGHT; + _y = LIBUSB_BORDER; + _x = LIBUSB_BORDER; + + SetWindowPos(edit_box, HWND_TOP, _x, _y, _width, _height, + SWP_SHOWWINDOW); +} + +static void on_refresh(void) +{ + struct usb_bus *bus; + struct usb_device *dev; + const struct usb_version *version; + + edit_printf_init(); + + usb_find_devices(); + + version = usb_get_version(); + + if (version) + { + edit_printf("DLL version:\t%d.%d.%d.%d\r\n", + version->dll.major, version->dll.minor, + version->dll.micro, version->dll.nano); + + edit_printf("Driver version:\t%d.%d.%d.%d\r\n\r\n", + version->driver.major, version->driver.minor, + version->driver.micro, version->driver.nano); + } + + edit_printf("bus/device idVendor/idProduct\r\n"); + + for (bus = usb_get_busses(); bus; bus = bus->next) + { + for (dev = bus->devices; dev; dev = dev->next) + { + int ret, i; + char string[256]; + usb_dev_handle *udev; + + edit_printf("%s/%s %04X/%04X\r\n", bus->dirname, dev->filename, + dev->descriptor.idVendor, dev->descriptor.idProduct); + udev = usb_open(dev); + + if (udev) + { + if (dev->descriptor.iManufacturer) + { + ret = usb_get_string_simple(udev, dev->descriptor.iManufacturer, + string, sizeof(string)); + if (ret > 0) + edit_printf("- Manufacturer : %s\r\n", string); + else + edit_printf("- Unable to fetch manufacturer string\r\n"); + } + + if (dev->descriptor.iProduct) + { + ret = usb_get_string_simple(udev, dev->descriptor.iProduct, string, + sizeof(string)); + if (ret > 0) + edit_printf("- Product : %s\r\n", string); + else + edit_printf("- Unable to fetch product string\r\n"); + } + + if (dev->descriptor.iSerialNumber) + { + ret = usb_get_string_simple(udev, dev->descriptor.iSerialNumber, + string, sizeof(string)); + if (ret > 0) + edit_printf("- Serial Number: %s\r\n", string); + else + edit_printf("- Unable to fetch serial number string\r\n"); + } + + usb_close (udev); + } + + print_device_descriptor(&dev->descriptor,0); + + if (!dev->config) + { + edit_printf(" Couldn't retrieve descriptors\r\n"); + continue; + } + + for (i = 0; i < dev->descriptor.bNumConfigurations; i++) + print_configuration(&dev->config[i]); + } + } + + SendMessage(edit_box, WM_SETTEXT, 0, (LPARAM) edit_buffer); + edit_printf_free(); +} + +static void edit_printf_init(void) +{ + if (edit_buffer) + { + free(edit_buffer); + } + + edit_buffer = malloc(EDIT_BUF_INCREMENT); + + if (edit_buffer) + { + edit_buffer_size = EDIT_BUF_INCREMENT; + } + edit_buffer_size = 0; + edit_buffer_pos = 0; +} + +static void edit_printf_free(void) +{ + if (edit_buffer) + { + free(edit_buffer); + } + edit_buffer = NULL; + edit_buffer_size = 0; + edit_buffer_pos = 0; +} + +static void edit_printf(const char *s, ...) +{ + va_list args; + va_start(args, s); + + if (edit_buffer_size - edit_buffer_pos < EDIT_BUF_INCREMENT) + { + char *tmp = realloc(edit_buffer, + edit_buffer_size + EDIT_BUF_INCREMENT); + + if (tmp) + { + edit_buffer = tmp; + edit_buffer_size += EDIT_BUF_INCREMENT; + } + else + { + return; + } + } + + edit_buffer_pos += vsnprintf(edit_buffer + edit_buffer_pos, + EDIT_BUF_INCREMENT - 1, s, args); + va_end(args); +} + + +static void print_endpoint(struct usb_endpoint_descriptor *endpoint) +{ + edit_printf(" bEndpointAddress: %02xh\r\n", endpoint->bEndpointAddress); + edit_printf(" bmAttributes: %02xh\r\n", endpoint->bmAttributes); + edit_printf(" wMaxPacketSize: %d\r\n", endpoint->wMaxPacketSize); + edit_printf(" bInterval: %d\r\n", endpoint->bInterval); + edit_printf(" bRefresh: %d\r\n", endpoint->bRefresh); + edit_printf(" bSynchAddress: %d\r\n", endpoint->bSynchAddress); +} + + +static void print_altsetting(struct usb_interface_descriptor *interface) +{ + int i; + + edit_printf(" bInterfaceNumber: %d\r\n", interface->bInterfaceNumber); + edit_printf(" bAlternateSetting: %d\r\n", interface->bAlternateSetting); + edit_printf(" bNumEndpoints: %d\r\n", interface->bNumEndpoints); + edit_printf(" bInterfaceClass: %d\r\n", interface->bInterfaceClass); + edit_printf(" bInterfaceSubClass: %d\r\n", interface->bInterfaceSubClass); + edit_printf(" bInterfaceProtocol: %d\r\n", interface->bInterfaceProtocol); + edit_printf(" iInterface: %d\r\n", interface->iInterface); + + for (i = 0; i < interface->bNumEndpoints; i++) + print_endpoint(&interface->endpoint[i]); +} + + +static void print_interface(struct usb_interface *interface) +{ + int i; + + for (i = 0; i < interface->num_altsetting; i++) + print_altsetting(&interface->altsetting[i]); +} + + +static void print_configuration(struct usb_config_descriptor *config) +{ + int i; + + edit_printf(" wTotalLength: %d\r\n", config->wTotalLength); + edit_printf(" bNumInterfaces: %d\r\n", config->bNumInterfaces); + edit_printf(" bConfigurationValue: %d\r\n", config->bConfigurationValue); + edit_printf(" iConfiguration: %d\r\n", config->iConfiguration); + edit_printf(" bmAttributes: %02xh\r\n", config->bmAttributes); + edit_printf(" MaxPower: %d\r\n", config->MaxPower); + + for (i = 0; i < config->bNumInterfaces; i++) + print_interface(&config->interface[i]); +} + +static void print_device_descriptor(struct usb_device_descriptor *desc, int indent) +{ + edit_printf("%.*sbLength: %u\r\n", indent, " ", desc->bLength); + edit_printf("%.*sbDescriptorType: %02Xh\r\n", indent, " ", desc->bDescriptorType); + edit_printf("%.*sbcdUSB: %04Xh\r\n", indent, " ", desc->bcdUSB); + edit_printf("%.*sbDeviceClass: %02Xh\r\n", indent, " ", desc->bDeviceClass); + edit_printf("%.*sbDeviceSubClass: %02Xh\r\n", indent, " ", desc->bDeviceSubClass); + edit_printf("%.*sbDeviceProtocol: %02Xh\r\n", indent, " ", desc->bDeviceProtocol); + edit_printf("%.*sbMaxPacketSize0: %02Xh\r\n", indent, " ", desc->bMaxPacketSize0); + edit_printf("%.*sidVendor: %04Xh\r\n", indent, " ", desc->idVendor); + edit_printf("%.*sidProduct: %04Xh\r\n", indent, " ", desc->idProduct); + edit_printf("%.*sbcdDevice: %04Xh\r\n", indent, " ", desc->bcdDevice); + edit_printf("%.*siManufacturer: %u\r\n", indent, " ", desc->iManufacturer); + edit_printf("%.*siProduct: %u\r\n", indent, " ", desc->iProduct); + edit_printf("%.*siSerialNumber: %u\r\n", indent, " ", desc->iSerialNumber); + edit_printf("%.*sbNumConfigurations: %u\r\n", indent, " ", desc->bNumConfigurations); +} diff --git a/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win_rc.rc b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win_rc.rc new file mode 100644 index 0000000..6e73382 --- /dev/null +++ b/PcDmis/ThirdParty/UsbSupport/libusb-win32-src-1.2.4.0/tests/testlibusb_win_rc.rc @@ -0,0 +1,27 @@ +/* libusb-win32, Generic Windows USB Library +* Copyright (c) 2002-2006 Stephan Meyer +* Copyright (c) 2010 Travis Robinson +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#define RC_FILE_TYPE VFT_APP +#define RC_FILE_SUB_TYPE VFT2_UNKNOWN +#define RC_PRODUCT_STR "libusb-win32 - Test Program" +#define RC_FILE_NAME_STR "testlibusb-win.exe" + +#include "libusb-win32_version.rc" + +ID_MANIFEST RT_MANIFEST "common_controls.manifest" diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog new file mode 100644 index 0000000..750c4cc Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog new file mode 100644 index 0000000..33d96e3 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog new file mode 100644 index 0000000..71935c2 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.vcxprojResolveAssemblyReference.cache b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.vcxprojResolveAssemblyReference.cache new file mode 100644 index 0000000..a06c952 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb-dll.vcxprojResolveAssemblyReference.cache differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp new file mode 100644 index 0000000..5474135 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.exp differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog new file mode 100644 index 0000000..e153e3a --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^D:\PcDmis\2012_MR1_QA\ThirdParty\UsbSupport\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +D:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\Tools\UsbUtility\Win32\Debug\libusb0\libusb0.lib +D:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\Tools\UsbUtility\Win32\Debug\libusb0\libusb0.lib +D:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\Tools\UsbUtility\Win32\Debug\libusb0\libusb0.exp +D:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\Tools\UsbUtility\Win32\Debug\libusb0\libusb0.exp diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.3340.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.4472.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.696.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.8660.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog new file mode 100644 index 0000000..46e2fb9 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog new file mode 100644 index 0000000..581cdbf Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog new file mode 100644 index 0000000..a1f7f98 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog new file mode 100644 index 0000000..262698f Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog new file mode 100644 index 0000000..e706cd3 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog new file mode 100644 index 0000000..9f35d96 Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/resource.res b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/resource.res differ diff --git a/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb new file mode 100644 index 0000000..d2084af Binary files /dev/null and b/PcDmis/UsbSupport/LibUsb_Win/lib/msvc/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls.manifest new file mode 100644 index 0000000..ad29edc --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls.manifest @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls_admin.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls_admin.manifest new file mode 100644 index 0000000..8d2ef29 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/common_controls_admin.manifest @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/objchk_win7_x86/i386/install_filter_win_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/objchk_win7_x86/i386/install_filter_win_rc.res new file mode 100644 index 0000000..3923d0e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/ddk_make/objchk_win7_x86/i386/install_filter_win_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/Benchmark.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/embedder_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x64_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/installer_x86_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/additional/libwdi/libwdi/libwdi_static_2008.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/inf-wizard.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter-win.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/install-filter.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-8780aa94/install-filter-a4be4eca.ipch b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-8780aa94/install-filter-a4be4eca.ipch new file mode 100644 index 0000000..1a8fb94 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/install-filter-8780aa94/install-filter-a4be4eca.ipch differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/libusb-dll-b5b78a94/libusb0-ccb563d8.ipch b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/libusb-dll-b5b78a94/libusb0-ccb563d8.ipch new file mode 100644 index 0000000..99a2093 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/ipch/libusb-dll-b5b78a94/libusb0-ccb563d8.ipch differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user new file mode 100644 index 0000000..e2fb23a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-dll.vcxproj.user @@ -0,0 +1,7 @@ + + + + E:\PcDmis\2012_MR1_QA\Pcdlrn\INTERFAC\MSI\HSI\MicroVu\Mv_Util\Debug\Mv_Util.exe + WindowsLocalDebugger + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-sys.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo new file mode 100644 index 0000000..4f3d68f Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/libusb-win32.suo differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testbulk.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb-win.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user new file mode 100644 index 0000000..695b5c7 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/testlibusb.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.Build.CppClean.log new file mode 100644 index 0000000..7e2b7f9 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.Build.CppClean.log @@ -0,0 +1,30 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK.EXE.INTERMEDIATE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\BENCHMARK_RC.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\BENCHMARK\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.exe.intermediate.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\benchmark.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\benchmark_rc.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\mt.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\mt.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\mt.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.exe.intermediate.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.log new file mode 100644 index 0000000..4bda8b2 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.log @@ -0,0 +1,19 @@ +Build started 3/28/2012 2:14:00 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\Benchmark.vcxproj" on node 4 (build target(s)). + 1>InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + All outputs are up-to-date. + ResourceCompile: + All outputs are up-to-date. + Link: + All outputs are up-to-date. + Benchmark.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.exe + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\Benchmark\Benchmark.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\Benchmark.vcxproj" (build target(s)). + +Build succeeded. + +Time Elapsed 00:00:00.23 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/Benchmark.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.read.1.tlog new file mode 100644 index 0000000..b32c348 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.write.1.tlog new file mode 100644 index 0000000..f9af119 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/benchmark_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/benchmark_rc.res new file mode 100644 index 0000000..5c2eb36 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/benchmark_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/cl.command.1.tlog new file mode 100644 index 0000000..8299c83 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.command.1.tlog new file mode 100644 index 0000000..658e7bd Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.read.1.tlog new file mode 100644 index 0000000..b475c86 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.write.1.tlog new file mode 100644 index 0000000..a98d064 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.command.1.tlog new file mode 100644 index 0000000..63da48b Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.read.1.tlog new file mode 100644 index 0000000..373cb4c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.write.1.tlog new file mode 100644 index 0000000..71c3c72 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/mt.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.command.1.tlog new file mode 100644 index 0000000..eae2eeb Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.read.1.tlog new file mode 100644 index 0000000..5e0ca7e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.write.1.tlog new file mode 100644 index 0000000..24daa73 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/vc100.idb new file mode 100644 index 0000000..60ce707 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/Benchmark/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.read.1.tlog new file mode 100644 index 0000000..bc4a1d0 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.write.1.tlog new file mode 100644 index 0000000..8b0d6ac Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/cl.command.1.tlog new file mode 100644 index 0000000..2d0d251 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.Build.CppClean.log new file mode 100644 index 0000000..9cf69ac --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.Build.CppClean.log @@ -0,0 +1,40 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64\INSTALLER.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64\INSTALLER_X64.EXE.EMBED.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64\INSTALLER_X64.EXE.EMBED.MANIFEST.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64\INSTALLER_X64.EXE.INTERMEDIATE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\HELPER\INSTALLER_X64\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.intermediate.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64_manifest.rc +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.2060.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.2060.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.2060-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.2060-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.5332.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.5332.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.5332-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.5332-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\mt.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\mt.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\mt.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest new file mode 100644 index 0000000..e693382 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest.res new file mode 100644 index 0000000..9c8df0e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.embed.manifest.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.intermediate.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.intermediate.manifest new file mode 100644 index 0000000..1c06b61 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.exe.intermediate.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_2008.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_2008.log new file mode 100644 index 0000000..794fbbf --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_2008.log @@ -0,0 +1,31 @@ +Build started 3/28/2012 1:36:56 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\additional\libwdi\libwdi\installer_x64_2008.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /Zi /nologo /W3 /WX- /Od /D _CRT_SECURE_NO_WARNINGS /D _WIN64 /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\vc100.pdb" /Gd /TC /errorReport:prompt installer.c + installer.c + ManifestResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest.res" D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64_manifest.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.exe" /INCREMENTAL /NOLOGO newdev.lib setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer.obj" + installer_x64_2008.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.exe + Manifest: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest". + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest" /manifest "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.intermediate.manifest" + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest.res" D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64_manifest.rc + LinkEmbedManifest: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.exe" /INCREMENTAL /NOLOGO newdev.lib setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.exe.embed.manifest.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer.obj" + installer_x64_2008.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64.exe + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\helper\installer_x64\installer_x64.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\additional\libwdi\libwdi\installer_x64_2008.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.48 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_manifest.rc b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_manifest.rc new file mode 100644 index 0000000..c716766 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/installer_x64_manifest.rc differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.2676.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.command.1.tlog new file mode 100644 index 0000000..14e7d19 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.read.1.tlog new file mode 100644 index 0000000..ae237f9 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.write.1.tlog new file mode 100644 index 0000000..4af1f41 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.command.1.tlog new file mode 100644 index 0000000..2ec784c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.read.1.tlog new file mode 100644 index 0000000..aa276db Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.write.1.tlog new file mode 100644 index 0000000..f6f5fee Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/mt.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.command.1.tlog new file mode 100644 index 0000000..3eae40a Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.read.1.tlog new file mode 100644 index 0000000..4bbb423 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.write.1.tlog new file mode 100644 index 0000000..8400e5c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/vc100.idb new file mode 100644 index 0000000..13e7d0e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/helper/installer_x64/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.read.1.tlog new file mode 100644 index 0000000..922871a Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.write.1.tlog new file mode 100644 index 0000000..5297ccb Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/cl.command.1.tlog new file mode 100644 index 0000000..3eae5c9 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.Build.CppClean.log new file mode 100644 index 0000000..fae9861 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.Build.CppClean.log @@ -0,0 +1,30 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\ERROR.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL_FILTER.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL_FILTER_RC.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL-FILTER.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL-FILTER.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\INSTALL-FILTER.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\REGISTRY.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\INSTALL-FILTER\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\error.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install_filter.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install_filter_rc.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\registry.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.log new file mode 100644 index 0000000..0e06930 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install-filter.log @@ -0,0 +1,30 @@ +Build started 3/28/2012 1:36:56 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\install-filter.vcxproj" on node 5 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I..\src /I..\src\driver /Zi /nologo /W3 /WX- /Od /D _WIN32_WINNT=0x0501 /D TARGETTYPE=PROGRAMconsole /D "LOG_APPNAME=\"install-filter\"" /D LOG_STYLE_SHORT /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\vc100.pdb" /Gd /TC /wd4996 /errorReport:prompt ..\src\error.c ..\src\install.c ..\src\install_filter.c ..\src\registry.c + registry.c + install_filter.c + install.c + error.c + Generating Code... + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"install-filter\"" /D "MANIFEST_FILE=\"..\\manifest_AMD64.xml\"" /l"0x0409" /I..\src /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install_filter_rc.res" ..\src\install_filter_rc.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.exe" /NOLOGO setupapi.lib kernel32.lib user32.lib gdi32.lib advapi32.lib /MANIFEST:NO /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install_filter_rc.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\error.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install_filter.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\registry.obj" + install-filter.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.exe + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\install-filter\install-filter.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\install-filter.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:02.57 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install_filter_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install_filter_rc.res new file mode 100644 index 0000000..7d0f327 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/install_filter_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.command.1.tlog new file mode 100644 index 0000000..270b3a8 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.read.1.tlog new file mode 100644 index 0000000..e0c1c3d Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.write.1.tlog new file mode 100644 index 0000000..10c2a37 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.command.1.tlog new file mode 100644 index 0000000..0391711 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.read.1.tlog new file mode 100644 index 0000000..f7bac1d Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.write.1.tlog new file mode 100644 index 0000000..608d780 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/vc100.idb new file mode 100644 index 0000000..e112bb8 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/install-filter/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb-sys/libusb-sys.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb-sys/libusb-sys.log new file mode 100644 index 0000000..d81554a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb-sys/libusb-sys.log @@ -0,0 +1,14 @@ +Build started 3/28/2012 2:13:59 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\libusb-sys.vcxproj" on node 2 (build target(s)). + 1>Build: + CD "D:\libusb-win32-src-1.2.4.0\projects\..\ddk_make" + CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb-sys\" "DIR_INTERMEDIATE=D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb-sys\" "debugmode=true" + Libusb-Win32 directory = D:\libusb-win32-src-1.2.4.0\ + Invalid WinDDK Directory Z:\WinDDK\6001.18002\ + 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "CD "D:\libusb-win32-src-1.2.4.0\projects\..\ddk_make" +C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error MSB3073: CMD /C make.cmd "arch=x86" "app=driver" "noclean=true" "outdir=D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb-sys\" "DIR_INTERMEDIATE=D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb-sys\" "debugmode=true"" exited with code 1. + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\libusb-sys.vcxproj" (build target(s)) -- FAILED. + +Build FAILED. + +Time Elapsed 00:00:00.38 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.read.1.tlog new file mode 100644 index 0000000..b1a8f63 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.write.1.tlog new file mode 100644 index 0000000..71e1c73 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/cl.command.1.tlog new file mode 100644 index 0000000..c764a54 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb-dll.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb-dll.log new file mode 100644 index 0000000..683e07c --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb-dll.log @@ -0,0 +1,35 @@ +Build started 3/28/2012 1:36:56 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" on node 3 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I..\src /I..\src\driver /Zi /nologo /W3 /WX- /Od /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"libusb0\"" /D TARGETTYPE=DYNLINK /D _WINDLL /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\vc100.pdb" /Gd /TC /wd4996 /errorReport:prompt ..\src\descriptors.c ..\src\error.c ..\src\install.c ..\src\registry.c ..\src\usb.c ..\src\windows.c + windows.c + usb.c + registry.c + install.c + error.c + descriptors.c + Generating Code... + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"libusb0\"" /D "MANIFEST_FILE=\"..\\manifest_x86.xml\"" /l"0x0409" /I..\src /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\resource.res" ..\src\resource.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.dll" /NOLOGO setupapi.lib kernel32.lib advapi32.lib user32.lib shell32.lib gdi32.lib /DEF:"..\libusb0.def" /MANIFEST:NO /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib" /MACHINE:X64 /DLL "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\resource.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\descriptors.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\error.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\install.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\registry.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\usb.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\windows.obj" + Creating library D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib and object D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.exp + libusb-dll.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.dll + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:03.58 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.Build.CppClean.log new file mode 100644 index 0000000..e596b04 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.Build.CppClean.log @@ -0,0 +1,38 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\DESCRIPTORS.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\ERROR.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\INSTALL.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\LIBUSB0.DLL +C:\Users\Edward Tse\Desktop\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.exp +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\LIBUSB0.ILK +C:\Users\Edward Tse\Desktop\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\LIBUSB0.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\REGISTRY.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\RESOURCE.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\USB.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\VC100.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\LIBUSB0\WINDOWS.OBJ +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\descriptors.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\error.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\install.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.dll +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.exp +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\registry.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\resource.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\usb.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\vc100.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\windows.obj diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.exp b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.exp new file mode 100644 index 0000000..f86989e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.exp differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lib b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lib new file mode 100644 index 0000000..815ea20 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.lib differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.write.1.tlog new file mode 100644 index 0000000..fac3e3a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/libusb0.write.1.tlog @@ -0,0 +1,5 @@ +^D:\libusb-win32-src-1.2.4.0\projects\libusb-dll.vcxproj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.exp +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.exp diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.command.1.tlog new file mode 100644 index 0000000..cd3f095 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.read.1.tlog new file mode 100644 index 0000000..02fe60c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.write.1.tlog new file mode 100644 index 0000000..470ee20 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.command.1.tlog new file mode 100644 index 0000000..e694f5f Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.read.1.tlog new file mode 100644 index 0000000..f3fd819 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.write.1.tlog new file mode 100644 index 0000000..1c86fd0 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/resource.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/resource.res new file mode 100644 index 0000000..cbf19ed Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/resource.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/vc100.idb new file mode 100644 index 0000000..c9054e7 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/libusb0/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.read.1.tlog new file mode 100644 index 0000000..9bbc4ca Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.write.1.tlog new file mode 100644 index 0000000..25d9175 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/cl.command.1.tlog new file mode 100644 index 0000000..b3c4fdf Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.command.1.tlog new file mode 100644 index 0000000..a3b45aa Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.read.1.tlog new file mode 100644 index 0000000..c351af5 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.write.1.tlog new file mode 100644 index 0000000..4783c0a Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.command.1.tlog new file mode 100644 index 0000000..b11d63a Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.read.1.tlog new file mode 100644 index 0000000..7f0bf12 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.write.1.tlog new file mode 100644 index 0000000..2527c4b Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/mt.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.command.1.tlog new file mode 100644 index 0000000..272657c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.read.1.tlog new file mode 100644 index 0000000..c965a3f Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.write.1.tlog new file mode 100644 index 0000000..9bd62a8 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.Build.CppClean.log new file mode 100644 index 0000000..1f91069 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.Build.CppClean.log @@ -0,0 +1,32 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\BULK.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK.EXE.INTERMEDIATE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK.EXE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\TESTBULK_RC.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTBULK\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\bulk.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\mt.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\mt.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\mt.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe.intermediate.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk_rc.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.intermediate.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.manifest new file mode 100644 index 0000000..cca7079 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.exe.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.log new file mode 100644 index 0000000..cc857c6 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.log @@ -0,0 +1,26 @@ +Build started 3/28/2012 1:37:00 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\testbulk.vcxproj" on node 5 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I..\src /Zi /nologo /W3 /WX- /Od /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"testbulk\"" /D snprintf=_snprintf /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\vc100.pdb" /Gd /TC /wd4996 /errorReport:prompt ..\examples\bulk.c + bulk.c + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"testbulk\"" /l"0x0409" /I..\src /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk_rc.res" ..\examples\testbulk_rc.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe" /NOLOGO kernel32.lib advapi32.lib user32.lib setupapi.lib /MANIFEST /ManifestFile:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe.intermediate.manifest" /MANIFESTUAC:NO /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk_rc.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\bulk.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib" + testbulk.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe + Manifest: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe.manifest" /manifest "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.exe.intermediate.manifest" + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testbulk\testbulk.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\testbulk.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.21 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk_rc.res new file mode 100644 index 0000000..efb36ef Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/testbulk_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/vc100.idb new file mode 100644 index 0000000..64328ad Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testbulk/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.read.1.tlog new file mode 100644 index 0000000..664536b Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.write.1.tlog new file mode 100644 index 0000000..f13105e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/cl.command.1.tlog new file mode 100644 index 0000000..a4b6a06 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.command.1.tlog new file mode 100644 index 0000000..58e4407 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.read.1.tlog new file mode 100644 index 0000000..a79a1b1 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.write.1.tlog new file mode 100644 index 0000000..6b52e81 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.command.1.tlog new file mode 100644 index 0000000..febb9c6 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.read.1.tlog new file mode 100644 index 0000000..777bafb Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.write.1.tlog new file mode 100644 index 0000000..402302e Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/mt.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.command.1.tlog new file mode 100644 index 0000000..305ad02 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.read.1.tlog new file mode 100644 index 0000000..b984a0f Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.write.1.tlog new file mode 100644 index 0000000..df87805 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log new file mode 100644 index 0000000..9dc7a9b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.Build.CppClean.log @@ -0,0 +1,33 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB_WIN_RC.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.INTERMEDIATE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.EXE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\TESTLIBUSB-WIN.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB-WIN\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\mt.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\mt.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\mt.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\ResolveAssemblyReference.cache +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb_win.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb_win_rc.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.manifest new file mode 100644 index 0000000..cca7079 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.exe.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.log new file mode 100644 index 0000000..631c758 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.log @@ -0,0 +1,26 @@ +Build started 3/28/2012 1:37:00 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I..\src /Zi /nologo /W3 /WX- /Od /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"testlibusb-win\"" /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\vc100.pdb" /Gd /TC /wd4996 /errorReport:prompt ..\tests\testlibusb_win.c + testlibusb_win.c + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"testlibusb-win\"" /D "MANIFEST_FILE=\"..\\manifest_AMD64.xml\"" /l"0x0409" /I..\src /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb_win_rc.res" ..\tests\testlibusb_win_rc.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe" /NOLOGO kernel32.lib user32.lib gdi32.lib advapi32.lib setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" /MANIFESTUAC:NO /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb_win_rc.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb_win.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib" + testlibusb-win.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe + Manifest: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe.manifest" /manifest "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.exe.intermediate.manifest" + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb-win\testlibusb-win.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\testlibusb-win.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.27 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb-win.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb_win_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb_win_rc.res new file mode 100644 index 0000000..faaf2fa Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/testlibusb_win_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/vc100.idb new file mode 100644 index 0000000..4e9e25c Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb-win/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.read.1.tlog new file mode 100644 index 0000000..ad876c6 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.write.1.tlog new file mode 100644 index 0000000..400c180 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/CL.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/cl.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/cl.command.1.tlog new file mode 100644 index 0000000..f3d5b13 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/cl.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.read.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.read.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.write.1.tlog new file mode 100644 index 0000000..46b134b --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link-cvtres.write.1.tlog @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.command.1.tlog new file mode 100644 index 0000000..b10c5ba Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.read.1.tlog new file mode 100644 index 0000000..d5df0fe Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.write.1.tlog new file mode 100644 index 0000000..02af0cb Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/link.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.command.1.tlog new file mode 100644 index 0000000..d0cfd0a Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.read.1.tlog new file mode 100644 index 0000000..e884db3 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.write.1.tlog new file mode 100644 index 0000000..e029074 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/mt.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.command.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.command.1.tlog new file mode 100644 index 0000000..7767da9 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.command.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.read.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.read.1.tlog new file mode 100644 index 0000000..6d5d5fb Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.read.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.write.1.tlog new file mode 100644 index 0000000..37dbf6d Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/rc.write.1.tlog differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.Build.CppClean.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.Build.CppClean.log new file mode 100644 index 0000000..137133a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.Build.CppClean.log @@ -0,0 +1,32 @@ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.EXE +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.EXE.INTERMEDIATE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.EXE.MANIFEST +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.ILK +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.OBJ +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB.PDB +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\TESTLIBUSB_RC.RES +C:\USERS\EDWARD TSE\DESKTOP\LIBUSB-WIN32-SRC-1.2.4.0\PROJECTS\X64\DEBUG\TESTLIBUSB\VC100.PDB +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\cl.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\CL.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\CL.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\link.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\link.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\link.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\link-cvtres.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\link-cvtres.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\mt.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\mt.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\mt.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\rc.command.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\rc.read.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\rc.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe.intermediate.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe.manifest +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.ilk +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.obj +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.pdb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.write.1.tlog +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb_rc.res +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\vc100.idb +D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\vc100.pdb diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.intermediate.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.intermediate.manifest new file mode 100644 index 0000000..cdaa604 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.intermediate.manifest @@ -0,0 +1,3 @@ + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.manifest new file mode 100644 index 0000000..cca7079 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.exe.manifest @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.lastbuildstate b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.lastbuildstate new file mode 100644 index 0000000..e3c118a --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100:false +Debug|x64|D:\libusb-win32-src-1.2.4.0\projects\| diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.log b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.log new file mode 100644 index 0000000..79fadf1 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.log @@ -0,0 +1,26 @@ +Build started 3/28/2012 1:37:00 PM. + 1>Project "D:\libusb-win32-src-1.2.4.0\projects\testlibusb.vcxproj" on node 3 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.lastbuildstate". + InitializeBuildStatus: + Creating "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\CL.exe /c /I..\src /Zi /nologo /W3 /WX- /Od /D _WIN32_WINNT=0x0500 /D "LOG_APPNAME=\"testlibusb\"" /D snprintf=_snprintf /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\\" /Fd"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\vc100.pdb" /Gd /TC /wd4996 /errorReport:prompt ..\tests\testlibusb.c + testlibusb.c + ResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /D "LOG_APPNAME=\"testlibusb\"" /l"0x0409" /I..\src /nologo /fo"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb_rc.res" ..\tests\testlibusb_rc.rc + Link: + C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe" /NOLOGO kernel32.lib advapi32.lib user32.lib setupapi.lib /MANIFEST /ManifestFile:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe.intermediate.manifest" /MANIFESTUAC:NO /DEBUG /PDB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.lib" /MACHINE:X64 "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb_rc.res" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.obj" + "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\libusb0\libusb0.lib" + testlibusb.vcxproj -> D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe + Manifest: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe.manifest" /manifest "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.exe.intermediate.manifest" + FinalizeBuildStatus: + Deleting file "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.unsuccessfulbuild". + Touching "D:\libusb-win32-src-1.2.4.0\projects\x64\Debug\testlibusb\testlibusb.lastbuildstate". + 1>Done Building Project "D:\libusb-win32-src-1.2.4.0\projects\testlibusb.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:01.20 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.write.1.tlog b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb.write.1.tlog new file mode 100644 index 0000000..e69de29 diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb_rc.res b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb_rc.res new file mode 100644 index 0000000..6a795a3 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/testlibusb_rc.res differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/vc100.idb b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/vc100.idb new file mode 100644 index 0000000..4f2d431 Binary files /dev/null and b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/projects/x64/Debug/testlibusb/vc100.idb differ diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest new file mode 100644 index 0000000..ad29edc --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls.manifest @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest new file mode 100644 index 0000000..8d2ef29 --- /dev/null +++ b/PcDmis/UsbSupport/libusb-win32-src-1.2.4.0/src/common_controls_admin.manifest @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + +