基于接收工程的一些编译和阅读

This commit is contained in:
zhengxuan.zhang
2022-12-05 10:31:18 +08:00
parent 4bd7d1b80b
commit 53f44ffdbf
440 changed files with 44932 additions and 5461 deletions
+1
View File
@@ -57,3 +57,4 @@ PcDmis/Base/Interfac/Msi/Hsi/Tools/UsbUtility/UtilityDebug.Log
PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/UtilityForSo7Light/Debug/
PcDmis/Base/Interfac/Msi/Hsi/SevenOcean/UtilityForSo7Light/UtilityForSo7Light/Debug/
*.opendb
PcDmis/Base/Interfac/obj/
+10 -10
View File
@@ -284,18 +284,18 @@ enum HSI_MOTION_IO_TYPE
{
HSI_MOTION_INPUT = 0x0001,
HSI_MOTION_INPUT_LIMIT_SWITCH,
HSI_MOTION_INPUT_CH1,//固高、众为兴、EF1输入
HSI_MOTION_INPUT_CH1,//̸ߡΪˡEF1
HSI_MOTION_INPUT_CH2,
HSI_MOTION_INPUT_CH3,//串口控制器输入
HSI_MOTION_INPUT_CH4,//众为兴运动控制卡测试输入
HSI_MOTION_INPUT_ALARM,//驱动报警
HSI_MOTION_INPUT_CH3,//ڿ
HSI_MOTION_INPUT_CH4,//Ϊ˶ƿ
HSI_MOTION_INPUT_ALARM,//
HSI_MOTION_OUTPUT = 0x0100,
HSI_MOTION_OUTPUT_LASER_PEN,
HSI_MOTION_OUTPUT_CH1,//固高、众为兴、EF1输出
HSI_MOTION_OUTPUT_CH1,//̸ߡΪˡEF1
HSI_MOTION_OUTPUT_CH2,
HSI_MOTION_OUTPUT_CH3,//串口控制器输出
HSI_MOTION_OUTPUT_CH4//众为兴运动控制卡测试输出
HSI_MOTION_OUTPUT_CH3,//ڿ
HSI_MOTION_OUTPUT_CH4//Ϊ˶ƿ
};
const UINT HSI_MOTION_AXIS_ALL = HSI_MOTION_AXIS_X | HSI_MOTION_AXIS_Y | HSI_MOTION_AXIS_Z;
@@ -326,9 +326,9 @@ enum HSI_SCAN_MOTION_TYPE
HSI_SCAN_MOTION_SPEC_LOCA = 100,//EF1
HSI_SCAN_MOTION_EQ_DIS,
HSI_SCAN_MOTION_EQ_DIS_II,
HSI_SCAN_MOTION_LINEAR_TEST,//测试使用
HSI_SCAN_MOTION_EQ_TEST,//测试使用
HSI_SCAN_MOTION_MANUAL_TEST//测试使用
HSI_SCAN_MOTION_LINEAR_TEST,//ʹ
HSI_SCAN_MOTION_EQ_TEST,//ʹ
HSI_SCAN_MOTION_MANUAL_TEST//ʹ
};
enum HSI_ZOOM_TYPE
@@ -56,7 +56,7 @@ public:
CKeyence_Laser_LK_H();
~CKeyence_Laser_LK_H();
//»ñÈ¡Êý¾ÝµÄº¯ÊýÖ¸Õë
//获取数据的函数指针
pLKIF2_GetCalcDataMulti m_pGetCalcDataMulti;
pLKIF2_OpenDeviceETHER m_pOpenDeviceETHER;
pLKIF2_OpenDeviceUsb m_pOpenDeviceUsb;
@@ -207,7 +207,7 @@ double CAutoZoom::ReadZoomAngle()
char seps[] = "$AD:";
token = strtok(m_pSO7_Serial->m_RecvData,seps);
token = strtok((char *)m_pSO7_Serial->m_RecvData,seps);
if (token)
{
memcpy(cTemp,token,8);
@@ -3950,7 +3950,7 @@ SSI_STATUS_MOTION CSO7_Proto::_write_usb_data_only(int iEP_Base)
return SSI_STATUS_MOTION_NORMAL;
}
//=================================================================
// false: probe off 当前探头为激光;true: probe on当前探头为接触式.//
// false: probe off ǰ̽ͷΪtrue: probe onǰ̽ͷΪӴʽ.//
//=================================================================
SSI_STATUS_MOTION CSO7_Proto::so7_motion_probe_on_off_(bool _bOnOff)
{
@@ -3983,7 +3983,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_stop_motor_to_get_laser_data()
};
//=================================================================
// false: 关闭夹具 true: 启动夹具. //
// false: رռо true: о. //
//=================================================================
SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_on_off(bool _bOnOff)
{
@@ -3996,7 +3996,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_on_off(bool _bOnOff)
};
//=================================================================
// false: 夹具下 true: 夹具上. //
// false: о true: о. //
//=================================================================
SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_up_down(bool _bOnOff)
{
@@ -4009,7 +4009,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_fixture_up_down(bool _bOnOff)
};
//==================================================================
//false: CT_LASE_TIMMER_ON 关马达; true: CT_LASE_TIMMER_OFF 开马达//
//false: CT_LASE_TIMMER_ON true: CT_LASE_TIMMER_OFF //
//==================================================================
SSI_STATUS_MOTION CSO7_Proto::so7_motion_laser_on_off(bool _bOnOff)
{
@@ -4160,7 +4160,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_motion_Dcc_HomeXYZ(char cHomeMachineMode)
SetEvent(g_hHomedEvent);
return SSI_STATUS_MOTION_NORMAL;
}
//查询是否复位
//ѯǷλ
_send_cmd_SO7_CMD_GET_RESET_FLAG();
g_machine.cVerNumber=3;
if (g_machine.Sys_Reset_Flag == 1)
@@ -4239,7 +4239,7 @@ SSI_STATUS_MOTION CSO7_Proto::so7_Motion_R_IsHomed(bool &bHomed)
//==================================================================
SSI_STATUS_MOTION CSO7_Proto::so7_motion_Dcc_Home_R()
{
//查询是否复位
//ѯǷλ
if (g_so7_config.m_bDebugOutputEnable>=1)
{
g_pLogger->SendAndFlushWithTime(_T("Enter so7_motion_Dcc_Home_R.\n"));
@@ -6054,7 +6054,7 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_X()
*(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+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]);
@@ -6076,7 +6076,7 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Y()
*(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+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]);
@@ -6101,13 +6101,13 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_Z()
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+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+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]);
}
@@ -6134,13 +6134,13 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_ZM()
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+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+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]);
}
@@ -6166,14 +6166,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(char 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[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[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]);
}
@@ -6181,14 +6181,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(char ProbeType)
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[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[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]);
}
@@ -6196,14 +6196,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZ(char ProbeType)
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[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[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]);
}
@@ -6231,14 +6231,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV()
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[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[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]);
}
@@ -6246,14 +6246,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV()
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[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[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]);
}
@@ -6261,14 +6261,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV()
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[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[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]);
}
@@ -6276,14 +6276,14 @@ SSI_STATUS_MOTION CSO7_Proto::_send_cmd_SO7_CMD_MOVE_TO_POS_XYZV()
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[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[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]);
}
@@ -10,7 +10,7 @@
#include "..\Tools\UsbUtility\logger.h"
#include "CMD_H.h"
#include "..\..\..\..\..\ThirdParty\UsbSupport\LibUsb_Win\Include\lusb0_usb.h"
#include "./lusb0_usb.h"
#include "SO7_Proto_Def.h"
#define MAX_BUFF_SIZE 0x200
@@ -97,7 +97,7 @@ void CSo7_Interface::PauseScanAndGetData(void)
//========================================
int CSo7_Interface::Pro_Face_Du(MY3DPoint* pArr, int n, double* Coe, double* Error, double& dis)
{
//g_Set_Face_Flag 1--双向最大值差 2--平均值 3--正向最大值
//g_Set_Face_Flag 1--双向最大值差 2--平均值 3--正向最大值
double dis1(0.0),dis2(0.0),dis3(0.0);
double sum(0.0);
double d1=pArr[0].z;
@@ -13,20 +13,20 @@
/////////////////////////////////////////////////////////////////////////////
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;
m_RXTempPtr = nullptr;
m_RXHead = nullptr;
m_RXTail = nullptr;
m_SXTempPtr = nullptr;
m_SXHead = nullptr;
m_SXTail = nullptr;
CurrentPointer = 0;
m_iNbMsgWaiting = 0;
m_terminator = '\0';
m_usesTerminator = FALSE;
m_pReceiveNotify = nullptr;
}
void CMMIO::SetCallback(CMMIO::p_fstr ptr)
void CMMIO::SetCallback(p_fstr ptr)
{
m_pReceiveNotify = ptr;
}
@@ -36,19 +36,19 @@ 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)
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);
auto ptr = (unsigned short*)buffer.GetBuffer(MAX_OUTPUT_BUFFER_SIZE);
for (int i=0;i<length;i++)
for (int i = 0; i < length; i++)
{
LocBuffer[i] = (char)(ptr[i] & 0xff);
LocBuffer[i] = static_cast<char>(ptr[i] & 0xff);
}
DWORD res = Send(LocBuffer,length, needsResponse);
DWORD res = Send(LocBuffer, length, needsResponse);
//ZH 12-12-05 LeaveCriticalSection( &m_QueueLock ); //ZH-122904
@@ -58,21 +58,21 @@ DWORD CMMIO::Send(CString buffer, BOOL needsResponse/*=FALSE*/)
// GetNextReceived() : Helper function, rreturns receives messages placed in the queue
// by LineReceive()
//
int CMMIO::GetNextReceived(char *inputBuf)
int CMMIO::GetNextReceived(char* inputBuf)
{
struct SerialList *Free;
int cnt=0;
struct SerialList* Free;
int cnt = 0;
// If there is a previous block then delete it
if (NULL != m_RXTempPtr)
if (nullptr != m_RXTempPtr)
delete[] m_RXTempPtr;
m_RXTempPtr = NULL;
m_RXTempPtr = nullptr;
// We are messing with pointers so use the CriticalSection
// EnterCriticalSection(&m_QueueLock);
// If there any more to return
if( m_RXHead )
if (m_RXHead)
{
Free = m_RXHead;
m_RXHead = m_RXHead->Next;
@@ -85,23 +85,23 @@ int CMMIO::GetNextReceived(char *inputBuf)
--m_iNbMsgWaiting; // mp
// move over the data to the user's buffer
if (NULL != inputBuf)
memcpy (inputBuf, m_RXTempPtr, cnt);
if (nullptr != inputBuf)
memcpy(inputBuf, m_RXTempPtr, cnt);
}
if( m_RXHead == NULL )
m_RXTail = NULL;
if (m_RXHead == nullptr)
m_RXTail = nullptr;
// All done so out of the CriticalSection
// LeaveCriticalSection( &m_QueueLock );
return(cnt);
return (cnt);
}
int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
int CMMIO::AddReceived(const char* Buffer, DWORD Bytes)
{
DWORD index = 0; //primary buffer index
struct SerialList *Ptr;
struct SerialList* Ptr;
static char Buffer2[MAX_RECIEVE_BUFFER_SIZE]; // result buffer
static char* pBuffer2 = &Buffer2[0];
unsigned char c;
@@ -130,11 +130,11 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
{
bArmed = false;
for (;index<Bytes;index++)
for (; index < Bytes; index++)
{
c=Buffer[index] & 0xff;
c = Buffer[index] & 0xff;
//TRACE(_T("== %02x% ==\n"),c); //copy char one by one
*(pBuffer2++) = c ; //copy char one by one
*(pBuffer2++) = c; //copy char one by one
// check for end of packet. ignore if this is the last char anyways
if (m_usesTerminator && c == m_terminator && (index < Bytes - 1))
@@ -149,17 +149,18 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
bArmed = bDone = true;
// We are messing with pointers so use the CriticalSection
if (bArmed )
if (bArmed)
{
// EnterCriticalSection(&m_QueueLock);
//Allocate a new list and add it in
count = pBuffer2-(&Buffer2[0]);
count = pBuffer2 - (&Buffer2[0]);
if (m_pReceiveNotify)
{ // send a string to callback or,
char* pLocalBuffer = new char[count+1];
{
// send a string to callback or,
auto pLocalBuffer = new char[count + 1];
if (pLocalBuffer)
{
memcpy (pLocalBuffer,Buffer2,count);
memcpy(pLocalBuffer, Buffer2, count);
pLocalBuffer[count] = 0;
CString LocalStr(pLocalBuffer);
(*m_pReceiveNotify)(LocalStr);
@@ -167,9 +168,10 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
}
}
else
{ // add it as before to received data ....
{
// add it as before to received data ....
Ptr = new struct SerialList;
Ptr->Buffer = new char[count + 1 ];
Ptr->Buffer = new char[count + 1];
/************************************************************************/
/* Greg Guilbeau - 2011/08/23 */
/* The following line(s) have been modified to handle x64 conversion */
@@ -178,16 +180,16 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
#ifdef _WIN64
Ptr->Bytes = WAI64bit::to32bit(count,__FILE__,__LINE__);
#else
Ptr->Bytes = count,__FILE__,__LINE__;
Ptr->Bytes = count, __FILE__, __LINE__;
#endif
Ptr->Next = NULL;
memcpy( Ptr->Buffer, Buffer2, count );
Ptr->Next = nullptr;
memcpy(Ptr->Buffer, Buffer2, count);
Ptr->Buffer[count] = 0;
memcpy(m_sLastMessage,Buffer2,count); //copy to last message
m_sLastMessage[count]=0;
memcpy(m_sLastMessage, Buffer2, count); //copy to last message
m_sLastMessage[count] = 0;
if( m_RXTail )
if (m_RXTail)
m_RXTail->Next = Ptr;
else
m_RXHead = Ptr;
@@ -197,7 +199,7 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
++m_iNbMsgWaiting;
}
// LeaveCriticalSection( &m_QueueLock );
pBuffer2=&Buffer2[0]; // reset out buffer
pBuffer2 = &Buffer2[0]; // reset out buffer
count = 0;
bEventRequest = true;
}
@@ -205,7 +207,7 @@ int CMMIO::AddReceived( const char *Buffer,DWORD Bytes)
while (!bDone);
//TRACE (_T("CMMIO> Done\n"));
return(TRUE);
return (TRUE);
}
void CMMIO::LineReceive(char* s, int nbCharAvail, BOOL ignoreDelimiter /*= FALSE*/)
@@ -214,13 +216,14 @@ void CMMIO::LineReceive(char* s, int nbCharAvail, BOOL ignoreDelimiter /*= FALSE
{
//TRACE(_T("LineReceive got %d chars \n"),nbCharAvail);
char c;
for (int i=0 ; i<nbCharAvail ; i++ )
for (int i = 0; i < nbCharAvail; i++)
{
c=s[i];
c = s[i];
m_InputBuffer[CurrentPointer++] = c;
// only add a packet if we have a delimiter
if ((!m_usesTerminator && i == nbCharAvail -1) || (m_usesTerminator && c == m_terminator) || ignoreDelimiter)
if ((!m_usesTerminator && i == nbCharAvail - 1) || (m_usesTerminator && c == m_terminator) ||
ignoreDelimiter)
{
m_InputBuffer[CurrentPointer] = '\0';
AddReceived(m_InputBuffer, CurrentPointer);
@@ -233,22 +236,22 @@ void CMMIO::LineReceive(char* s, int nbCharAvail, BOOL ignoreDelimiter /*= FALSE
////////////////////////////////////////////////////////
DWORD CMMIO::Close()
{
struct SerialList *Free;
struct SerialList* Free;
// Delete the contents of the temp rx pointer if any
delete[] m_RXTempPtr;
m_RXTempPtr = NULL;
m_RXTempPtr = nullptr;
// Clear down all internal lists
// EnterCriticalSection( &m_QueueLock );
while( m_RXHead )
while (m_RXHead)
{
Free = m_RXHead;
m_RXHead = m_RXHead->Next;
delete[] Free->Buffer;
delete Free;
}
m_RXHead = NULL;
m_RXHead = nullptr;
// for now we are not using the Transmit list
#if 0
@@ -263,10 +266,9 @@ DWORD CMMIO::Close()
m_TXHead = NULL;
#endif
// LeaveCriticalSection( &m_QueueLock );
return(TRUE);
return (TRUE);
}
///////////////////////////////////////////////////////////////////////////////
// END OF BASE CLASS CMMIO
///////////////////////////////////////////////////////////////////////////////
@@ -29,55 +29,55 @@ static char Codes[][6] =
unsigned int WINAPI CSerialTask(LPVOID CSerialPtr)
{
TRACE( TEXT("Serial task has started \n") );
TRACE(TEXT("Serial task has started \n"));
// Call the ControlTask function in the specified plugin
((CPSerial *)CSerialPtr)->ReceiveTask();
static_cast<CPSerial*>(CSerialPtr)->ReceiveTask();
TRACE( TEXT("Serial task has completed \n") );
TRACE(TEXT("Serial task has completed \n"));
_endthreadex(0);
return(0);
return (0);
}
CPSerial::CPSerial()
{
// Serial port is not open
m_PortHandle = INVALID_HANDLE_VALUE;
m_IsWrtingData=FALSE;
m_IsWrtingData = FALSE;
// Default port settings
m_Port = 1;
m_Baud = CBR_115200;
m_Parity ='N';
m_Parity = 'N';
m_Bits = 8;
m_StopBits = 1;
m_HandShake =CS_HANDSHAKE_FOR_SO7;
m_HandShake = CS_HANDSHAKE_FOR_SO7;
m_RXTimeout = CS_DEFAULT_RX_TIMEOUT;
m_TXTimeout = CS_DEFAULT_TX_TIMEOUT;
m_iRecvState=FALSE;
m_iRecvBytes=0;
memset(m_RecvData,0,MAX_RECIEVE_BUFFER_SIZE);
m_iRecvState = FALSE;
m_iRecvBytes = 0;
memset(m_RecvData, 0,MAX_RECIEVE_BUFFER_SIZE);
// Everything else set to NULL
m_ThreadHandle = NULL;
m_ThreadHandle = nullptr;
//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 ));
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_ReadOLap.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
m_hWaitCMMResponse = CreateEvent(nullptr, TRUE, FALSE, nullptr);
m_hNewRx = CreateEvent(nullptr, TRUE, FALSE, nullptr); // to trigger OnRx
m_ReadOLap.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
//m_RXTempPtr = NULL;
m_DebugInPtr = 0;
m_DebugCount = 0;
m_Item = 0;
m_MaxTXRetries = 5;
m_iRecvCount=252;
m_iRecvCount = 252;
/*
// CriticalSection for locking lists
InitializeCriticalSection( &m_QueueLock );
@@ -87,8 +87,8 @@ CPSerial::CPSerial()
// IsValidBuffer = FALSE;
CurrentPointer = 0;
m_hWaitCMMResponse = CreateEvent( NULL, TRUE, FALSE, NULL );
m_hNewRx = CreateEvent( NULL, TRUE, FALSE, NULL ); // to trigger OnRx
m_hWaitCMMResponse = CreateEvent(nullptr, TRUE, FALSE, nullptr);
m_hNewRx = CreateEvent(nullptr, TRUE, FALSE, nullptr); // to trigger OnRx
// pParent = NULL;
}
@@ -98,24 +98,23 @@ CPSerial::CPSerial()
CPSerial::~CPSerial()
{
if( IsOpen( ) )
if (IsOpen())
{
TRACE(TEXT("Warning : closing serial port in destructor\n"));
Close();
}
while(GetNextReceived())
; // mp 3/3/99 prevents leaks
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_ReadOLap.hEvent);
CloseHandle(m_WriteOLap.hEvent);
//
CloseHandle( m_hWaitCMMResponse );
CloseHandle( m_hNewRx);
CloseHandle(m_hWaitCMMResponse);
CloseHandle(m_hNewRx);
}
@@ -134,7 +133,7 @@ DWORD CPSerial::Open()
// RegisterDebugWindow( );
// Close the port incase it is already open
Close( );
Close();
// Start of assuming the worst
Ok = FALSE;
@@ -144,16 +143,16 @@ DWORD CPSerial::Open()
#if 0
PortName.Format( TEXT("\\\\.\\COM%d"), m_Port );
#else
PortName.Format( TEXT("COM%d"), m_Port );
PortName.Format(TEXT("COM%d"), m_Port);
#endif
m_PortHandle = CreateFile( PortName, GENERIC_WRITE | GENERIC_READ, 0, NULL,
m_PortHandle = CreateFile(PortName, GENERIC_WRITE | GENERIC_READ, 0, nullptr,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED,
NULL );
if( IsOpen( ) )
nullptr);
if (IsOpen())
{
// Setup the port according to the stored parameters
if( ProgramPort( m_Port, m_Baud, m_Parity, m_Bits, m_StopBits, m_HandShake ) )
if (ProgramPort(m_Port, m_Baud, m_Parity, m_Bits, m_StopBits, m_HandShake))
{
// Setup the timeouts
CommTimeOut.ReadIntervalTimeout = 25;
@@ -161,21 +160,21 @@ DWORD CPSerial::Open()
CommTimeOut.ReadTotalTimeoutConstant = 0;
CommTimeOut.WriteTotalTimeoutMultiplier = 0;
CommTimeOut.WriteTotalTimeoutConstant = m_TXTimeout;
if( SetCommTimeouts( m_PortHandle, &CommTimeOut ) )
if (SetCommTimeouts(m_PortHandle, &CommTimeOut))
{
// Setup the buffer sizes
if( SetupComm( m_PortHandle, 2048, 2048 ) )
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 ) )
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 );
m_ReceiveOLap.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
m_TransmitOLap.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
m_ThreadHandle = (HANDLE)_beginthreadex(nullptr, 0, CSerialTask, this,
0, &ThreadID);
//Sleep(1000);
Ok = TRUE;
}
@@ -186,15 +185,15 @@ DWORD CPSerial::Open()
}
// Things have gone wrong so close the port
if( Ok == FALSE )
if (Ok == FALSE)
{
TRACE(_T("CmmIO> Port OPEN issue -> CLOSED\n"),Ok);
Close( );
TRACE(_T("CmmIO> Port OPEN issue -> CLOSED\n"), Ok);
Close();
}
}
TRACE(_T("CmmIO> Port OPEN = %d \n"),Ok);
TRACE(_T("CmmIO> Port OPEN = %d \n"), Ok);
// Return the state
return( IsOpen( ) );
return (IsOpen());
}
@@ -202,9 +201,9 @@ DWORD CPSerial::Open()
// IsOpen() : returns true if the serial port is open
//
int CPSerial::IsOpen( )
int CPSerial::IsOpen()
{
return( m_PortHandle != INVALID_HANDLE_VALUE );
return (m_PortHandle != INVALID_HANDLE_VALUE);
}
@@ -212,24 +211,24 @@ int CPSerial::IsOpen( )
// SetPort() : Store the serial settings. If the port is open then these
// settings are applied now
int CPSerial::SetPort(int Port,int Baud,char Parity,int Bits,int StopBits,int HandShake)
int CPSerial::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)
if (Baud == 0)
Baud = m_Baud;
if(Parity == 0)
if (Parity == 0)
Parity = m_Parity;
if(Bits == 0)
if (Bits == 0)
Bits = m_Bits;
if(StopBits == 0)
if (StopBits == 0)
StopBits = m_StopBits;
if (HandShake==0)
HandShake=m_HandShake;
if (HandShake == 0)
HandShake = m_HandShake;
// If the values are ok then store them
if( ProgramPort( Port, Baud, Parity, Bits, StopBits, HandShake ) )
if (ProgramPort(Port, Baud, Parity, Bits, StopBits, HandShake))
{
m_Port = Port;
m_Baud = Baud;
@@ -237,9 +236,9 @@ int CPSerial::SetPort(int Port,int Baud,char Parity,int Bits,int StopBits,int Ha
m_Bits = Bits;
m_StopBits = StopBits;
m_HandShake = HandShake;
return(TRUE);
return (TRUE);
}
return(FALSE);
return (FALSE);
}
@@ -247,24 +246,24 @@ int CPSerial::SetPort(int Port,int Baud,char Parity,int Bits,int StopBits,int Ha
// GetPortData() : return the current settings
//
void CPSerial::GetPortData(int *Port,int *Baud,char *Parity,int *Bits,int *StopBits,int *HandShake)
void CPSerial::GetPortData(int* Port, int* Baud, char* Parity, int* Bits, int* StopBits, int* HandShake)
{
// return the requested settings
if( Port )
if (Port)
*Port = m_Port;
if( m_Baud )
if (m_Baud)
*Baud = m_Baud;
if( Parity )
if (Parity)
*Parity = m_Parity;
if( Bits )
if (Bits)
*Bits = m_Bits;
if( StopBits )
if (StopBits)
*StopBits = m_StopBits;
if( HandShake )
if (HandShake)
*HandShake = m_HandShake;
}
DWORD CPSerial::SendWriteFile(const char *Buffer, DWORD Bytes)
DWORD CPSerial::SendWriteFile(const char* Buffer, DWORD Bytes)
{
DWORD BytesWritten;
BOOL WriteState;
@@ -283,16 +282,16 @@ DWORD CPSerial::Close()
HANDLE Port;
// If the port is open then close it
if( IsOpen( ) )
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 );
CloseHandle(Port);
if (WaitForSingleObject(m_ThreadHandle, (5 * LONG_TIMEOUT)) != WAIT_OBJECT_0)
TRACE(TEXT("ERR:Serial port thread failed to terminate\n"));
m_ThreadHandle = nullptr;
CloseHandle(m_ReceiveOLap.hEvent);
CloseHandle(m_TransmitOLap.hEvent);
}
CMMIO::Close();
@@ -323,7 +322,7 @@ DWORD CPSerial::Close()
LeaveCriticalSection( &m_QueueLock );
*/
return(TRUE);
return (TRUE);
}
@@ -333,10 +332,11 @@ DWORD CPSerial::Close()
DWORD CPSerial::Send(LPCSTR buffer, int l, BOOL /*needsResponse=FALSE*/)
{
m_IsWrtingData=TRUE;
m_IsWrtingData = TRUE;
return ( WritePort ((const char*) buffer, (DWORD) l));
return (WritePort(buffer, static_cast<DWORD>(l)));
}
/*
DWORD CPSerial::Send(CString buffer)
{
@@ -360,16 +360,16 @@ return res;
// WritePort() : Writes the specifed bytes to the serial port
//
DWORD CPSerial::WritePort(const char *Buffer,DWORD Bytes)
DWORD CPSerial::WritePort(const char* Buffer, DWORD Bytes)
{
DWORD BytesWritten, TotalWritten, Error;
BOOL WriteState;
int Retrys;
TotalWritten=0;
TotalWritten = 0;
// Check that the port is open
if( IsOpen( ) )
if (IsOpen())
{
// Enter a critical section incase this is been used from multiple threads
//EnterCriticalSection(&m_WriteLock);
@@ -383,19 +383,19 @@ DWORD CPSerial::WritePort(const char *Buffer,DWORD Bytes)
Retrys++;
BytesWritten = 0;
// Write the data
WriteState = WriteFile( m_PortHandle, &Buffer[TotalWritten],
Bytes-TotalWritten, &BytesWritten,
&m_WriteOLap );
if( !WriteState )
WriteState = WriteFile(m_PortHandle, &Buffer[TotalWritten],
Bytes - TotalWritten, &BytesWritten,
&m_WriteOLap);
if (!WriteState)
{
Sleep(5);
// Ensure the write is going on in the background
if( GetLastError() == ERROR_IO_PENDING )
if (GetLastError() == ERROR_IO_PENDING)
{
// And wait for it to finish
WaitForSingleObject( m_WriteOLap.hEvent, LONG_TIMEOUT ); // GER
GetOverlappedResult( m_PortHandle, &m_WriteOLap, &BytesWritten,
FALSE );
WaitForSingleObject(m_WriteOLap.hEvent, LONG_TIMEOUT); // GER
GetOverlappedResult(m_PortHandle, &m_WriteOLap, &BytesWritten,
FALSE);
long llRetrys = 0;
while (BytesWritten == 0 && llRetrys <= m_MaxTXRetries)
{
@@ -409,14 +409,13 @@ DWORD CPSerial::WritePort(const char *Buffer,DWORD Bytes)
else
{
// Gone wrong so clear any erros
ClearCommError( m_PortHandle, &Error, NULL );
BytesWritten= 0 ;
ClearCommError(m_PortHandle, &Error, nullptr);
BytesWritten = 0;
}
}
TotalWritten += BytesWritten;
}
while( Retrys <= m_MaxTXRetries && TotalWritten < Bytes );
while (Retrys <= m_MaxTXRetries && TotalWritten < Bytes);
//ZH
/*
@@ -428,14 +427,14 @@ DWORD CPSerial::WritePort(const char *Buffer,DWORD Bytes)
//LeaveCriticalSection( &m_WriteLock );
}
return( TotalWritten );
return (TotalWritten);
}
/////////////////////////////////////////////////////////////////////////////
// ReceiveTask() : Internal function, this runs as a thread and provides the
// OnRecieve and OnTransmit events
void CPSerial::ReceiveTask( void )
void CPSerial::ReceiveTask(void)
{
//DWORD BytesWritten;
DWORD Events;
@@ -443,26 +442,26 @@ void CPSerial::ReceiveTask( void )
do
{
Events=0;
Events = 0;
// Wait for a comm event
State=WaitCommEvent(m_PortHandle,&Events,&m_ReceiveOLap);
if(!State)
State = WaitCommEvent(m_PortHandle, &Events, &m_ReceiveOLap);
if (!State)
{
// Since we are using overlapping IO we may have to wait
// for the result
if(GetLastError() == ERROR_IO_PENDING)
GetOverlappedResult(m_PortHandle,&m_ReceiveOLap,&State,TRUE);
if (GetLastError() == ERROR_IO_PENDING)
GetOverlappedResult(m_PortHandle, &m_ReceiveOLap, &State,TRUE);
}
//m_iRecvState=FALSE;
// If we have a result then OK otherwise the event was probable
// the serial port being closed and we shall exit the loop
if( State && IsOpen( ) )
if (State && IsOpen())
{
// Check the events and act accordingly
if( Events & EV_RXCHAR )
if (Events & EV_RXCHAR)
{
OnReceive( );
OnReceive();
}
//ZH
/*
@@ -478,22 +477,21 @@ void CPSerial::ReceiveTask( void )
}
}
*/
if(Events & EV_BREAK)
if (Events & EV_BREAK)
TRACE(_T("Break detected\n"));
if(Events & EV_CTS)
if (Events & EV_CTS)
TRACE(_T("CTS Changed State\n"));
if(Events & EV_DSR)
if (Events & EV_DSR)
TRACE(_T("DSR Changed State\n"));
if(Events & EV_ERR)
if (Events & EV_ERR)
TRACE(_T("Line error\n"));
if(Events & EV_RLSD)
if (Events & EV_RLSD)
TRACE(_T("EV_RLSD error\n"));
}
// Go round while the port is open
}
while( IsOpen( ) );
while (IsOpen());
}
/////////////////////////////////////////////////////////////////////////////
@@ -503,40 +501,40 @@ void CPSerial::ReceiveTask( void )
void CPSerial::OnReceive()
{
// Dummy OnReceieve if not used
char s[MAX_RECIEVE_BUFFER_SIZE]={0};
s[1]='\0';
char s[MAX_RECIEVE_BUFFER_SIZE] = {0};
s[1] = '\0';
CurrentPointer = 0;
if (m_HandShake==CS_HANDSHAKE_FOR_TRESASTR_E)
if (m_HandShake == CS_HANDSHAKE_FOR_TRESASTR_E)
{
int num = ReadPort(s, MAX_RECIEVE_BUFFER_SIZE);
if ((num>0) && (num<MAX_RECIEVE_BUFFER_SIZE))
if ((num > 0) && (num < MAX_RECIEVE_BUFFER_SIZE))
{
if(m_IsWrtingData)
if (m_IsWrtingData)
{
memset(m_RecvData,0,MAX_RECIEVE_BUFFER_SIZE);
m_IsWrtingData=FALSE;
m_iRecvBytes=0;
memset(m_RecvData, 0,MAX_RECIEVE_BUFFER_SIZE);
m_IsWrtingData = FALSE;
m_iRecvBytes = 0;
}
TRACE1("----RECV%d----\r\n",num);
TRACE3("%02X %02X %02X ",s[0],s[1],s[2]);
TRACE3("%02X %02X %02X ",s[3],s[4],s[5]);
TRACE3("%02X %02X %02X\r\n",s[6],s[7],s[8]);
for(int i=0;i<num;i++)
TRACE1("----RECV%d----\r\n", num);
TRACE3("%02X %02X %02X ", s[0], s[1], s[2]);
TRACE3("%02X %02X %02X ", s[3], s[4], s[5]);
TRACE3("%02X %02X %02X\r\n", s[6], s[7], s[8]);
for (int i = 0; i < num; i++)
{
m_RecvData[m_iRecvBytes++]=s[i];
m_RecvData[m_iRecvBytes++] = s[i];
}
m_iRecvState=TRUE;
m_iRecvState = TRUE;
}
}
else
{
int num = ReadPort(s, m_iRecvCount);
if ((num>0) && (num<MAX_RECIEVE_BUFFER_SIZE))
if ((num > 0) && (num < MAX_RECIEVE_BUFFER_SIZE))
{
memset(m_RecvData,0,m_iRecvBytes);
memcpy(m_RecvData,s, num);
m_iRecvBytes=num;
m_iRecvState=TRUE;
memset(m_RecvData, 0, m_iRecvBytes);
memcpy(m_RecvData, s, num);
m_iRecvBytes = num;
m_iRecvState = TRUE;
}
}
//LineReceive(s, num);
@@ -547,39 +545,39 @@ void CPSerial::OnReceive()
// ReadPort() : Read the specifed number of bytes.
//
DWORD CPSerial::ReadPort(char *Buffer,DWORD Bytes)
DWORD CPSerial::ReadPort(char* Buffer, DWORD Bytes)
{
DWORD BytesRead,Error;
DWORD BytesRead, Error;
BOOL ReadState;
BytesRead = 0;
// Check the port is open
if( IsOpen( ) )
if (IsOpen())
{
// Enter a critical section incase this is been used from multiple threads
// EnterCriticalSection(&m_ReadLock);
// Start the read
ReadState = ReadFile(m_PortHandle,Buffer,Bytes,&BytesRead,&m_ReadOLap);
if( !ReadState )
ReadState = ReadFile(m_PortHandle, Buffer, Bytes, &BytesRead, &m_ReadOLap);
if (!ReadState)
{
Sleep(5);
// the specifed number of bytes were not available so
// the read will continue in the background aslong as
// GetLastError() returns ERROR_IO_PENDING
if( GetLastError() == ERROR_IO_PENDING )
if (GetLastError() == ERROR_IO_PENDING)
{
// Wait for the read to complete
WaitForSingleObject( m_ReadOLap.hEvent, LONG_TIMEOUT ); // GER
WaitForSingleObject(m_ReadOLap.hEvent, LONG_TIMEOUT); // GER
// get the result of the read
if( GetOverlappedResult( m_PortHandle, &m_ReadOLap, &BytesRead, FALSE ) == 0 )
if (GetOverlappedResult(m_PortHandle, &m_ReadOLap, &BytesRead, FALSE) == 0)
Error = GetLastError();
}
else
{
// Gone wrong so clear any erros
ClearCommError( m_PortHandle, &Error, NULL );
BytesRead = 0 ;
ClearCommError(m_PortHandle, &Error, nullptr);
BytesRead = 0;
}
}
@@ -592,11 +590,10 @@ DWORD CPSerial::ReadPort(char *Buffer,DWORD Bytes)
// LeaveCriticalSection( &m_ReadLock );
}
return(BytesRead);
return (BytesRead);
}
/////////////////////////////////////////////////////////////////////////////
// ReadPort() : Read the specifed number of bytes into a CString class.
//
@@ -618,35 +615,35 @@ DWORD CPSerial::ReadPort(CString &Buffer,DWORD Bytes)
// ProgramPort() : Internal function to setup the serial port
//
int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,int HandShake)
int CPSerial::ProgramPort(int Port, int Baud, char Parity, int Bits, int StopBits, int HandShake)
{
CString Param,Params;
CString Param, Params;
DCB SerialDCB;
int Ok;
// Build up the serial port settings
Params.Format( TEXT("com%d"), Port );
Param.Format( TEXT(" baud=%d"), Baud );
Params.Format(TEXT("com%d"), Port);
Param.Format(TEXT(" baud=%d"), Baud);
Params += Param;
Param.Format( TEXT(" parity=%c"), Parity );
Param.Format(TEXT(" parity=%c"), Parity);
Params += Param;
Param.Format( TEXT(" data=%d"), Bits );
Param.Format(TEXT(" data=%d"), Bits);
Params += Param;
Param.Format( TEXT(" stop=%d"), StopBits );
Param.Format(TEXT(" stop=%d"), StopBits);
Params += Param;
Ok = FALSE;
memset( (void *)&SerialDCB, 0, sizeof(SerialDCB) );
memset(&SerialDCB, 0, sizeof(SerialDCB));
SerialDCB.DCBlength = sizeof(SerialDCB);
// Place them in the DCB structure, this also validates them if the
// serial port is not open
if( BuildCommDCB( Params, &SerialDCB ) )
if (BuildCommDCB(Params, &SerialDCB))
{
// If the port is open
if( IsOpen( ) )
if (IsOpen())
{
// Set the handshake bits
switch(HandShake)
switch (HandShake)
{
case CS_HANDSHAKE_RTSCTS:
SerialDCB.fOutxCtsFlow = TRUE;
@@ -676,34 +673,34 @@ int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,in
SerialDCB.fDsrSensitivity = FALSE;
SerialDCB.XonChar = 17;
SerialDCB.XoffChar = 19;
SerialDCB.fOutX=FALSE;
SerialDCB.fInX=FALSE;
SerialDCB.fErrorChar=FALSE;
SerialDCB.fRtsControl=RTS_CONTROL_DISABLE;
SerialDCB.fOutX = FALSE;
SerialDCB.fInX = FALSE;
SerialDCB.fErrorChar = FALSE;
SerialDCB.fRtsControl = RTS_CONTROL_DISABLE;
SerialDCB.fDtrControl = DTR_CONTROL_ENABLE;
SerialDCB.fOutxCtsFlow=FALSE;
SerialDCB.fOutxDsrFlow=FALSE;
SerialDCB.XonLim=256;
SerialDCB.XoffLim=256;
SerialDCB.fOutxCtsFlow = FALSE;
SerialDCB.fOutxDsrFlow = FALSE;
SerialDCB.XonLim = 256;
SerialDCB.XoffLim = 256;
break;
case CS_HANDSHAKE_FOR_TRESASTR_E:
SerialDCB.EofChar = 26;
SerialDCB.XonChar = 17;
SerialDCB.XoffChar = 19;
SerialDCB.fOutX=TRUE;
SerialDCB.fInX=TRUE;
SerialDCB.fRtsControl=RTS_CONTROL_DISABLE;
SerialDCB.fOutX = TRUE;
SerialDCB.fInX = TRUE;
SerialDCB.fRtsControl = RTS_CONTROL_DISABLE;
SerialDCB.fDtrControl = DTR_CONTROL_ENABLE;
SerialDCB.fDsrSensitivity=FALSE;
SerialDCB.XonLim=256;
SerialDCB.XoffLim=256;
SerialDCB.fDsrSensitivity = FALSE;
SerialDCB.XonLim = 256;
SerialDCB.XoffLim = 256;
break;
default:
break;
}
// Finally apply the params to the port
if(SetCommState( m_PortHandle, &SerialDCB ) )
if (SetCommState(m_PortHandle, &SerialDCB))
{
Ok = TRUE;
}
@@ -711,9 +708,9 @@ int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,in
{
GetCommState(m_PortHandle, &SerialDCB);
SerialDCB.BaudRate = Baud; // set the baud rate
SerialDCB.ByteSize = (BYTE)Bits; // data size, xmit, and rcv
SerialDCB.StopBits = (BYTE)StopBits; // one stop bit
switch(Parity)
SerialDCB.ByteSize = static_cast<BYTE>(Bits); // data size, xmit, and rcv
SerialDCB.StopBits = static_cast<BYTE>(StopBits); // one stop bit
switch (Parity)
{
case 'O':
case 'o':
@@ -726,10 +723,9 @@ int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,in
default:
SerialDCB.Parity = NOPARITY; // no parity bit
break;
}
// Set the handshake bits
switch(HandShake)
switch (HandShake)
{
case CS_HANDSHAKE_RTSCTS:
SerialDCB.fOutxCtsFlow = TRUE;
@@ -753,34 +749,34 @@ int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,in
SerialDCB.fDsrSensitivity = FALSE;
SerialDCB.XonChar = 17;
SerialDCB.XoffChar = 19;
SerialDCB.fOutX=FALSE;
SerialDCB.fInX=FALSE;
SerialDCB.fErrorChar=FALSE;
SerialDCB.fRtsControl= RTS_CONTROL_DISABLE;
SerialDCB.fOutX = FALSE;
SerialDCB.fInX = FALSE;
SerialDCB.fErrorChar = FALSE;
SerialDCB.fRtsControl = RTS_CONTROL_DISABLE;
SerialDCB.fDtrControl = DTR_CONTROL_ENABLE;
SerialDCB.fOutxCtsFlow=FALSE;
SerialDCB.fOutxDsrFlow=FALSE;
SerialDCB.XonLim=256;
SerialDCB.XoffLim=256;
SerialDCB.fOutxCtsFlow = FALSE;
SerialDCB.fOutxDsrFlow = FALSE;
SerialDCB.XonLim = 256;
SerialDCB.XoffLim = 256;
break;
case CS_HANDSHAKE_FOR_TRESASTR_E:
SerialDCB.EofChar = 26;
SerialDCB.XonChar = 17;
SerialDCB.XoffChar = 19;
SerialDCB.fOutX=TRUE;
SerialDCB.fInX=TRUE;
SerialDCB.fRtsControl=RTS_CONTROL_DISABLE;
SerialDCB.fOutX = TRUE;
SerialDCB.fInX = TRUE;
SerialDCB.fRtsControl = RTS_CONTROL_DISABLE;
SerialDCB.fDtrControl = DTR_CONTROL_ENABLE;
SerialDCB.fDsrSensitivity=FALSE;
SerialDCB.XonLim=256;
SerialDCB.XoffLim=256;
SerialDCB.fDsrSensitivity = FALSE;
SerialDCB.XonLim = 256;
SerialDCB.XoffLim = 256;
break;
default:
break;
}
// Finally apply the params to the port
if(SetCommState( m_PortHandle, &SerialDCB ) )
if (SetCommState(m_PortHandle, &SerialDCB))
{
Ok = TRUE;
}
@@ -793,7 +789,7 @@ int CPSerial::ProgramPort(int Port,int Baud,char Parity,int Bits,int StopBits,in
Ok = TRUE;
}
}
return(Ok);
return (Ok);
}
/////////////////////////////////////////////////////////////////////////////
@@ -810,7 +806,7 @@ void CPSerial::OnTransmit(int /*Item*/, DWORD /*Error*/)
// SetTimeouts() : Sets the rx and tx timeouts
//
void CPSerial::SetTimeouts( int RXTimeout, int TXTimeout )
void CPSerial::SetTimeouts(int RXTimeout, int TXTimeout)
{
COMMTIMEOUTS CommTimeOut;
@@ -820,14 +816,14 @@ void CPSerial::SetTimeouts( int RXTimeout, int TXTimeout )
// If the port is open then configure the port also
// Currently we only use the Fixed timeouts
if( IsOpen( ) )
if (IsOpen())
{
CommTimeOut.ReadIntervalTimeout = 25;
CommTimeOut.ReadTotalTimeoutMultiplier = 1;
CommTimeOut.ReadTotalTimeoutConstant = 0;
CommTimeOut.WriteTotalTimeoutMultiplier = 0;
CommTimeOut.WriteTotalTimeoutConstant = m_TXTimeout;
SetCommTimeouts( m_PortHandle, &CommTimeOut );
SetCommTimeouts(m_PortHandle, &CommTimeOut);
}
}
@@ -836,7 +832,7 @@ void CPSerial::SetTimeouts( int RXTimeout, int TXTimeout )
// AddToDebug() : Add the data to the debug output. State is 1 = rx 2 = tx
// 3 = user
void CPSerial::AddToDebug( const char * /*Ptr*/, DWORD /*BytesToCopy*/, int /*State*/ )
void CPSerial::AddToDebug(const char* /*Ptr*/, DWORD /*BytesToCopy*/, int /*State*/)
{
//ZH
#if 0
@@ -954,7 +950,7 @@ return(BytesTotal);
int CPSerial::MaxPort()
{
// return the max port, :-)
return(8);
return (8);
}
@@ -964,7 +960,7 @@ int CPSerial::MaxPort()
// data sent.
//
int CPSerial::Transmit(const char * /*Buffer*/,DWORD /*Bytes*/)
int CPSerial::Transmit(const char* /*Buffer*/, DWORD /*Bytes*/)
{
/*
struct SerialList *Ptr;
@@ -1015,7 +1011,7 @@ int CPSerial::Transmit(const char * /*Buffer*/,DWORD /*Bytes*/)
}
*/
return(0);
return (0);
}
/////////////////////////////////////////////////////////////////////////////
@@ -1192,24 +1188,24 @@ return( m_RXTempPtr );
// ascii hex
//
int CPSerial::HexToInt(char *Data, int Bytes)
int CPSerial::HexToInt(char* Data, int Bytes)
{
int Byte;
int HexChar, Value;
Value = 0;
for( Byte = 0; Byte < Bytes; Byte++ )
for (Byte = 0; Byte < Bytes; Byte++)
{
Value <<= 4;
HexChar = *Data++ -= '0';
if( HexChar > 32 )
if (HexChar > 32)
HexChar -= 39;
else if( HexChar > 9 )
else if (HexChar > 9)
HexChar -= 7;
Value += HexChar;
}
return( Value );
return (Value);
}
@@ -1238,7 +1234,6 @@ AfxRegisterClass( &wndcls );
*/
#if 0
/////////////////////////////////////////////////////////////////////////////
// SendBuffer() : Internal function, this writes the next block of data
@@ -6,15 +6,18 @@
enum eThreadSignal
{
THREAD_STATE_RUNNING, // Current state of the thread
THREAD_STATE_RUNNING,
// Current state of the thread
THREAD_STATE_EXIT // Signal to thread to exit
};
unsigned __stdcall ReadLightData(LPVOID pThis);
eThreadSignal _serial_WatchThreadState;
const char DigitalLuxMeter_StopDatas[9] = { 0X3C,0X02,0X00,0X00,0X00,0X00,0X00,0XDE,0X00 };
const char DigitalLuxMeter_StartDatas[9] = { 0X1E,0X00,0X00,0X00,0X00,0X00,0X00,0X1E,0X00 };
const char DigitalLuxMeter_BeginDatas[9] = { 0X3C,0X01,0X00,0X00,0X00,0X00,0X00,0X3D,0X00 };
const char DigitalLuxMeter_StopDatas[9] = {0X3C, 0X02, 0X00, 0X00, 0X00, 0X00, 0X00, 0XDE, 0X00};
const char DigitalLuxMeter_StartDatas[9] = {0X1E, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00, 0X1E, 0X00};
const char DigitalLuxMeter_BeginDatas[9] = {0X3C, 0X01, 0X00, 0X00, 0X00, 0X00, 0X00, 0X3D, 0X00};
HANDLE _smc_WatchThreadHandle;
CGetDigitalLuxMeterValue::CGetDigitalLuxMeterValue()
{
m_iSerialComPort = 1;
@@ -49,7 +52,7 @@ void CGetDigitalLuxMeterValue::LoadConfig()
//CString strRS232BuadRate = _T("DigitalLuxMeterRS232BuadRate");
CString strRS232SleepTime = _T("DigitalLuxMeterRS232SleepTime");
CString strRS232CabStep = _T("DigitalLuxMeterCabStep");
CString strRS232LightType= _T("LightType");
CString strRS232LightType = _T("LightType");
CString strRS232RoadBoardNum = _T("RoadBoardNum");
CString strRS232CabCompGap = _T("DigitalLuxMeterCabCompGap");
CString strRS232CabGetSingRingInitValue = _T("DigitalLuxMeterGetSingRingInitValue");
@@ -110,7 +113,7 @@ void CGetDigitalLuxMeterValue::SaveIni()
unsigned __stdcall ReadLightData(LPVOID pThis)
{
CGetDigitalLuxMeterValue* _pThis = (CGetDigitalLuxMeterValue*)pThis;
auto _pThis = static_cast<CGetDigitalLuxMeterValue*>(pThis);
while (_serial_WatchThreadState == THREAD_STATE_RUNNING)
{
_pThis->OnGetRealTimeDigitalLuxMeterValueResult();
@@ -140,15 +143,15 @@ BOOL CGetDigitalLuxMeterValue::OnInit()
CString str = (L"Serial port open failed!");
str.AppendFormat((L"Port Number:"));
str.AppendFormat(_T("%d "), m_iSerialComPort);
MessageBoxEx(NULL, str, (L"Serial port"), MB_OK | MB_SYSTEMMODAL, MB_SYSTEMMODAL);
MessageBoxEx(nullptr, str, (L"Serial port"), MB_OK | MB_SYSTEMMODAL, MB_SYSTEMMODAL);
}
BOOL bReady = OnStartDigitalLuxMeter();
if (bReady)
{
_serial_WatchThreadState = THREAD_STATE_RUNNING;
_smc_WatchThreadHandle = CreateThread((LPSECURITY_ATTRIBUTES)NULL,
_smc_WatchThreadHandle = CreateThread(nullptr,
0, (LPTHREAD_START_ROUTINE)ReadLightData,
this, 0, NULL);
this, 0, nullptr);
}
}
return bInitState;
@@ -1,4 +1,3 @@
#include "stdafx.h"
#include "ReadWriteIni.h"
@@ -31,7 +30,7 @@ ReadWriteIni::ReadWriteIni(const wchar_t* szFilePath, const wchar_t* szSection)
bool ReadWriteIni::LoadFile(const wchar_t* szFilePath)
{
::GetFullPathNameW(szFilePath, MAX_PATH, m_szFilePath, NULL);
GetFullPathNameW(szFilePath, MAX_PATH, m_szFilePath, nullptr);
setSection(_T("Defalut"));
return true;
}
@@ -47,31 +46,29 @@ bool ReadWriteIni::SaveFile()
void ReadWriteIni::setSection(const wchar_t* szSection)
{
wcscpy_s(m_szSection, szSection);
return;
}
bool ReadWriteIni::delSection(const wchar_t* szSection)
{
return ::WritePrivateProfileStringW(szSection, NULL, NULL, m_szFilePath);
return WritePrivateProfileStringW(szSection, nullptr, nullptr, m_szFilePath);
}
bool ReadWriteIni::delKeyName(const wchar_t* szKeyName)
{
return ::WritePrivateProfileStringW(m_szSection, szKeyName, NULL, m_szFilePath);
return WritePrivateProfileStringW(m_szSection, szKeyName, nullptr, m_szFilePath);
}
bool ReadWriteIni::setInt(const wchar_t* szKey, int nVal)
{
swprintf_s(m_szValTemp, L"%d", nVal);
return ::WritePrivateProfileStringW(m_szSection, szKey, m_szValTemp, m_szFilePath);
return WritePrivateProfileStringW(m_szSection, szKey, m_szValTemp, m_szFilePath);
}
int ReadWriteIni::getInt(const wchar_t* szKey, int nDefVal /*= 0*/, bool bAddIfUnexist /*= false*/)
{
int UnExistNumber = LIMIT_MAX_32INT;
int nVal = ::GetPrivateProfileIntW(m_szSection, szKey, UnExistNumber, m_szFilePath);
int nVal = GetPrivateProfileIntW(m_szSection, szKey, UnExistNumber, m_szFilePath);
if (nVal == UnExistNumber)
{
if (bAddIfUnexist)
@@ -84,24 +81,24 @@ int ReadWriteIni::getInt(const wchar_t* szKey, int nDefVal /*= 0*/, bool bAddIfU
bool ReadWriteIni::setBool(const wchar_t* szKey, bool bVal)
{
return setInt(szKey, (int)bVal);
return setInt(szKey, bVal);
}
bool ReadWriteIni::getBool(const wchar_t* szKey, bool bDefVal /*= false*/, bool bAddIfUnexist /*= false*/)
{
return (bool)getInt(szKey, bDefVal, bAddIfUnexist);
return static_cast<bool>(getInt(szKey, bDefVal, bAddIfUnexist));
}
bool ReadWriteIni::setString(const wchar_t* szKey, const wchar_t* szVal)
{
return ::WritePrivateProfileStringW(m_szSection, szKey, szVal, m_szFilePath);
return WritePrivateProfileStringW(m_szSection, szKey, szVal, m_szFilePath);
}
const wchar_t* ReadWriteIni::getString(const wchar_t* szKey, const wchar_t* szDefVal /*= NULL*/, bool bAddIfUnexist /*= false*/)
const wchar_t* ReadWriteIni::getString(const wchar_t* szKey, const wchar_t* szDefVal /*= NULL*/,
bool bAddIfUnexist /*= false*/)
{
::GetPrivateProfileStringW(m_szSection, szKey, szDefVal, m_szValTemp, sizeof(m_szValTemp), m_szFilePath);
GetPrivateProfileStringW(m_szSection, szKey, szDefVal, m_szValTemp, sizeof(m_szValTemp), m_szFilePath);
if (bAddIfUnexist && (m_szValTemp[0] == 0) && (szDefVal != nullptr))
{
wcscpy_s(m_szValTemp, szDefVal);
@@ -114,36 +111,73 @@ bool ReadWriteIni::setDouble(const wchar_t* szKey, double dVal)
{
switch (m_nDefDoubleBitNum)
{
case 1: {swprintf_s(m_szValTemp, L"%.1f", dVal);break;}
case 2: {swprintf_s(m_szValTemp, L"%.2f", dVal);break;}
case 3: {swprintf_s(m_szValTemp, L"%.3f", dVal);break;}
case 4: {swprintf_s(m_szValTemp, L"%.4f", dVal);break;}
case 5: {swprintf_s(m_szValTemp, L"%.5f", dVal);break;}
case 6: {swprintf_s(m_szValTemp, L"%.6f", dVal);break;}
case 7: {swprintf_s(m_szValTemp, L"%.7f", dVal);break;}
case 8: {swprintf_s(m_szValTemp, L"%.8f", dVal);break;}
case 9: {swprintf_s(m_szValTemp, L"%.9f", dVal);break;}
default: {swprintf_s(m_szValTemp, L"%.6f", dVal);break;}
case 1:
{
swprintf_s(m_szValTemp, L"%.1f", dVal);
break;
}
case 2:
{
swprintf_s(m_szValTemp, L"%.2f", dVal);
break;
}
case 3:
{
swprintf_s(m_szValTemp, L"%.3f", dVal);
break;
}
case 4:
{
swprintf_s(m_szValTemp, L"%.4f", dVal);
break;
}
case 5:
{
swprintf_s(m_szValTemp, L"%.5f", dVal);
break;
}
case 6:
{
swprintf_s(m_szValTemp, L"%.6f", dVal);
break;
}
case 7:
{
swprintf_s(m_szValTemp, L"%.7f", dVal);
break;
}
case 8:
{
swprintf_s(m_szValTemp, L"%.8f", dVal);
break;
}
case 9:
{
swprintf_s(m_szValTemp, L"%.9f", dVal);
break;
}
default:
{
swprintf_s(m_szValTemp, L"%.6f", dVal);
break;
}
}
return setString(szKey, m_szValTemp);
}
double ReadWriteIni::getDouble(const wchar_t* szKey, double dDefVal/*=0*/, bool bAddIfUnexist /*= false*/)
{
const wchar_t* m_pVal = getString(szKey, 0, false);
const wchar_t* m_pVal = getString(szKey, nullptr, false);
if (m_pVal[0] != 0)
{
double dVal = _wtof(m_pVal);
return dVal;
}
else
{
if (bAddIfUnexist)
{
setDouble(szKey, dDefVal);
}
return dDefVal;
}
return 0.0f;
}
@@ -1,4 +1,3 @@
// UtilityForSo7Light.cpp : Defines the class behaviors for the application.
//
@@ -41,7 +40,7 @@ BOOL CUtilityForSo7LightApp::InitInstance()
// Create the shell manager, in case the dialog contains
// any shell tree view or shell list view controls.
CShellManager *pShellManager = new CShellManager;
auto pShellManager = new CShellManager;
// Activate "Windows Native" visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
@@ -71,11 +70,12 @@ BOOL CUtilityForSo7LightApp::InitInstance()
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n");
TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n");
TRACE(traceAppMsg, 0,
"Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n");
}
// Delete the shell manager created above.
if (pShellManager != NULL)
if (pShellManager != nullptr)
{
delete pShellManager;
}
@@ -84,4 +84,3 @@ BOOL CUtilityForSo7LightApp::InitInstance()
// application, rather than start the application's message pump.
return FALSE;
}
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -14,19 +14,20 @@
<ProjectGuid>{BFC37D2E-B136-44A0-9FC6-64A410E6C13A}</ProjectGuid>
<RootNamespace>UtilityForSo7Light</RootNamespace>
<Keyword>MFCProj</Keyword>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Static</UseOfMfc>
@@ -0,0 +1,87 @@
// UtilityForSo7Light.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "UtilityForSo7Light.h"
#include "UtilityForSo7LightDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CUtilityForSo7LightApp
BEGIN_MESSAGE_MAP(CUtilityForSo7LightApp, CWinApp)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CUtilityForSo7LightApp construction
CUtilityForSo7LightApp::CUtilityForSo7LightApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The one and only CUtilityForSo7LightApp object
CUtilityForSo7LightApp theApp;
// CUtilityForSo7LightApp initialization
BOOL CUtilityForSo7LightApp::InitInstance()
{
CWinApp::InitInstance();
// Create the shell manager, in case the dialog contains
// any shell tree view or shell list view controls.
CShellManager *pShellManager = new CShellManager;
// Activate "Windows Native" visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// 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"));
CUtilityForSo7LightDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
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
}
else if (nResponse == -1)
{
TRACE(traceAppMsg, 0, "Warning: dialog creation failed, so application is terminating unexpectedly.\n");
TRACE(traceAppMsg, 0, "Warning: if you are using MFC controls on the dialog, you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n");
}
// Delete the shell manager created above.
if (pShellManager != NULL)
{
delete pShellManager;
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
@@ -0,0 +1,287 @@
#include "stdafx.h"
#include "So7_Illumination.h"
#include "ReadWriteIni.h"
#include "GetDigitalLuxMeterValue.h"
enum eThreadSignal
{
THREAD_STATE_RUNNING, // Current state of the thread
THREAD_STATE_EXIT // Signal to thread to exit
};
unsigned __stdcall ReadLightData(LPVOID pThis);
eThreadSignal _serial_WatchThreadState;
const char DigitalLuxMeter_StopDatas[9] = { 0X3C,0X02,0X00,0X00,0X00,0X00,0X00,0XDE,0X00 };
const char DigitalLuxMeter_StartDatas[9] = { 0X1E,0X00,0X00,0X00,0X00,0X00,0X00,0X1E,0X00 };
const char DigitalLuxMeter_BeginDatas[9] = { 0X3C,0X01,0X00,0X00,0X00,0X00,0X00,0X3D,0X00 };
HANDLE _smc_WatchThreadHandle;
CGetDigitalLuxMeterValue::CGetDigitalLuxMeterValue()
{
m_iSerialComPort = 1;
m_iBuadRate = 19200;
m_iSleepTime = 50;
m_dCabStep = 0.1;
m_iCompareGap = 25;
m_iSelectLightType = 0;
m_iRoadBoardNum = 1;
m_iGetWhichRingForInitValue = 2;
m_iRingGapSleepTime = 20;
m_bIsEnableToGetLuxValue = true;
m_bGetSingleRingInitValue = true;
m_bPopUpPromptDialog = false;
}
CGetDigitalLuxMeterValue::~CGetDigitalLuxMeterValue()
{
_serial_WatchThreadState = THREAD_STATE_EXIT;
}
void CGetDigitalLuxMeterValue::LoadConfig()
{
CString filePath;
CSo7_Illumination oSo7Illum;
oSo7Illum.GetAppPath(filePath);
CString strFileName = filePath + _T("\\Device.Config.ini");
CString strKeyName = _T("DIGITAL_LUX_METER_RS232_SERIALCOMPORT");
CString strRS232Enable = _T("DigitalLuxMeterRS232Enable");
CString strRS232ComNum = _T("DigitalLuxMeterRS232ComNum");
//CString strRS232BuadRate = _T("DigitalLuxMeterRS232BuadRate");
CString strRS232SleepTime = _T("DigitalLuxMeterRS232SleepTime");
CString strRS232CabStep = _T("DigitalLuxMeterCabStep");
CString strRS232LightType= _T("LightType");
CString strRS232RoadBoardNum = _T("RoadBoardNum");
CString strRS232CabCompGap = _T("DigitalLuxMeterCabCompGap");
CString strRS232CabGetSingRingInitValue = _T("DigitalLuxMeterGetSingRingInitValue");
CString strRS232CabGetWhichRingForInitValue = _T("DigitalLuxMeterGetWhichRingForInitValue");
CString strPopUpPromptDialog = _T("PopUpPromptDialog");
CString strRingGapSleepTime = _T("RingGapSleepTime");
ReadWriteIni rIni(strFileName);
rIni.setSection(strKeyName);
m_bIsEnableToGetLuxValue = rIni.getBool(strRS232Enable, false, true);
m_bPopUpPromptDialog = rIni.getBool(strPopUpPromptDialog, false, true);
m_iSerialComPort = rIni.getInt(strRS232ComNum, 1, true);
m_iBuadRate = 19200;
//m_iBuadRate = rIni.getInt(strRS232BuadRate, 19200);
m_iSleepTime = rIni.getInt(strRS232SleepTime, 100, true);
m_dCabStep = rIni.getDouble(strRS232CabStep, 0.1, true);
m_iCompareGap = rIni.getInt(strRS232CabCompGap, 25, true);
m_iRoadBoardNum = rIni.getInt(strRS232RoadBoardNum, 1, true);
m_iSelectLightType = rIni.getInt(strRS232LightType, 0, true);
m_bGetSingleRingInitValue = rIni.getBool(strRS232CabGetSingRingInitValue, true, true);
m_iGetWhichRingForInitValue = rIni.getInt(strRS232CabGetWhichRingForInitValue, 2, true);
m_iRingGapSleepTime = rIni.getInt(strRingGapSleepTime, 20, true);
if ((m_iGetWhichRingForInitValue > 5) || (m_iGetWhichRingForInitValue < 0))
{
m_iGetWhichRingForInitValue = 2;
}
}
void CGetDigitalLuxMeterValue::SaveIni()
{
CString filePath;
CSo7_Illumination oSo7Illum;
oSo7Illum.GetAppPath(filePath);
CString strFileName = filePath + _T("\\Device.Config.ini");
CString strKeyName = _T("DIGITAL_LUX_METER_RS232_SERIALCOMPORT");
CString strRS232Enable = _T("DigitalLuxMeterRS232Enable");
CString strRS232ComNum = _T("DigitalLuxMeterRS232ComNum");
//CString strRS232BuadRate = _T("DigitalLuxMeterRS232BuadRate");
CString strRS232SleepTime = _T("DigitalLuxMeterRS232SleepTime");
CString strRS232CabStep = _T("DigitalLuxMeterCabStep");
CString strRS232LightType = _T("LightType");
CString strRS232RoadBoardNum = _T("RoadBoardNum");
CString strRS232CabCompGap = _T("DigitalLuxMeterCabCompGap");
CString strRS232CabGetSingRingInitValue = _T("DigitalLuxMeterGetSingRingInitValue");
CString strRS232CabGetWhichRingForInitValue = _T("DigitalLuxMeterGetWhichRingForInitValue");
ReadWriteIni wIni(strFileName);
wIni.setSection(strKeyName);
wIni.setBool(strRS232Enable, m_bIsEnableToGetLuxValue);
wIni.setInt(strRS232ComNum, m_iSerialComPort);
wIni.setInt(strRS232SleepTime, m_iSleepTime);
wIni.setDouble(strRS232CabStep, m_dCabStep);
wIni.setInt(strRS232RoadBoardNum, m_iRoadBoardNum);
wIni.setInt(strRS232LightType, m_iSelectLightType);
wIni.setInt(strRS232CabCompGap, m_iCompareGap);
wIni.setBool(strRS232CabGetSingRingInitValue, m_bGetSingleRingInitValue);
wIni.setInt(strRS232CabGetWhichRingForInitValue, m_iGetWhichRingForInitValue);
//wIni.setInt(strRS232BuadRate, m_iBuadRate);
}
unsigned __stdcall ReadLightData(LPVOID pThis)
{
CGetDigitalLuxMeterValue* _pThis = (CGetDigitalLuxMeterValue*)pThis;
while (_serial_WatchThreadState == THREAD_STATE_RUNNING)
{
_pThis->OnGetRealTimeDigitalLuxMeterValueResult();
}
return 0;
};
BOOL CGetDigitalLuxMeterValue::OnInit()
{
BOOL bInitState = FALSE;
LoadConfig();
if (m_bIsEnableToGetLuxValue)
{
m_SO7_Serial.SetPort(m_iSerialComPort, m_iBuadRate);
if (m_SO7_Serial.Open())
{
bInitState = TRUE;
}
else
{
bInitState = FALSE;
}
if (bInitState == FALSE)
{
CString str = (L"Serial port open failed!");
str.AppendFormat((L"Port Number:"));
str.AppendFormat(_T("%d "), m_iSerialComPort);
MessageBoxEx(NULL, str, (L"Serial port"), MB_OK | MB_SYSTEMMODAL, MB_SYSTEMMODAL);
}
BOOL bReady = OnStartDigitalLuxMeter();
if (bReady)
{
_serial_WatchThreadState = THREAD_STATE_RUNNING;
_smc_WatchThreadHandle = CreateThread((LPSECURITY_ATTRIBUTES)NULL,
0, (LPTHREAD_START_ROUTINE)ReadLightData,
this, 0, NULL);
}
}
return bInitState;
}
BOOL CGetDigitalLuxMeterValue::OnUninit()
{
if (m_bIsEnableToGetLuxValue)
{
m_SO7_Serial.Close();
_serial_WatchThreadState = THREAD_STATE_EXIT;
ExitThread(0);
}
return TRUE;
}
BOOL CGetDigitalLuxMeterValue::OnStartDigitalLuxMeter()
{
BOOL bState = FALSE;
DWORD iWriteByte = m_SO7_Serial.Send(DigitalLuxMeter_StopDatas, 9);
INT iRetrys(0);
Sleep(50);
iWriteByte = m_SO7_Serial.Send(DigitalLuxMeter_StartDatas, 9);
iRetrys = 0;
while (!m_SO7_Serial.m_iRecvState && iRetrys < 18 && iWriteByte == 9)
{
iRetrys++;
Sleep(50);
}
if (m_SO7_Serial.m_iRecvState)
{
m_SO7_Serial.m_iRecvState = FALSE;
}
else
{
bState = FALSE;
MessageBox(nullptr, L"Start digital lux meter error", L"Error", MB_ICONERROR);
}
iWriteByte = m_SO7_Serial.Send(DigitalLuxMeter_BeginDatas, 9);
iRetrys = 0;
while (!m_SO7_Serial.m_iRecvState && iRetrys < 18 && iWriteByte == 9)
{
iRetrys++;
Sleep(50);
}
if (m_SO7_Serial.m_iRecvState)
{
m_SO7_Serial.m_iRecvState = FALSE;
}
else
{
bState = FALSE;
MessageBox(nullptr, L"Start digital lux meter error", L"Error", MB_ICONERROR);
}
bState = TRUE;
return bState;
}
BOOL CGetDigitalLuxMeterValue::OnStopToGetRealTimeDigitalLuxMeterValue()
{
BOOL bState = FALSE;
DWORD iWriteByte = m_SO7_Serial.Send(DigitalLuxMeter_StopDatas, 9);
INT iRetrys(0);
while (!m_SO7_Serial.m_iRecvState && iRetrys < 18 && iWriteByte == 9)
{
iRetrys++;
Sleep(50);
}
if (m_SO7_Serial.m_iRecvState)
{
m_SO7_Serial.m_iRecvState = FALSE;
}
else
{
bState = FALSE;
MessageBox(nullptr, L"Stop digital lux meter error", L"Error", MB_ICONERROR);
}
bState = TRUE;
return bState;
}
void CGetDigitalLuxMeterValue::OnGetRealTimeDigitalLuxMeterValueResult()
{
INT iRetrys(0);
if (m_SO7_Serial.m_iRecvState)
{
if (m_SO7_Serial.m_iRecvBytes == 8)
{
int num3 = 0.0;
double num4 = 0.0;
int num5 = 0;
int num6 = 0.0;
num3 = m_SO7_Serial.m_RecvData[2] >> 6;
switch (num3)
{
case 0:
num4 = 1.0;
break;
case 1:
num4 = 10.0;
break;
case 2:
num4 = 100.0;
break;
case 3:
num4 = 1000.0;
break;
}
num5 = m_SO7_Serial.m_RecvData[2] & 0x3f;
num6 = m_SO7_Serial.m_RecvData[3];
double value1 = ((num5 * 0x100) + num6) * 0.1;
m_dLuxVal = value1 * num4;
m_dTempVal = (m_SO7_Serial.m_RecvData[5] * 0x100) + m_SO7_Serial.m_RecvData[6];
if (m_SO7_Serial.m_RecvData[4] == 0)
{
m_dTempVal *= -0.1;
}
else
{
m_dTempVal *= 0.1;
}
}
m_SO7_Serial.m_iRecvState = FALSE;
}
else
{
Sleep(50);
}
}
@@ -0,0 +1,416 @@
#ifndef __USB_H__
#define __USB_H__
#include <stdlib.h>
#include <windows.h>
/*
* '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 <pshpack1.h>
/* 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 <poppack.h>
#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);
/* <arch>.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__ */
@@ -0,0 +1,415 @@
#ifndef __USB_H__
#define __USB_H__
#include <stdlib.h>
#include <windows.h>
/*
* '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 <pshpack1.h>
/* 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 <poppack.h>
#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);
/* <arch>.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__ */
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -22,26 +22,27 @@
<ProjectGuid>{8597AC0D-59A6-43D6-80E4-B7D7B9E49F47}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>HSI_ADT_8949</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
@@ -49,7 +50,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
@@ -85,7 +86,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;HSI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
@@ -105,7 +106,7 @@ xcopy "$(OutDir)\$(ProjectName).pdb" ..\HSI_ADT_8949_WPFTest\bin\Debug\HSI.pdb/D
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;HSI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.19041.0
Debug|x64|E:\HexagonProjects\EF3-Interfac\PcDmis\Base\Interfac\Msi\Hsi\Tools\UsbUtility\|
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
@@ -0,0 +1,70 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E1E7A4CE548DC0E20DEB3424B333A80B7552DEE8"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 4 "..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
HSI_ADT_8949_WPFTest.App app = new HSI_ADT_8949_WPFTest.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -0,0 +1,70 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E1E7A4CE548DC0E20DEB3424B333A80B7552DEE8"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 4 "..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
HSI_ADT_8949_WPFTest.App app = new HSI_ADT_8949_WPFTest.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -0,0 +1,334 @@
#pragma checksum "..\..\Trigger.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77E72869BBD83963DB2C19418134A31A7CABE3F2"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// Trigger
/// </summary>
public partial class Trigger : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 9 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Forms.DataGridView dataGridViewTrg;
#line default
#line hidden
#line 12 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxInternal;
#line default
#line hidden
#line 15 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalNo;
#line default
#line hidden
#line 17 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalDis;
#line default
#line hidden
#line 18 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStart;
#line default
#line hidden
#line 19 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStop;
#line default
#line hidden
#line 20 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalClose;
#line default
#line hidden
#line 24 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxAxis;
#line default
#line hidden
#line 26 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis1;
#line default
#line hidden
#line 27 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis2;
#line default
#line hidden
#line 28 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis3;
#line default
#line hidden
#line 29 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis4;
#line default
#line hidden
#line 32 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxLinear;
#line default
#line hidden
#line 34 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStart;
#line default
#line hidden
#line 35 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStop;
#line default
#line hidden
#line 36 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearAddNum;
#line default
#line hidden
#line 37 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearDecNum;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/HSI_ADT_8949_WPFTest;component/trigger.xaml", System.UriKind.Relative);
#line 1 "..\..\Trigger.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 6 "..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Closed += new System.EventHandler(this.Window_Closed);
#line default
#line hidden
#line 6 "..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
return;
case 2:
this.dataGridViewTrg = ((System.Windows.Forms.DataGridView)(target));
#line 9 "..\..\Trigger.xaml"
this.dataGridViewTrg.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewTrg_CellEndEdit);
#line default
#line hidden
return;
case 3:
this.GroupBoxInternal = ((System.Windows.Controls.GroupBox)(target));
return;
case 4:
this.TextBoxInternalNo = ((System.Windows.Controls.TextBox)(target));
#line 15 "..\..\Trigger.xaml"
this.TextBoxInternalNo.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.TextBoxInternalNo_MouseWheel);
#line default
#line hidden
return;
case 5:
this.TextBoxInternalDis = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.ButtonInternalStart = ((System.Windows.Controls.Button)(target));
#line 18 "..\..\Trigger.xaml"
this.ButtonInternalStart.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStart_Click);
#line default
#line hidden
return;
case 7:
this.ButtonInternalStop = ((System.Windows.Controls.Button)(target));
#line 19 "..\..\Trigger.xaml"
this.ButtonInternalStop.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStop_Click);
#line default
#line hidden
return;
case 8:
this.ButtonInternalClose = ((System.Windows.Controls.Button)(target));
#line 20 "..\..\Trigger.xaml"
this.ButtonInternalClose.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalClose_Click);
#line default
#line hidden
return;
case 9:
this.GroupBoxAxis = ((System.Windows.Controls.GroupBox)(target));
return;
case 10:
this.RadioButtonAxis1 = ((System.Windows.Controls.RadioButton)(target));
return;
case 11:
this.RadioButtonAxis2 = ((System.Windows.Controls.RadioButton)(target));
return;
case 12:
this.RadioButtonAxis3 = ((System.Windows.Controls.RadioButton)(target));
return;
case 13:
this.RadioButtonAxis4 = ((System.Windows.Controls.RadioButton)(target));
return;
case 14:
this.GroupBoxLinear = ((System.Windows.Controls.GroupBox)(target));
return;
case 15:
this.ButtonLinearStart = ((System.Windows.Controls.Button)(target));
#line 34 "..\..\Trigger.xaml"
this.ButtonLinearStart.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStart_Click);
#line default
#line hidden
return;
case 16:
this.ButtonLinearStop = ((System.Windows.Controls.Button)(target));
#line 35 "..\..\Trigger.xaml"
this.ButtonLinearStop.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStop_Click);
#line default
#line hidden
return;
case 17:
this.ButtonLinearAddNum = ((System.Windows.Controls.Button)(target));
#line 36 "..\..\Trigger.xaml"
this.ButtonLinearAddNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearAddNum_Click);
#line default
#line hidden
return;
case 18:
this.ButtonLinearDecNum = ((System.Windows.Controls.Button)(target));
#line 37 "..\..\Trigger.xaml"
this.ButtonLinearDecNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearDecNum_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -0,0 +1,334 @@
#pragma checksum "..\..\Trigger.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77E72869BBD83963DB2C19418134A31A7CABE3F2"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// Trigger
/// </summary>
public partial class Trigger : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 9 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Forms.DataGridView dataGridViewTrg;
#line default
#line hidden
#line 12 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxInternal;
#line default
#line hidden
#line 15 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalNo;
#line default
#line hidden
#line 17 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalDis;
#line default
#line hidden
#line 18 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStart;
#line default
#line hidden
#line 19 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStop;
#line default
#line hidden
#line 20 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalClose;
#line default
#line hidden
#line 24 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxAxis;
#line default
#line hidden
#line 26 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis1;
#line default
#line hidden
#line 27 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis2;
#line default
#line hidden
#line 28 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis3;
#line default
#line hidden
#line 29 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis4;
#line default
#line hidden
#line 32 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxLinear;
#line default
#line hidden
#line 34 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStart;
#line default
#line hidden
#line 35 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStop;
#line default
#line hidden
#line 36 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearAddNum;
#line default
#line hidden
#line 37 "..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearDecNum;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/HSI_ADT_8949_WPFTest;component/trigger.xaml", System.UriKind.Relative);
#line 1 "..\..\Trigger.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 6 "..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Closed += new System.EventHandler(this.Window_Closed);
#line default
#line hidden
#line 6 "..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
return;
case 2:
this.dataGridViewTrg = ((System.Windows.Forms.DataGridView)(target));
#line 9 "..\..\Trigger.xaml"
this.dataGridViewTrg.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewTrg_CellEndEdit);
#line default
#line hidden
return;
case 3:
this.GroupBoxInternal = ((System.Windows.Controls.GroupBox)(target));
return;
case 4:
this.TextBoxInternalNo = ((System.Windows.Controls.TextBox)(target));
#line 15 "..\..\Trigger.xaml"
this.TextBoxInternalNo.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.TextBoxInternalNo_MouseWheel);
#line default
#line hidden
return;
case 5:
this.TextBoxInternalDis = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.ButtonInternalStart = ((System.Windows.Controls.Button)(target));
#line 18 "..\..\Trigger.xaml"
this.ButtonInternalStart.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStart_Click);
#line default
#line hidden
return;
case 7:
this.ButtonInternalStop = ((System.Windows.Controls.Button)(target));
#line 19 "..\..\Trigger.xaml"
this.ButtonInternalStop.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStop_Click);
#line default
#line hidden
return;
case 8:
this.ButtonInternalClose = ((System.Windows.Controls.Button)(target));
#line 20 "..\..\Trigger.xaml"
this.ButtonInternalClose.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalClose_Click);
#line default
#line hidden
return;
case 9:
this.GroupBoxAxis = ((System.Windows.Controls.GroupBox)(target));
return;
case 10:
this.RadioButtonAxis1 = ((System.Windows.Controls.RadioButton)(target));
return;
case 11:
this.RadioButtonAxis2 = ((System.Windows.Controls.RadioButton)(target));
return;
case 12:
this.RadioButtonAxis3 = ((System.Windows.Controls.RadioButton)(target));
return;
case 13:
this.RadioButtonAxis4 = ((System.Windows.Controls.RadioButton)(target));
return;
case 14:
this.GroupBoxLinear = ((System.Windows.Controls.GroupBox)(target));
return;
case 15:
this.ButtonLinearStart = ((System.Windows.Controls.Button)(target));
#line 34 "..\..\Trigger.xaml"
this.ButtonLinearStart.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStart_Click);
#line default
#line hidden
return;
case 16:
this.ButtonLinearStop = ((System.Windows.Controls.Button)(target));
#line 35 "..\..\Trigger.xaml"
this.ButtonLinearStop.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStop_Click);
#line default
#line hidden
return;
case 17:
this.ButtonLinearAddNum = ((System.Windows.Controls.Button)(target));
#line 36 "..\..\Trigger.xaml"
this.ButtonLinearAddNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearAddNum_Click);
#line default
#line hidden
return;
case 18:
this.ButtonLinearDecNum = ((System.Windows.Controls.Button)(target));
#line 37 "..\..\Trigger.xaml"
this.ButtonLinearDecNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearDecNum_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -0,0 +1,70 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E1E7A4CE548DC0E20DEB3424B333A80B7552DEE8"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 4 "..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
HSI_ADT_8949_WPFTest.App app = new HSI_ADT_8949_WPFTest.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -1,11 +1,11 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "E1E7A4CE548DC0E20DEB3424B333A80B7552DEE8"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
@@ -1,11 +1,11 @@
#pragma checksum "..\..\..\MainWindow.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "191B84DC751D7E3F5EF45FC43949A2BD86AC15FA"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
@@ -0,0 +1,334 @@
#pragma checksum "..\..\..\Trigger.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77E72869BBD83963DB2C19418134A31A7CABE3F2"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_ADT_8949_WPFTest {
/// <summary>
/// Trigger
/// </summary>
public partial class Trigger : System.Windows.Window, System.Windows.Markup.IComponentConnector {
#line 9 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Forms.DataGridView dataGridViewTrg;
#line default
#line hidden
#line 12 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxInternal;
#line default
#line hidden
#line 15 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalNo;
#line default
#line hidden
#line 17 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox TextBoxInternalDis;
#line default
#line hidden
#line 18 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStart;
#line default
#line hidden
#line 19 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalStop;
#line default
#line hidden
#line 20 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonInternalClose;
#line default
#line hidden
#line 24 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxAxis;
#line default
#line hidden
#line 26 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis1;
#line default
#line hidden
#line 27 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis2;
#line default
#line hidden
#line 28 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis3;
#line default
#line hidden
#line 29 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.RadioButton RadioButtonAxis4;
#line default
#line hidden
#line 32 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.GroupBox GroupBoxLinear;
#line default
#line hidden
#line 34 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStart;
#line default
#line hidden
#line 35 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearStop;
#line default
#line hidden
#line 36 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearAddNum;
#line default
#line hidden
#line 37 "..\..\..\Trigger.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button ButtonLinearDecNum;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/HSI_ADT_8949_WPFTest;component/trigger.xaml", System.UriKind.Relative);
#line 1 "..\..\..\Trigger.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
#line 6 "..\..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Closed += new System.EventHandler(this.Window_Closed);
#line default
#line hidden
#line 6 "..\..\..\Trigger.xaml"
((HSI_ADT_8949_WPFTest.Trigger)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
#line default
#line hidden
return;
case 2:
this.dataGridViewTrg = ((System.Windows.Forms.DataGridView)(target));
#line 9 "..\..\..\Trigger.xaml"
this.dataGridViewTrg.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridViewTrg_CellEndEdit);
#line default
#line hidden
return;
case 3:
this.GroupBoxInternal = ((System.Windows.Controls.GroupBox)(target));
return;
case 4:
this.TextBoxInternalNo = ((System.Windows.Controls.TextBox)(target));
#line 15 "..\..\..\Trigger.xaml"
this.TextBoxInternalNo.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.TextBoxInternalNo_MouseWheel);
#line default
#line hidden
return;
case 5:
this.TextBoxInternalDis = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.ButtonInternalStart = ((System.Windows.Controls.Button)(target));
#line 18 "..\..\..\Trigger.xaml"
this.ButtonInternalStart.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStart_Click);
#line default
#line hidden
return;
case 7:
this.ButtonInternalStop = ((System.Windows.Controls.Button)(target));
#line 19 "..\..\..\Trigger.xaml"
this.ButtonInternalStop.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalStop_Click);
#line default
#line hidden
return;
case 8:
this.ButtonInternalClose = ((System.Windows.Controls.Button)(target));
#line 20 "..\..\..\Trigger.xaml"
this.ButtonInternalClose.Click += new System.Windows.RoutedEventHandler(this.ButtonInternalClose_Click);
#line default
#line hidden
return;
case 9:
this.GroupBoxAxis = ((System.Windows.Controls.GroupBox)(target));
return;
case 10:
this.RadioButtonAxis1 = ((System.Windows.Controls.RadioButton)(target));
return;
case 11:
this.RadioButtonAxis2 = ((System.Windows.Controls.RadioButton)(target));
return;
case 12:
this.RadioButtonAxis3 = ((System.Windows.Controls.RadioButton)(target));
return;
case 13:
this.RadioButtonAxis4 = ((System.Windows.Controls.RadioButton)(target));
return;
case 14:
this.GroupBoxLinear = ((System.Windows.Controls.GroupBox)(target));
return;
case 15:
this.ButtonLinearStart = ((System.Windows.Controls.Button)(target));
#line 34 "..\..\..\Trigger.xaml"
this.ButtonLinearStart.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStart_Click);
#line default
#line hidden
return;
case 16:
this.ButtonLinearStop = ((System.Windows.Controls.Button)(target));
#line 35 "..\..\..\Trigger.xaml"
this.ButtonLinearStop.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearStop_Click);
#line default
#line hidden
return;
case 17:
this.ButtonLinearAddNum = ((System.Windows.Controls.Button)(target));
#line 36 "..\..\..\Trigger.xaml"
this.ButtonLinearAddNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearAddNum_Click);
#line default
#line hidden
return;
case 18:
this.ButtonLinearDecNum = ((System.Windows.Controls.Button)(target));
#line 37 "..\..\..\Trigger.xaml"
this.ButtonLinearDecNum.Click += new System.Windows.RoutedEventHandler(this.ButtonLinearDecNum_Click);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
}
}
@@ -1,11 +1,11 @@
#pragma checksum "..\..\..\Trigger.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "77E72869BBD83963DB2C19418134A31A7CABE3F2"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.19041.0
Debug|Win32|E:\HexagonProjects\2022-05-直线电机平台\EF3-Interfac\PcDmis\Base\Interfac\Msi\Hsi\Tools\UsbUtility\HSI_GOOGOL_GTS800\|
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@@ -22,26 +22,27 @@
<ProjectGuid>{BD031D38-59E8-47B8-9FE3-2E6F5F5CC7B3}</ProjectGuid>
<RootNamespace>HSI_GOOGOL_GTS800</RootNamespace>
<Keyword>MFCDLLProj</Keyword>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
@@ -49,7 +50,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
@@ -1,16 +1,16 @@
/// Auto Gen File of Version In Hg Release Status
#pragma once
#define HSI_VERSION_RELEASE
#define HSI_VERSION_NUM 386
#define HSI_VERSION_SET _T("6d6585cd5f47")
#define HSI_VERSION_NUM 469
#define HSI_VERSION_SET _T("4bd7d1b")
///
#define HSI_VERSION "3.1.2"
#define HSI_VERSION_CSTRING _T("3.1.2")
#define HSI_VERSION_MAJOR 3
#define HSI_VERSION_MINOR 1
#define HSI_VERSION_REVISION 2
#define HSI_VERSION_REVNUM 386
#define HSI_VERSION_REVNUM 469
#define HSI_VERSION_BUILD_DATE _T(__DATE__ )
#define HSI_VERSION_BUILD_TIME _T(__TIME__ )
#define HSI_FILE_DESCRIPTION "2017.02.23 / 17:18 386"
#define HSI_FILE_CSDESCRIPTION _T("2017.02.23 / 17:18 386")
#define HSI_FILE_DESCRIPTION "2022.09.30 / 15:45 469"
#define HSI_FILE_CSDESCRIPTION _T("2022.09.30 / 15:45 469")
@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
Debug|x64|D:\Metus_git\2020_R1\HG_EF7_HSI_EF1\PcDmis\Base\Interfac\Msi\Hsi\Tools\UsbUtility\|
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.19041.0
Debug|x64|E:\HexagonProjects\EF3-Interfac\PcDmis\Base\Interfac\Msi\Hsi\Tools\UsbUtility\|
@@ -142,26 +142,26 @@ namespace HSI_GOOGOL_GTS800_WPFTest.HSI
{
case Def.HSI_NOTIFY_TYPE.HSI_NOTIFY_PROGRAM_EXECUTION_START:
{
Message msg = Message.Create(MainWindow.Mainhwnd, 1020, new IntPtr(0), new IntPtr(0)); //创建消息
Message msg = Message.Create(MainWindow.Mainhwnd, 1020, new IntPtr(0), new IntPtr(0)); //Ϣ
MainWindow.SendMessage(msg.HWnd, msg.Msg, msg.WParam, msg.LParam);
break;
}
}
break;
//安全光栅
//ȫդ
case Def.HSI_EVENT_TYPE.HSI_EVENT_SAFETY:
var eventFunctionId3 = (Def.HSI_NOTIFY_TYPE)eventId;
switch (eventFunctionId3)
{
case Def.HSI_NOTIFY_TYPE.HSI_NOTIFY_PROGRAM_EXECUTION_STOP:
{
Message msg = Message.Create(MainWindow.Mainhwnd, 1021, new IntPtr(0), new IntPtr(0)); //创建消息
Message msg = Message.Create(MainWindow.Mainhwnd, 1021, new IntPtr(0), new IntPtr(0)); //Ϣ
MainWindow.SendMessage(msg.HWnd, msg.Msg, msg.WParam, msg.LParam);
break;
}
case Def.HSI_NOTIFY_TYPE.HSI_NOTIFY_PROGRAM_EXECUTION_START:
{
Message msg = Message.Create(MainWindow.Mainhwnd, 1022, new IntPtr(0), new IntPtr(0)); //创建消息
Message msg = Message.Create(MainWindow.Mainhwnd, 1022, new IntPtr(0), new IntPtr(0)); //Ϣ
MainWindow.SendMessage(msg.HWnd, msg.Msg, msg.WParam, msg.LParam);
break;
}
@@ -672,9 +672,9 @@ namespace HSI_GOOGOL_GTS800_WPFTest.HSI
HSI_SCAN_MOTION_SPEC_LOCA = 100, //EF1
HSI_SCAN_MOTION_EQ_DIS,
HSI_SCAN_MOTION_EQ_DIS_II,
HSI_SCAN_MOTION_LINEAR_TEST,//测试使用
HSI_SCAN_MOTION_EQ_TEST,//测试使用
HSI_SCAN_MOTION_MANUAL_TEST//测试使用
HSI_SCAN_MOTION_LINEAR_TEST,//ʹ
HSI_SCAN_MOTION_EQ_TEST,//ʹ
HSI_SCAN_MOTION_MANUAL_TEST//ʹ
};
public const int HSI_MAX_POSITIONS_STORED = 500;
@@ -3,4 +3,4 @@ using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
[assembly: AssemblyTitle("tip 2017.02.24.14:44 387")]
[assembly: AssemblyTitle("tip 周日 2.22.10.14:35 ")]
@@ -0,0 +1,86 @@
[JOG_SPEED]
JOG_SPEED_0=200.0
JOG_STARTV_0=5.0
JOG_ACC_TIME_0=0.2
JOG_DEC_TIME_0=0.2
JOG_SPEED_1=150.0
JOG_STARTV_1=5.0
JOG_ACC_TIME_1=0.2
JOG_DEC_TIME_1=0.2
JOG_SPEED_2=100.0
JOG_STARTV_2=5.0
JOG_ACC_TIME_2=0.2
JOG_DEC_TIME_2=0.2
JOG_SPEED_3=10.0
JOG_STARTV_3=5.0
JOG_ACC_TIME_3=0.2
JOG_DEC_TIME_3=0.2
JOG_SPEED_4=1.0
JOG_STARTV_4=5.0
JOG_ACC_TIME_4=0.2
JOG_DEC_TIME_4=0.2
[RESOLUTION]
SCALE_RESOLUTION_1=0.0004
SCALE_RESOLUTION_2=0.0004
SCALE_RESOLUTION_3=0.0004
SCALE_RESOLUTION_4=0.0004
[LIMIT]
NEG_WORKING_LIMIT_1=-260.0
POS_WORKING_LIMIT_1=40.0
NEG_WORKING_LIMIT_2=-40.0
POS_WORKING_LIMIT_2=160.0
NEG_WORKING_LIMIT_3=-40.0
POS_WORKING_LIMIT_3=160.0
NEG_WORKING_LIMIT_4=-40.0
POS_WORKING_LIMIT_4=200.0
[HOME]
HOME_HIGH_SPEED_1=200.0
HOME_HIGH_ACC_TIME_1=0.2
HOME_LOW_SPEED_1=180.0
HOME_LOW_ACC_TIME_1=0.2
HOME_TIME_1=1000
HOME_MACHINE_AXIS_1=1
HOME_HIGH_SPEED_2=200.0
HOME_HIGH_ACC_TIME_2=0.2
HOME_LOW_SPEED_2=180.0
HOME_LOW_ACC_TIME_2=0.2
HOME_TIME_2=1000
HOME_MACHINE_AXIS_2=1
HOME_HIGH_SPEED_3=200.0
HOME_HIGH_ACC_TIME_3=0.2
HOME_LOW_SPEED_3=180.0
HOME_LOW_ACC_TIME_3=0.2
HOME_TIME_3=1000
HOME_MACHINE_AXIS_3=1
HOME_HIGH_SPEED_4=200.0
HOME_HIGH_ACC_TIME_4=0.2
HOME_LOW_SPEED_4=180.0
HOME_LOW_ACC_TIME_4=0.2
HOME_TIME_4=1000
HOME_MACHINE_AXIS_4=0
[PRECISION]
PRECISION_COUNT_1=8
PRECISION_TIME_1=20000
PRECISION_COUNT_2=8
PRECISION_TIME_2=20000
PRECISION_COUNT_3=8
PRECISION_TIME_3=20000
PRECISION_COUNT_4=8
PRECISION_TIME_4=20000
[SET_POSITION_SPEED]
SET_POTION_SPEED_1=500.0
SET_POTION_ACC_TIME_1=0.2
SET_POTION_DEC_TIME_1=0.2
SET_POSITION_COUNT_1=240
SET_POTION_SPEED_2=500.0
SET_POTION_ACC_TIME_2=0.2
SET_POTION_DEC_TIME_2=0.2
SET_POSITION_COUNT_2=240
SET_POTION_SPEED_3=500.0
SET_POTION_ACC_TIME_3=0.2
SET_POTION_DEC_TIME_3=0.2
SET_POSITION_COUNT_3=240
SET_POTION_SPEED_4=500.0
SET_POTION_ACC_TIME_4=0.2
SET_POTION_DEC_TIME_4=0.2
SET_POSITION_COUNT_4=240
@@ -0,0 +1,337 @@
[JOG_SPEED]
JOG速度(pulse/ms)
JOG_SPEED_0=200.0
JOG_SPEED_1=150.0
JOG_SPEED_2=50
JOG_SPEED_3=10
JOG_SPEED_4=1
;JOG加速度(pulse/ms^2)
JOG_ACC_0=2.0
JOG_ACC_1=2.0
JOG_ACC_2=2.0
JOG_ACC_3=1.0
JOG_ACC_4=1.0
;JOG减速度(pulse/ms^2)
JOG_DEC_0=2.0
JOG_DEC_1=2.0
JOG_DEC_2=2.0
JOG_DEC_3=1.0
JOG_DEC_4=1.0
;JOG模式采用急停还是平滑停止,0是平滑停止1为急停,默认0
JOG_STOP_MODE_1=0
JOG_STOP_MODE_2=0
JOG_STOP_MODE_3=0
JOG_STOP_MODE_4=0
JOG_STOP_MODE_5=0
JOG_STOP_MODE_6=0
JOG_STOP_MODE_7=0
JOG_STOP_MODE_8=0
JOG_STOP_MODE=0
JOG_SPEED_GEAR0_1=200.0
JOG_ACC_GEAR0_1=2.0
JOG_DEC_GEAR0_1=2.0
JOG_SPEED_GEAR0_2=200.0
JOG_ACC_GEAR0_2=2.0
JOG_DEC_GEAR0_2=2.0
JOG_SPEED_GEAR0_3=150.0
JOG_ACC_GEAR0_3=2.0
JOG_DEC_GEAR0_3=2.0
JOG_SPEED_GEAR0_4=200.0
JOG_ACC_GEAR0_4=2.0
JOG_DEC_GEAR0_4=2.0
JOG_SPEED_GEAR1_1=100.0
JOG_ACC_GEAR1_1=2.0
JOG_DEC_GEAR1_1=2.0
JOG_SPEED_GEAR1_2=100.0
JOG_ACC_GEAR1_2=2.0
JOG_DEC_GEAR1_2=2.0
JOG_SPEED_GEAR1_3=80.0
JOG_ACC_GEAR1_3=2.0
JOG_DEC_GEAR1_3=2.0
JOG_SPEED_GEAR1_4=100.0
JOG_ACC_GEAR1_4=2.0
JOG_DEC_GEAR1_4=2.0
JOG_SPEED_GEAR2_1=50.0
JOG_ACC_GEAR2_1=2.0
JOG_DEC_GEAR2_1=2.0
JOG_SPEED_GEAR2_2=50.0
JOG_ACC_GEAR2_2=2.0
JOG_DEC_GEAR2_2=2.0
JOG_SPEED_GEAR2_3=50.0
JOG_ACC_GEAR2_3=2.0
JOG_DEC_GEAR2_3=2.0
JOG_SPEED_GEAR2_4=50.0
JOG_ACC_GEAR2_4=2.0
JOG_DEC_GEAR2_4=2.0
JOG_SPEED_GEAR3_1=10.0
JOG_ACC_GEAR3_1=1.0
JOG_DEC_GEAR3_1=1.0
JOG_SPEED_GEAR3_2=10.0
JOG_ACC_GEAR3_2=1.0
JOG_DEC_GEAR3_2=1.0
JOG_SPEED_GEAR3_3=10.0
JOG_ACC_GEAR3_3=1.0
JOG_DEC_GEAR3_3=1.0
JOG_SPEED_GEAR3_4=10.0
JOG_ACC_GEAR3_4=1.0
JOG_DEC_GEAR3_4=1.0
JOG_SPEED_GEAR4_1=1.0
JOG_ACC_GEAR4_1=1.0
JOG_DEC_GEAR4_1=1.0
JOG_SPEED_GEAR4_2=1.0
JOG_ACC_GEAR4_2=1.0
JOG_DEC_GEAR4_2=1.0
JOG_SPEED_GEAR4_3=1.0
JOG_ACC_GEAR4_3=1.0
JOG_DEC_GEAR4_3=1.0
JOG_SPEED_GEAR4_4=1.0
JOG_ACC_GEAR4_4=1.0
JOG_DEC_GEAR4_4=1.0
;0:都使用(正常情况) 1:只使用灯,而不使用控制器;默认0
[USE_LIGHT]
ONLY_USE_LIGHT=0
[RESOLUTION]
;光栅尺的分辨率(mm)
SCALE_RESOLUTION_1=0.0004
SCALE_RESOLUTION_2=0.0004
SCALE_RESOLUTION_3=0.0004
SCALE_RESOLUTION_4=0.0004
SCALE_RESOLUTION_5=0.0004
SCALE_RESOLUTION_6=0.0004
SCALE_RESOLUTION_7=0.0004
SCALE_RESOLUTION_8=0.0004
[LIMIT]
;负限位(mm),必须是负数
NEG_WORKING_LIMIT_1=-260.0
NEG_WORKING_LIMIT_2=-40.0
NEG_WORKING_LIMIT_3=-40.0
NEG_WORKING_LIMIT_4=-40.0
NEG_WORKING_LIMIT_5=-40.0
NEG_WORKING_LIMIT_6=-40.0
NEG_WORKING_LIMIT_7=-40.0
NEG_WORKING_LIMIT_8=-40.0
;正限位(mm),必须是正数
POS_WORKING_LIMIT_1=40.0
POS_WORKING_LIMIT_2=160.0
POS_WORKING_LIMIT_3=160.0
POS_WORKING_LIMIT_4=200.0
POS_WORKING_LIMIT_5=200.0
POS_WORKING_LIMIT_6=200.0
POS_WORKING_LIMIT_7=200.0
POS_WORKING_LIMIT_8=200.0
[HOME]
;选择需要回家的轴号,改为1
HOME_MACHINE_AXIS_1=1
HOME_MACHINE_AXIS_2=1
HOME_MACHINE_AXIS_3=1
HOME_MACHINE_AXIS_4=0
HOME_MACHINE_AXIS_5=0
HOME_MACHINE_AXIS_6=0
HOME_MACHINE_AXIS_7=0
HOME_MACHINE_AXIS_8=0
;是否启动实际位置判断是否回家,默认0,1启用,0关闭
IS_HOME_ENC_POS=0
;是否启动规划位置判断是否回家,默认1,1启用,0关闭
IS_HOME_PRF_POS=1
;关闭电源时记住当前的位置,用于判断是否需要回家
HOME_POS_AXIS_1=0
HOME_POS_AXIS_2=0
HOME_POS_AXIS_3=0
HOME_POS_AXIS_4=0
HOME_POS_AXIS_5=0
HOME_POS_AXIS_6=0
HOME_POS_AXIS_7=0
HOME_POS_AXIS_8=0
;回家第一段速度(pulse/ms)
HOME_HIGH_SPEED_1=200.0
HOME_HIGH_SPEED_2=200.0
HOME_HIGH_SPEED_3=200.0
HOME_HIGH_SPEED_4=200.0
HOME_HIGH_SPEED_5=200.0
HOME_HIGH_SPEED_6=200.0
HOME_HIGH_SPEED_7=200.0
HOME_HIGH_SPEED_8=200.0
;回家第一段加速度(pulse/ms^2)
HOME_HIGH_ACC_1=2.0
HOME_HIGH_ACC_2=2.0
HOME_HIGH_ACC_3=2.0
HOME_HIGH_ACC_4=2.0
HOME_HIGH_ACC_5=2.0
HOME_HIGH_ACC_6=2.0
HOME_HIGH_ACC_7=2.0
HOME_HIGH_ACC_8=2.0
;回家第二段速度(pulse/ms)
HOME_LOW_SPEED_1=180.0
HOME_LOW_SPEED_2=180.0
HOME_LOW_SPEED_3=180.0
HOME_LOW_SPEED_4=180.0
HOME_LOW_SPEED_5=180.0
HOME_LOW_SPEED_6=180.0
HOME_LOW_SPEED_7=180.0
HOME_LOW_SPEED_8=180.0
;回家第二段加速度(pulse/ms^2)
HOME_LOW_ACC_1=2.0
HOME_LOW_ACC_2=2.0
HOME_LOW_ACC_3=2.0
HOME_LOW_ACC_4=2.0
HOME_LOW_ACC_5=2.0
HOME_LOW_ACC_6=2.0
HOME_LOW_ACC_7=2.0
HOME_LOW_ACC_8=2.0
;回家延时时间(ms)
HOME_TIME_1=1000
HOME_TIME_2=1000
HOME_TIME_3=1000
HOME_TIME_4=1000
HOME_TIME_5=1000
HOME_TIME_6=1000
HOME_TIME_7=1000
HOME_TIME_8=1000
[PID]
;PID比例调节,应从0.01递增开始调试
PID_KP_1=1.20
PID_KP_2=1.20
PID_KP_3=1.20
PID_KP_4=1.20
PID_KP_5=1.20
PID_KP_6=1.20
PID_KP_7=1.20
PID_KP_8=1.20
[PRECISION]
;超时时间(0.1ms)
PRECISION_TIME_1=20000
PRECISION_TIME_2=20000
PRECISION_TIME_3=20000
PRECISION_TIME_4=20000
PRECISION_TIME_5=20000
PRECISION_TIME_6=20000
PRECISION_TIME_7=20000
PRECISION_TIME_8=20000
;回家误差脉冲个数
PRECISION_COUNT_1=8
PRECISION_COUNT_2=8
PRECISION_COUNT_3=8
PRECISION_COUNT_4=8
PRECISION_COUNT_5=8
PRECISION_COUNT_6=8
PRECISION_COUNT_7=8
PRECISION_COUNT_8=8
[SET_POSITION_SPEED]
;XYZ定位的合成速度(pulse/ms)
SET_POTION_SPEED_1=500.0
SET_POTION_SPEED_2=500.0
SET_POTION_SPEED_3=500.0
SET_POTION_SPEED_4=500.0
SET_POTION_SPEED_5=500.0
SET_POTION_SPEED_6=500.0
SET_POTION_SPEED_7=500.0
SET_POTION_SPEED_8=500.0
;XYZ定位的合成加速度(pulse/ms^2)
SET_POTION_ACC_1=2.5
SET_POTION_ACC_2=2.5
SET_POTION_ACC_3=2.5
SET_POTION_ACC_4=2.5
SET_POTION_ACC_5=2.5
SET_POTION_ACC_6=2.5
SET_POTION_ACC_7=2.5
SET_POTION_ACC_8=2.5
;XYZ定位的终点速度(pulse/ms)
SET_POTION_DEC_1=1.0
SET_POTION_DEC_2=1.0
SET_POTION_DEC_3=1.0
SET_POTION_DEC_4=1.0
SET_POTION_DEC_5=1.0
SET_POTION_DEC_6=1.0
SET_POTION_DEC_7=1.0
SET_POTION_DEC_8=1.0
;XYZ定到位判断次数
SET_POSITION_COUNT_1=240
SET_POSITION_COUNT_2=240
SET_POSITION_COUNT_3=240
SET_POSITION_COUNT_4=240
SET_POSITION_COUNT_5=240
SET_POSITION_COUNT_6=240
SET_POSITION_COUNT_7=240
SET_POSITION_COUNT_8=240
[COMPORT]
;灯光控制器类型选择
;0:启用c++调用灯光,不使用STM32 USB控制时,需要把下面的IS_STM32_USB改为0
;1:wpf直接调用;
;2:DP光源控制器;
;3:旧的6环8区为3(环形可调);
;4:新的6环8区为4(扇区可调);
;5:STM32控制器,IP地址在exe目录下的CameraNum.ini中修改
;61:OPT光源控制器网络模式(111ms),IP地址在exe目录下的CameraNum.ini中修改,串口模式62(44ms);
COM_PORT_CPP_WPF=0
;使用stm32时,是否使用USB通讯,使用该功能时,COM_PORT_CPP_WPF必须等于0
IS_STM32_USB=0
;是否打开第一个串,1为打开,0为关闭,默认0
IS_COM_PORT_A=0
COM_PORT_A=2
COM_PORT_A_LED_1=1
COM_PORT_A_LED_2=1
COM_PORT_A_LED_3=1
COM_PORT_A_LED_4=1
;是否打开第二个串,1为打开,0为关闭,默认0
IS_COM_PORT_B=0
COM_PORT_B=6
COM_PORT_B_LED_1=1
COM_PORT_B_LED_2=1
COM_PORT_B_LED_3=1
COM_PORT_B_LED_4=1
[TRRIGER]
;线性点触发的脉冲宽度
LINEAR_PULSE_WIDTH=500
;等间距触发的脉冲宽度
INTERVAL_PULSE_WIDTH=500
;手动触发
HOLD_TIME=150
[LOG]
;是否打开记录,默认0为关闭,1位打开,;LOG_IS_OPEN_0为是否打开记录功能
LOG_IS_OPEN_0=1
LOG_IS_OPEN_1=1
LOG_IS_OPEN_2=1
LOG_IS_OPEN_3=1
LOG_IS_OPEN_4=0
LOG_IS_OPEN_5=0
LOG_IS_OPEN_6=0
LOG_IS_OPEN_7=0
LOG_IS_OPEN_8=0
;是否启用统计定位函数的时间日志,1:启用,默认0关闭
LOG2_IS_OPEN=0
;定位几次后,计算这几次总共用时mm,默认4次
LOG_SUM_COUNT=0
@@ -0,0 +1,337 @@
[JOG_SPEED]
JOG速度(pulse/ms)
JOG_SPEED_0=200.0
JOG_SPEED_1=150.0
JOG_SPEED_2=50
JOG_SPEED_3=10
JOG_SPEED_4=1
;JOG加速度(pulse/ms^2)
JOG_ACC_0=2.0
JOG_ACC_1=2.0
JOG_ACC_2=2.0
JOG_ACC_3=1.0
JOG_ACC_4=1.0
;JOG减速度(pulse/ms^2)
JOG_DEC_0=2.0
JOG_DEC_1=2.0
JOG_DEC_2=2.0
JOG_DEC_3=1.0
JOG_DEC_4=1.0
;JOG模式采用急停还是平滑停止,0是平滑停止1为急停,默认0
JOG_STOP_MODE_1=0
JOG_STOP_MODE_2=0
JOG_STOP_MODE_3=0
JOG_STOP_MODE_4=0
JOG_STOP_MODE_5=0
JOG_STOP_MODE_6=0
JOG_STOP_MODE_7=0
JOG_STOP_MODE_8=0
JOG_STOP_MODE=0
JOG_SPEED_GEAR0_1=200.0
JOG_ACC_GEAR0_1=2.0
JOG_DEC_GEAR0_1=2.0
JOG_SPEED_GEAR0_2=200.0
JOG_ACC_GEAR0_2=2.0
JOG_DEC_GEAR0_2=2.0
JOG_SPEED_GEAR0_3=150.0
JOG_ACC_GEAR0_3=2.0
JOG_DEC_GEAR0_3=2.0
JOG_SPEED_GEAR0_4=200.0
JOG_ACC_GEAR0_4=2.0
JOG_DEC_GEAR0_4=2.0
JOG_SPEED_GEAR1_1=100.0
JOG_ACC_GEAR1_1=2.0
JOG_DEC_GEAR1_1=2.0
JOG_SPEED_GEAR1_2=100.0
JOG_ACC_GEAR1_2=2.0
JOG_DEC_GEAR1_2=2.0
JOG_SPEED_GEAR1_3=80.0
JOG_ACC_GEAR1_3=2.0
JOG_DEC_GEAR1_3=2.0
JOG_SPEED_GEAR1_4=100.0
JOG_ACC_GEAR1_4=2.0
JOG_DEC_GEAR1_4=2.0
JOG_SPEED_GEAR2_1=50.0
JOG_ACC_GEAR2_1=2.0
JOG_DEC_GEAR2_1=2.0
JOG_SPEED_GEAR2_2=50.0
JOG_ACC_GEAR2_2=2.0
JOG_DEC_GEAR2_2=2.0
JOG_SPEED_GEAR2_3=50.0
JOG_ACC_GEAR2_3=2.0
JOG_DEC_GEAR2_3=2.0
JOG_SPEED_GEAR2_4=50.0
JOG_ACC_GEAR2_4=2.0
JOG_DEC_GEAR2_4=2.0
JOG_SPEED_GEAR3_1=10.0
JOG_ACC_GEAR3_1=1.0
JOG_DEC_GEAR3_1=1.0
JOG_SPEED_GEAR3_2=10.0
JOG_ACC_GEAR3_2=1.0
JOG_DEC_GEAR3_2=1.0
JOG_SPEED_GEAR3_3=10.0
JOG_ACC_GEAR3_3=1.0
JOG_DEC_GEAR3_3=1.0
JOG_SPEED_GEAR3_4=10.0
JOG_ACC_GEAR3_4=1.0
JOG_DEC_GEAR3_4=1.0
JOG_SPEED_GEAR4_1=1.0
JOG_ACC_GEAR4_1=1.0
JOG_DEC_GEAR4_1=1.0
JOG_SPEED_GEAR4_2=1.0
JOG_ACC_GEAR4_2=1.0
JOG_DEC_GEAR4_2=1.0
JOG_SPEED_GEAR4_3=1.0
JOG_ACC_GEAR4_3=1.0
JOG_DEC_GEAR4_3=1.0
JOG_SPEED_GEAR4_4=1.0
JOG_ACC_GEAR4_4=1.0
JOG_DEC_GEAR4_4=1.0
;0:都使用(正常情况) 1:只使用灯,而不使用控制器;默认0
[USE_LIGHT]
ONLY_USE_LIGHT=0
[RESOLUTION]
;光栅尺的分辨率(mm)
SCALE_RESOLUTION_1=0.0004
SCALE_RESOLUTION_2=0.0004
SCALE_RESOLUTION_3=0.0004
SCALE_RESOLUTION_4=0.0004
SCALE_RESOLUTION_5=0.0004
SCALE_RESOLUTION_6=0.0004
SCALE_RESOLUTION_7=0.0004
SCALE_RESOLUTION_8=0.0004
[LIMIT]
;负限位(mm),必须是负数
NEG_WORKING_LIMIT_1=-260.0
NEG_WORKING_LIMIT_2=-40.0
NEG_WORKING_LIMIT_3=-40.0
NEG_WORKING_LIMIT_4=-40.0
NEG_WORKING_LIMIT_5=-40.0
NEG_WORKING_LIMIT_6=-40.0
NEG_WORKING_LIMIT_7=-40.0
NEG_WORKING_LIMIT_8=-40.0
;正限位(mm),必须是正数
POS_WORKING_LIMIT_1=40.0
POS_WORKING_LIMIT_2=160.0
POS_WORKING_LIMIT_3=160.0
POS_WORKING_LIMIT_4=200.0
POS_WORKING_LIMIT_5=200.0
POS_WORKING_LIMIT_6=200.0
POS_WORKING_LIMIT_7=200.0
POS_WORKING_LIMIT_8=200.0
[HOME]
;选择需要回家的轴号,改为1
HOME_MACHINE_AXIS_1=1
HOME_MACHINE_AXIS_2=1
HOME_MACHINE_AXIS_3=1
HOME_MACHINE_AXIS_4=0
HOME_MACHINE_AXIS_5=0
HOME_MACHINE_AXIS_6=0
HOME_MACHINE_AXIS_7=0
HOME_MACHINE_AXIS_8=0
;是否启动实际位置判断是否回家,默认0,1启用,0关闭
IS_HOME_ENC_POS=0
;是否启动规划位置判断是否回家,默认1,1启用,0关闭
IS_HOME_PRF_POS=1
;关闭电源时记住当前的位置,用于判断是否需要回家
HOME_POS_AXIS_1=0
HOME_POS_AXIS_2=0
HOME_POS_AXIS_3=0
HOME_POS_AXIS_4=0
HOME_POS_AXIS_5=0
HOME_POS_AXIS_6=0
HOME_POS_AXIS_7=0
HOME_POS_AXIS_8=0
;回家第一段速度(pulse/ms)
HOME_HIGH_SPEED_1=200.0
HOME_HIGH_SPEED_2=200.0
HOME_HIGH_SPEED_3=200.0
HOME_HIGH_SPEED_4=200.0
HOME_HIGH_SPEED_5=200.0
HOME_HIGH_SPEED_6=200.0
HOME_HIGH_SPEED_7=200.0
HOME_HIGH_SPEED_8=200.0
;回家第一段加速度(pulse/ms^2)
HOME_HIGH_ACC_1=2.0
HOME_HIGH_ACC_2=2.0
HOME_HIGH_ACC_3=2.0
HOME_HIGH_ACC_4=2.0
HOME_HIGH_ACC_5=2.0
HOME_HIGH_ACC_6=2.0
HOME_HIGH_ACC_7=2.0
HOME_HIGH_ACC_8=2.0
;回家第二段速度(pulse/ms)
HOME_LOW_SPEED_1=180.0
HOME_LOW_SPEED_2=180.0
HOME_LOW_SPEED_3=180.0
HOME_LOW_SPEED_4=180.0
HOME_LOW_SPEED_5=180.0
HOME_LOW_SPEED_6=180.0
HOME_LOW_SPEED_7=180.0
HOME_LOW_SPEED_8=180.0
;回家第二段加速度(pulse/ms^2)
HOME_LOW_ACC_1=2.0
HOME_LOW_ACC_2=2.0
HOME_LOW_ACC_3=2.0
HOME_LOW_ACC_4=2.0
HOME_LOW_ACC_5=2.0
HOME_LOW_ACC_6=2.0
HOME_LOW_ACC_7=2.0
HOME_LOW_ACC_8=2.0
;回家延时时间(ms)
HOME_TIME_1=1000
HOME_TIME_2=1000
HOME_TIME_3=1000
HOME_TIME_4=1000
HOME_TIME_5=1000
HOME_TIME_6=1000
HOME_TIME_7=1000
HOME_TIME_8=1000
[PID]
;PID比例调节,应从0.01递增开始调试
PID_KP_1=1.20
PID_KP_2=1.20
PID_KP_3=1.20
PID_KP_4=1.20
PID_KP_5=1.20
PID_KP_6=1.20
PID_KP_7=1.20
PID_KP_8=1.20
[PRECISION]
;超时时间(0.1ms)
PRECISION_TIME_1=20000
PRECISION_TIME_2=20000
PRECISION_TIME_3=20000
PRECISION_TIME_4=20000
PRECISION_TIME_5=20000
PRECISION_TIME_6=20000
PRECISION_TIME_7=20000
PRECISION_TIME_8=20000
;回家误差脉冲个数
PRECISION_COUNT_1=8
PRECISION_COUNT_2=8
PRECISION_COUNT_3=8
PRECISION_COUNT_4=8
PRECISION_COUNT_5=8
PRECISION_COUNT_6=8
PRECISION_COUNT_7=8
PRECISION_COUNT_8=8
[SET_POSITION_SPEED]
;XYZ定位的合成速度(pulse/ms)
SET_POTION_SPEED_1=500.0
SET_POTION_SPEED_2=500.0
SET_POTION_SPEED_3=500.0
SET_POTION_SPEED_4=500.0
SET_POTION_SPEED_5=500.0
SET_POTION_SPEED_6=500.0
SET_POTION_SPEED_7=500.0
SET_POTION_SPEED_8=500.0
;XYZ定位的合成加速度(pulse/ms^2)
SET_POTION_ACC_1=2.5
SET_POTION_ACC_2=2.5
SET_POTION_ACC_3=2.5
SET_POTION_ACC_4=2.5
SET_POTION_ACC_5=2.5
SET_POTION_ACC_6=2.5
SET_POTION_ACC_7=2.5
SET_POTION_ACC_8=2.5
;XYZ定位的终点速度(pulse/ms)
SET_POTION_DEC_1=1.0
SET_POTION_DEC_2=1.0
SET_POTION_DEC_3=1.0
SET_POTION_DEC_4=1.0
SET_POTION_DEC_5=1.0
SET_POTION_DEC_6=1.0
SET_POTION_DEC_7=1.0
SET_POTION_DEC_8=1.0
;XYZ定到位判断次数
SET_POSITION_COUNT_1=240
SET_POSITION_COUNT_2=240
SET_POSITION_COUNT_3=240
SET_POSITION_COUNT_4=240
SET_POSITION_COUNT_5=240
SET_POSITION_COUNT_6=240
SET_POSITION_COUNT_7=240
SET_POSITION_COUNT_8=240
[COMPORT]
;灯光控制器类型选择
;0:启用c++调用灯光,不使用STM32 USB控制时,需要把下面的IS_STM32_USB改为0
;1:wpf直接调用;
;2:DP光源控制器;
;3:旧的6环8区为3(环形可调);
;4:新的6环8区为4(扇区可调);
;5:STM32控制器,IP地址在exe目录下的CameraNum.ini中修改
;61:OPT光源控制器网络模式(111ms),IP地址在exe目录下的CameraNum.ini中修改,串口模式62(44ms);
COM_PORT_CPP_WPF=0
;使用stm32时,是否使用USB通讯,使用该功能时,COM_PORT_CPP_WPF必须等于0
IS_STM32_USB=0
;是否打开第一个串,1为打开,0为关闭,默认0
IS_COM_PORT_A=0
COM_PORT_A=2
COM_PORT_A_LED_1=1
COM_PORT_A_LED_2=1
COM_PORT_A_LED_3=1
COM_PORT_A_LED_4=1
;是否打开第二个串,1为打开,0为关闭,默认0
IS_COM_PORT_B=0
COM_PORT_B=6
COM_PORT_B_LED_1=1
COM_PORT_B_LED_2=1
COM_PORT_B_LED_3=1
COM_PORT_B_LED_4=1
[TRRIGER]
;线性点触发的脉冲宽度
LINEAR_PULSE_WIDTH=500
;等间距触发的脉冲宽度
INTERVAL_PULSE_WIDTH=500
;手动触发
HOLD_TIME=150
[LOG]
;是否打开记录,默认0为关闭,1位打开,;LOG_IS_OPEN_0为是否打开记录功能
LOG_IS_OPEN_0=1
LOG_IS_OPEN_1=1
LOG_IS_OPEN_2=1
LOG_IS_OPEN_3=1
LOG_IS_OPEN_4=0
LOG_IS_OPEN_5=0
LOG_IS_OPEN_6=0
LOG_IS_OPEN_7=0
LOG_IS_OPEN_8=0
;是否启用统计定位函数的时间日志,1:启用,默认0关闭
LOG2_IS_OPEN=0
;定位几次后,计算这几次总共用时mm,默认4次
LOG_SUM_COUNT=0
@@ -30,6 +30,66 @@ JOG_STOP_MODE_6=0
JOG_STOP_MODE_7=0
JOG_STOP_MODE_8=0
JOG_STOP_MODE=0
JOG_SPEED_GEAR0_1=200.0
JOG_ACC_GEAR0_1=2.0
JOG_DEC_GEAR0_1=2.0
JOG_SPEED_GEAR0_2=200.0
JOG_ACC_GEAR0_2=2.0
JOG_DEC_GEAR0_2=2.0
JOG_SPEED_GEAR0_3=150.0
JOG_ACC_GEAR0_3=2.0
JOG_DEC_GEAR0_3=2.0
JOG_SPEED_GEAR0_4=200.0
JOG_ACC_GEAR0_4=2.0
JOG_DEC_GEAR0_4=2.0
JOG_SPEED_GEAR1_1=100.0
JOG_ACC_GEAR1_1=2.0
JOG_DEC_GEAR1_1=2.0
JOG_SPEED_GEAR1_2=100.0
JOG_ACC_GEAR1_2=2.0
JOG_DEC_GEAR1_2=2.0
JOG_SPEED_GEAR1_3=80.0
JOG_ACC_GEAR1_3=2.0
JOG_DEC_GEAR1_3=2.0
JOG_SPEED_GEAR1_4=100.0
JOG_ACC_GEAR1_4=2.0
JOG_DEC_GEAR1_4=2.0
JOG_SPEED_GEAR2_1=50.0
JOG_ACC_GEAR2_1=2.0
JOG_DEC_GEAR2_1=2.0
JOG_SPEED_GEAR2_2=50.0
JOG_ACC_GEAR2_2=2.0
JOG_DEC_GEAR2_2=2.0
JOG_SPEED_GEAR2_3=50.0
JOG_ACC_GEAR2_3=2.0
JOG_DEC_GEAR2_3=2.0
JOG_SPEED_GEAR2_4=50.0
JOG_ACC_GEAR2_4=2.0
JOG_DEC_GEAR2_4=2.0
JOG_SPEED_GEAR3_1=10.0
JOG_ACC_GEAR3_1=1.0
JOG_DEC_GEAR3_1=1.0
JOG_SPEED_GEAR3_2=10.0
JOG_ACC_GEAR3_2=1.0
JOG_DEC_GEAR3_2=1.0
JOG_SPEED_GEAR3_3=10.0
JOG_ACC_GEAR3_3=1.0
JOG_DEC_GEAR3_3=1.0
JOG_SPEED_GEAR3_4=10.0
JOG_ACC_GEAR3_4=1.0
JOG_DEC_GEAR3_4=1.0
JOG_SPEED_GEAR4_1=1.0
JOG_ACC_GEAR4_1=1.0
JOG_DEC_GEAR4_1=1.0
JOG_SPEED_GEAR4_2=1.0
JOG_ACC_GEAR4_2=1.0
JOG_DEC_GEAR4_2=1.0
JOG_SPEED_GEAR4_3=1.0
JOG_ACC_GEAR4_3=1.0
JOG_DEC_GEAR4_3=1.0
JOG_SPEED_GEAR4_4=1.0
JOG_ACC_GEAR4_4=1.0
JOG_DEC_GEAR4_4=1.0
;0:都使用(正常情况) 1:只使用灯,而不使用控制器;默认0
[USE_LIGHT]
@@ -177,7 +237,7 @@ PRECISION_COUNT_8=8
[SET_POSITION_SPEED]
;XYZ定位的合成速度(pulse/ms)
SET_POTION_SPEED_1=100
SET_POTION_SPEED_1=500.0
SET_POTION_SPEED_2=500.0
SET_POTION_SPEED_3=500.0
SET_POTION_SPEED_4=500.0
@@ -0,0 +1,3 @@
[Default]
MotionControlSpeed=1
ControllerType=1
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
@@ -0,0 +1,3 @@
[Default]
MotionControlSpeed=1
ControllerType=2
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
@@ -0,0 +1,71 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "EC6DF93472E9E02F30BD987409DB5FC5E258A9EE"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_GOOGOL_GTS800_WPFTest {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 4 "..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
HSI_GOOGOL_GTS800_WPFTest.App app = new HSI_GOOGOL_GTS800_WPFTest.App();
app.InitializeComponent();
app.Run();
}
}
}
@@ -0,0 +1,71 @@
#pragma checksum "..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "EC6DF93472E9E02F30BD987409DB5FC5E258A9EE"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms.Integration;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
namespace HSI_GOOGOL_GTS800_WPFTest {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
#line 4 "..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
HSI_GOOGOL_GTS800_WPFTest.App app = new HSI_GOOGOL_GTS800_WPFTest.App();
app.InitializeComponent();
app.Run();
}
}
}

Some files were not shown because too many files have changed in this diff Show More