commit eb72df621062cb0fa263d89c0674058d053dd1a3 Author: qushuailong Date: Tue Apr 19 21:19:38 2022 +0800 VisionController Version1.0: 1 实现Tcp服务器,支持一个Tcp客户端连接 2 能够接收客户端发送的信息控制IO口输出 diff --git a/config/tcpServer.json b/config/tcpServer.json new file mode 100644 index 0000000..ccc2e27 --- /dev/null +++ b/config/tcpServer.json @@ -0,0 +1,6 @@ +{ + "address": { + "IP": "127.0.0.1", + "Port": "9900" + } +} diff --git a/runner17/MvIOInterfaceBox.dll b/runner17/MvIOInterfaceBox.dll new file mode 100644 index 0000000..63d1e93 Binary files /dev/null and b/runner17/MvIOInterfaceBox.dll differ diff --git a/runner17/MvSerial.dll b/runner17/MvSerial.dll new file mode 100644 index 0000000..678152d Binary files /dev/null and b/runner17/MvSerial.dll differ diff --git a/src/IOController/IOController.cpp b/src/IOController/IOController.cpp new file mode 100644 index 0000000..a744cc4 --- /dev/null +++ b/src/IOController/IOController.cpp @@ -0,0 +1,230 @@ +#include "IOController.h" + +IOController::IOController() +{ +} +IOController::~IOController() +{ +} +bool IOController::controllerInitialization(unsigned int serialNum) +{ + return controlCom(serialNum, 1); +} +bool IOController::controlCom(unsigned int IONum, unsigned int state) +{ + std::string comName; + switch (IONum) + { + case 1: + comName = "Com1"; + break; + case 2: + comName = "Com2"; + break; + case 3: + comName = "Com3"; + break; + case 4: + comName = "Com4"; + break; + case 5: + comName = "Com5"; + break; + case 6: + comName = "Com6"; + break; + case 7: + comName = "Com7"; + break; + case 8: + comName = "Com8"; + break; + default: + break; + } + m_comName = comName; + m_mpComsState[comName] = false; + void* handle; + int nRet = MV_IO_CreateHandle(&handle); + if (nRet != MV_OK) + { + //throw nRet; + return false; + } + else + { + m_mpComsHandle[comName] = handle; + } + if (state == 1) + { + if (!connectCom(m_mpComsHandle[comName], comName)) + { + return false; + } + } + else if (state == 0) + { + if (!closeCom(m_mpComsHandle[comName], comName)) + { + return false; + } + } + return true; +} +bool IOController::connectCom(void* handle, std::string comName) +{ + MV_IO_SERIAL stSerial; + memset(&stSerial, 0, sizeof(MV_IO_SERIAL)); + strcpy(stSerial.strComName, comName.c_str()); + //m_mpStIOSerial[comName] = stSerial; + int nRet = MV_IO_Open(m_mpComsHandle[comName], &stSerial); + if (nRet != MV_OK) + { + //throw nRet; + return false; + } + m_mpComsState[comName] = true; + return true; +} +bool IOController::closeCom(void* handle, std::string comName) +{ + return true; +} + +bool IOController::controlPort(unsigned int portNum, unsigned int state) +{ + MV_IO_PORT_NUMBER stPortNumber; + switch(portNum) + { + case 1: + stPortNumber = MV_IO_PORT_1; + break; + case2: + stPortNumber = MV_IO_PORT_2; + break; + case 3: + stPortNumber = MV_IO_PORT_3; + break; + case 4: + stPortNumber = MV_IO_PORT_4; + break; + case 5: + stPortNumber = MV_IO_PORT_5; + break; + case 6: + stPortNumber = MV_IO_PORT_6; + break; + case 7: + stPortNumber = MV_IO_PORT_7; + break; + case 8: + stPortNumber = MV_IO_PORT_8; + break; + default: + break; + } + if (state == 1) + { + if (!openPort(m_comName, stPortNumber)) + { + return false; + } + } + else if (state == 0) + { + if (!closePort(m_comName, stPortNumber)) + { + return false; + } + } + return true; +} + +bool IOController::openPort(std::string comName, MV_IO_PORT_NUMBER portNum) +{ + MV_IO_SET_OUTPUT stOutput; + memset(&stOutput, 0, sizeof(MV_IO_SET_OUTPUT)); + stOutput.nPort = portNum; + stOutput.nType = MV_IO_PATTERN_SINGLE; + stOutput.nDurationTime = 0; + stOutput.nValidLevel = 1; //ߵƽ + if ((m_mpComsHandle.find(comName) == m_mpComsHandle.end())|| (!m_mpComsState[comName])) + { + return false; + } + int nRet = MV_IO_SetOutput(m_mpComsHandle[comName], &stOutput); + if (nRet != MV_OK) + { + //throw nRet; + return false; + } + return true; +} + +bool IOController::closePort(std::string comName, MV_IO_PORT_NUMBER portNum) +{ + MV_IO_SET_OUTPUT stOutput; + memset(&stOutput, 0, sizeof(MV_IO_SET_OUTPUT)); + stOutput.nPort = portNum; + stOutput.nType = MV_IO_PATTERN_SINGLE; + // stOutput.nDurationTime = 3000; + stOutput.nValidLevel = 0; //͵ƽ + if ((m_mpComsHandle.find(comName) == m_mpComsHandle.end()) || (!m_mpComsState[comName])) + { + return false; + } + int nRet = MV_IO_SetOutput(m_mpComsHandle[comName], &stOutput); + if (nRet != MV_OK) + { + //throw nRet; + return false; + } + return true; +} + +bool IOController::getPortState(unsigned int portNum, unsigned int& state) +{ + MV_IO_PORT_NUMBER stPortNumber; + switch (portNum) + { + case 1: + stPortNumber = MV_IO_PORT_1; + break; + case2: + stPortNumber = MV_IO_PORT_2; + break; + case 3: + stPortNumber = MV_IO_PORT_3; + break; + case 4: + stPortNumber = MV_IO_PORT_4; + break; + case 5: + stPortNumber = MV_IO_PORT_5; + break; + case 6: + stPortNumber = MV_IO_PORT_6; + break; + case 7: + stPortNumber = MV_IO_PORT_7; + break; + case 8: + stPortNumber = MV_IO_PORT_8; + break; + default: + break; + } + if (m_mpComsHandle.find(m_comName) == m_mpComsHandle.end()) + { + return false; + } + MV_IO_SET_OUTPUT stSetOutput; + int nRet = MV_IO_GetPortOutputParam(m_mpComsHandle[m_comName], &stSetOutput); + if (nRet != MV_OK) + { + //throw nRet; + return false; + } + state = stSetOutput.nValidLevel; + return true; +} \ No newline at end of file diff --git a/src/IOController/IOController.h b/src/IOController/IOController.h new file mode 100644 index 0000000..9281c34 --- /dev/null +++ b/src/IOController/IOController.h @@ -0,0 +1,51 @@ +#ifndef _H_IOController_H_ +#define _H_IOController_H_ + +//#define MAX_DEVICE 6 + +#include + +#include +#include +#include +#include + +#include "MvIOInterfaceBox.h" +#include "MvIOInterfaceBoxDefine.h " +#include "MvErrorDefine.h" + +#ifndef BUILD_STATIC +# if defined(IOController_LIB) +# define IOController_EXPORT Q_DECL_EXPORT +# else +# define IOController_EXPORT Q_DECL_IMPORT +# endif +#else +# define IOController_EXPORT +#endif + +class IOController_EXPORT IOController +{ +public: + IOController(); + ~IOController(); + + bool controlCom(unsigned int serialNumber, unsigned int state); + bool controlPort(unsigned int intportNumber, unsigned int state); + bool controllerInitialization(unsigned int serialNum); + bool getPortState(unsigned int portNum, unsigned int& validState); +private: + bool connectCom(void* handle, std::string comName); + bool closeCom(void* handle, std::string comName); + bool openPort(std::string comName, MV_IO_PORT_NUMBER portNum); + bool closePort(std::string comName, MV_IO_PORT_NUMBER portNum); + + //void* m_handleList[MAX_DEVICE]; // Ӷ豸 + QMap m_mpComsHandle; + //QMap m_mpStIOSerial; + QMap m_mpComsState; + std::string m_comName; +}; + +#endif // !_H_IOController_H_ + diff --git a/src/IOController/NewSdkInc/MvErrorDefine.h b/src/IOController/NewSdkInc/MvErrorDefine.h new file mode 100644 index 0000000..e5bb832 --- /dev/null +++ b/src/IOController/NewSdkInc/MvErrorDefine.h @@ -0,0 +1,77 @@ +/*************************************************************************************************** +* +* ȨϢȨ (c) 2015, ݺּɷ޹˾, Ȩ +* +* ļƣMvErrorDefine.h +* ժ Ҫ붨 +* +* ǰ汾1.0.0.0 +* ߣ +* ڣ2015-01-28 +* ע½ +***************************************************************************************************/ + +#ifndef _MV_ERROR_DEFINE_H_ +#define _MV_ERROR_DEFINE_H_ + +//ȷ붨 +#define MV_OK 0x00000000 ///< ɹ޴ + +//ͨô붨:Χ0x80000000-0x800000FF +#define MV_E_HANDLE 0x80000000 ///< Чľ +#define MV_E_SUPPORT 0x80000001 ///< ֵ֧Ĺ +#define MV_E_BUFOVER 0x80000002 ///< +#define MV_E_CALLORDER 0x80000003 ///< ˳ +#define MV_E_PARAMETER 0x80000004 ///< IJ +#define MV_E_RESOURCE 0x80000006 ///< Դʧ +#define MV_E_NODATA 0x80000007 ///< +#define MV_E_PRECONDITION 0x80000008 ///< ǰ󣬻лѷ仯 +#define MV_E_VERSION 0x80000009 ///< 汾ƥ +#define MV_E_NOENOUGH_BUF 0x8000000A ///< ڴռ䲻 +#define MV_E_MATCH 0x8000000B ///< ƥ緵صݸʽ +#define MV_E_UPDATING 0x8000000C ///< ״̬ +#define MV_E_UNKNOW 0x800000FF ///< δ֪Ĵ + +//ش: 0x80000100-0x800001FF +#define MV_E_CREAT_SOCKET 0x80000100 // Socketʧ +#define MV_E_BIND_SOCKET 0x80000101 // Socketʧ +#define MV_E_CONNECT_SOCKET 0x80000102 // Socketʧ +#define MV_E_GET_HOSTNAME 0x80000103 // ȡHostnameʧ +#define MV_E_NET_WRITE 0x80000104 // дʧ +#define MV_E_NET_READ 0x80000105 // ʧ +#define MV_E_NET_SELECT 0x80000106 //ʧ +#define MV_E_NET_TIMEOUT 0x80000107 // 糬ʱ + + +//GigE_STATUSӦĴ:Χ0x80000200-0x800002FF +#define MV_E_NOT_IMPLEMENTED 0x80000200 ///< 豸֧ +#define MV_E_INVALID_ADDRESS 0x80000201 ///< ʵĿַ +#define MV_E_WRITE_PROTECT 0x80000202 ///< Ŀַд +#define MV_E_ACCESS_DENIED 0x80000203 ///< Ȩ +#define MV_E_BUSY 0x80000204 ///< 豸æϿ +#define MV_E_PACKET 0x80000205 ///< ݴ +#define MV_E_NETER 0x80000206 ///< ش + + +//USB_STATUSӦĴ:Χ0x80000300-0x800003FF +#define MV_E_USB_READ 0x80000300 ///< usb +#define MV_E_USB_WRITE 0x80000301 ///< дusb +#define MV_E_USB_DEVICE 0x80000302 ///< 豸쳣 +#define MV_E_USB_GENICAM 0x80000303 ///< GenICamش +#define MV_E_USB_UNKNOW 0x800003FF ///< USBδ֪Ĵ + +//ʱӦĴ:Χ0x80000400-0x800004FF +#define MV_E_UPG_FILE_MISMATCH 0x80000400 ///< ̼ƥ +#define MV_E_UPG_LANGUSGE_MISMATCH 0x80000401 ///< ̼Բƥ +#define MV_E_UPG_CONFLICT 0x80000402 ///< ͻ豸Ѿٴش˴ +#define MV_E_UPG_INNER_ERR 0x80000403 ///< ʱڲִ +#define MV_E_UPG_UNKNOW 0x800004FF ///< ʱδ֪ + +// YModemЭ + +#define MV_E_YMODEM_C 0x80000500 ///< δյ +#define MV_E_YMODEM_ACK 0x80000501 ///< δյȷϻӦ +#define MV_E_YMODEM_NAK 0x80000502 ///< δյȷϻӦ + + +#endif //_MV_ERROR_DEFINE_H_ diff --git a/src/IOController/NewSdkInc/MvIOInterfaceBox.h b/src/IOController/NewSdkInc/MvIOInterfaceBox.h new file mode 100644 index 0000000..e60d6f0 --- /dev/null +++ b/src/IOController/NewSdkInc/MvIOInterfaceBox.h @@ -0,0 +1,231 @@ +/*************************************************************************************************** +* +* ļƣMvIOInterfaceBox.h +* ժ Ҫͷļ +* +* ǰ汾1.2.0 +* ע½ +***************************************************************************************************/ + + +/*************************************************************************************************** +* +* File name: MvIOInterfaceBox.h +* Abstract: Common definition header file of Visual controller +* +* Current Version:1.2.0 +* Remarks newly build +***************************************************************************************************/ + +#ifndef MV_IO_INTERFACEBOX_CONTROL_H__ +#define MV_IO_INTERFACEBOX_CONTROL_H__ + +#include "MvIOInterfaceBoxDefine.h" + + +/** +* @brief ch:̬⵼뵼 | en:Dynamic library import and export definition +*/ +#ifndef MV_IO_CONTROL_API + + #ifdef WIN32 + #if defined(MVIOINTERFACEBOXCONTROL_EXPORTS) + #define MV_IO_CONTROL_API __declspec(dllexport) + #else + #define MV_IO_CONTROL_API __declspec(dllimport) + #endif + #else + #ifndef __stdcall + #define __stdcall + #endif + + #ifndef MV_IO_CONTROL_API + #define MV_IO_CONTROL_API + #endif + #endif + +#endif + +#ifndef IN + #define IN +#endif + +#ifndef OUT + #define OUT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** @fn MV_IO_CreateHandle + * @brief ch: | en:Create handle + * @param handle [IN][OUT] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + * @ע ch:ɴ32ھ | en:A maximum of 32 serial port handles can be created + */ +MV_IO_CONTROL_API int __stdcall MV_IO_CreateHandle(OUT void ** handle); + +/** @fn MV_IO_DestroyHandle + * @brief ch:پ | en:Destroy handle + * @param handle [IN] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_DestroyHandle(IN void * handle); + +/** @fn MV_IO_GetSDKVersion + * @brief ch:ȡSDK汾 | en:Get SDK version + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetSDKVersion(OUT MV_IO_VERSION * pstVersion); + +/** @fn MV_IO_Open + * @brief ch:򿪴 | en:Open serial port + * @param handle [IN] ch:豸 | en: + * @param pstSerial [IN] ch:ڲϸμMV_IO_SERIALṹԼöٶ | en:Serial paranm, reference MV_IO_SERIAL + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_Open(IN void* handle, IN MV_IO_SERIAL * pstSerial); + +/** @fn MV_IO_Close + * @brief ch:رմ | en:Close serial + * @param handle [IN] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_Close(IN void* handle); + +/** @fn MV_IO_GetFirmwareVersion + * @brief ch:ȡ̼汾 | en:Get firmware version + * @param handle [IN] ch:豸 | en:Device handle + * @param pstVersion [IN] ch:̼汾ϸμMV_IO_VERSIONṹԼöٶ | en:param,reference MV_IO_VERSION + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetFirmwareVersion(IN void* handle, OUT MV_IO_VERSION * pstVersion); + +/** @fn MV_IO_LocalUpgrade + * @brief ch:̼ | en:Local upgrade + * @param handle [IN] ch:豸 | en:Device handle + * @param pstLocalUpgrade [IN][OUT] ch:ϸμMV_IO_LOCAL_UPGRADEṹԼض | en:Upgrade param,reference MV_IO_LOCAL_UPGRADE + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_LocalUpgrade(IN void* handle, IN unsigned char* pData, IN unsigned int nLen, IN OUT MV_IO_LOCAL_UPGRADE * pstLocalUpgrade); + +/** @fn MV_IO_SetOutput + * @brief ch: | en:Output param setting + * @param handle [IN] ch:豸 | en:Device handle + * @param pstOutput [IN] ch:,ϸμMV_IO_SET_OUTPUTṹԼöٶ | en:Output param , reference MV_IO_SET_OUTPUT + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_SetOutput(IN void* handle, IN MV_IO_SET_OUTPUT * pstOutput); + +/** @fn MV_IO_SetOutputEnable + * @brief ch:ʹ | en:Turn on output enable + * @param handle [IN] ch:豸 | en:Device handle + * @param pstEnable [IN] ch:ʹܲϸμMV_IO_OUTPUT_ENABLEṹԼöٶ | en:Output enabling parameters, reference MV_IO_OUTPUT_ENABLE + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_SetOutputEnable(IN void* handle, IN MV_IO_OUTPUT_ENABLE * pstEnable); + +/** @fn MV_IO_SetInput + * @brief ch: + * @param handle [IN] ch:豸 | en: + * @param pstInput [IN] ch:ϸμMV_IO_SET_INPUTṹԼöٶ | en: + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_SetInput(IN void* handle, IN MV_IO_SET_INPUT * pstInput); + +/** @fn MV_IO_GetPortInputParam + * @brief ch:ȡ | en:Get input parameter settings + * @param handle [IN] ch:豸 | en:Device handle + * @param pstInput [IN] ch:ϸμMV_IO_SET_INPUTṹԼöٶ | en:Input param, reference MV_IO_SET_INPUT + * @return ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetPortInputParam(IN void* handle, IN OUT MV_IO_SET_INPUT * pstInput); + + +/** @fn MV_IO_GetPortOutputParam + * @brief ch:ȡ | en:Get output parameter settings + * @param handle [IN] ch:豸 | en:Device handle + * @param pstInput [IN] ch:ϸμMV_IO_SET_OUTPUTṹԼöٶ | en:Input param, reference MV_IO_SET_OUTPUT + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetPortOutputParam(IN void* handle, IN OUT MV_IO_SET_OUTPUT * pstInput); + +/** @fn MV_IO_GetInputLevel + * @brief ch:ȡƽϢ,ؼ⿪ʱʹøýӿڻȡƽ | en:Get input level information,When edge detection is on, the interface cannot be used to obtain the level + * @param handle [IN] ch:豸 | en:Device handle + * @param pstInputLevel [IN] ch:ϸμMV_IO_INPUT_LEVELṹԼöٶ | en:Input param, reference MV_IO_INPUT_LEVEL + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetInputLevel(IN void* handle, OUT MV_IO_INPUT_LEVEL * pstInputLevel); + +/** @fn MV_IO_SetLightParam + * @brief ch:LIGHT() | en:Light source setting + * @param handle [IN] ch:豸 | en:Device handle + * @param pstLightParam [IN] ch:ƹϸμMV_IO_LIGHT_PARAMṹԼöٶ | en:Light source param, reference MV_IO_LIGHT_PARAM + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_SetLightParam(IN void* handle, IN MV_IO_LIGHT_PARAM * pstLightParam); + +/** @fn MV_IO_GetLightParam + * @brief ch:LIGHT()ȡ | en:Get light source brightness parameter + * @param handle [IN] ch:豸 | en:Device handle + * @param pstLightParam [IN] ch:ƹϸμMV_IO_LIGHT_PARAMṹԼöٶ | en:light param, reference MV_IO_LIGHT_PARAM + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_GetLightParam(IN void* handle, IN MV_IO_LIGHT_PARAM * pstLightParam); + +/** @fn MV_IO_AssociatedOutPort + * @brief ch:˿ | en:Input associated output port + * ch:迪ijһ·ؼ߹رؼ⹦ܣҪڸýӿ֮ | en:If you need to open a certain input edge to detect or close the detection function, you need to call it after the interface. + * @param handle [IN] ch:豸 | en:Device handle + * @param pstAssocParam [IN] ch:˿ڲϸμMV_IO_ASSOCIATE_PARAMṹԼöٶ | en:Associated port parameters, reference MV_IO_ASSOCIATE_PARAM + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_AssociatedOutPort(IN void* handle, IN MV_IO_ASSOCIATEPORT_PARAM * pstAssocParam); + +/*********************************************************************** + * @fn MV_IO_RegisterEdgeDetectionCallBack + * @brief ch:ؼص | en:edge detection callback + * @param handle [IN] ch:豸 | en:Device handle + * @param cbOutput [IN] ch:صָ | en:Callback function pointer + * @param pInputLevel [IN] ch:ؼϸμMV_IO_INPUT_EDGE_TYPEṹԼöٶ | en:Edge detection parameters, reference MV_IO_INPUT_EDGE_TYPE + * @param pUser [IN] ch:ûԶ | en: pointer + * @return ch:ɹMV_OK󣬷ش | en:Success,return MV_OK(0);Failed, return error code + ***********************************************************************/ +MV_IO_CONTROL_API int __stdcall MV_IO_RegisterEdgeDetectionCallBack(IN void* handle, DetectFunType cbOutput,void* pUser); + +/** @fn MV_IO_ResetParam + * @brief ch:ò | en: + * @param handle [IN] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_ResetParam(IN void * handle); + +/** @fn MV_IO_Reboot + * @brief ch:豸 | en:Reboot device + * @param handle [IN] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_Reboot(IN void * handle); + +/** @fn MV_IO_SetDebugView + * @brief ch:DugviewߵԽӿ | en:Open the dugview tool debugging interface + * @param nFlag [IN] ch:1ʾDebugview, 0ʾر | en:1 means DebugView is on, 0 is off + * @return ch: |en: None + */ +MV_IO_CONTROL_API void __stdcall MV_IO_SetDebugView(IN unsigned int nFlag); + + +/** @fn MV_IO_SaveParam + * @brief ch: | en:Save device param + * @param handle [IN] ch:豸 | en:Device handle + * @return ch:ɹMV_OK(0);ʧܣش | en:Success,return MV_OK(0);Failed, return error code + */ +MV_IO_CONTROL_API int __stdcall MV_IO_SaveParam(IN void * handle); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/IOController/NewSdkInc/MvIOInterfaceBoxDefine.h b/src/IOController/NewSdkInc/MvIOInterfaceBoxDefine.h new file mode 100644 index 0000000..63f4354 --- /dev/null +++ b/src/IOController/NewSdkInc/MvIOInterfaceBoxDefine.h @@ -0,0 +1,288 @@ +/*************************************************************************************************** +* +* ȨϢȨ (c) 2018Ȩ +* +* ļƣMvInterfaceBoxDefine.h +* ժ ҪӾͷļ +* +* ע +* +***************************************************************************************************/ + +/*************************************************************************************************** +* +* Copyright: Copyright: Copyright (c) 2018 all rights reserved +* +* File name: MvInterfaceBoxDefine.h +* Abstract: Common definition header file of Visual controller +* +* Remarks: None +* +***************************************************************************************************/ +#ifndef MV_IO_INTERFACE_BOX_DEFINE_H__ +#define MV_IO_INTERFACE_BOX_DEFINE_H__ + +#ifndef IN +#define IN +#endif + +#ifndef OUT +#define OUT +#endif + +#define MV_SERIAL_BUF_LEN 1024 //ch:buffer | en : Serial buffer length + +#define MV_SERIAL_RECVBUF_MAXLEN (1024*1024) //ch:һԽմݵֵ | en:Max value of received data at one time + +// +typedef enum MVCL_CTRL_TYPE__ +{ + CTRL_INPUT_LEVEL = 0x00, // ch:ȡڸߵ͵ƽϢ |en: Get high and low level information of input port + CTRL_RESET_PARAM = 0x01, // ch:ָĬϲֵ |en: Restore default parameter values + CTRL_VERSION_INFO = 0x02, // ch:ȡ汾Ϣ |en: Get vision information + CTRL_PATTERN_SET_INFO = 0x03, // ch:ȡģʽϢ |en: Get mode information + CTRL_INPUT_SET_INFO = 0x04, // ch:ȡIOϢ |en: Get IO input port setting information + CTRL_OUTPUT_SET_INFO = 0x05, // ch:ȡIOϢ |en: Get IO output port setting information + CTRL_LIGHT_SET_INFO = 0x06, // ch:ȡԴϢ |en: Get lighting settings information + CTRL_FILTER_SET_INFO = 0x07, // ch:ȡ˲Ϣ |en: Get filter setting information +}MVCL_CTRL_TYPE; + + +/************************************************************************* + *ch:궨 en| Common macro definitions + *************************************************************************/ +const static unsigned int MV_IO_MAX_COM_NAME_LENGTH = 64; // ch:ĴƳ | en:Max serial port name length +const static unsigned int MV_IO_MAX_PROC_STATE_LEN = 64; // ch:״̬ | en:Max upgrade state length + +/************************************************************************* + * öٶ | en: Enumeration definition + *************************************************************************/ + +// ch:رմĬϳʱʱ en: Default timeout for closing serial port +#define CLOSE_SERIAL_DEFAULT_TIMEOUT 3000 + +/** @enum MV_IO_PATTERN_OUT + * @brief ch:ģʽѡ | en: Output mode selection + */ +typedef enum MV_IO_PATTERN_OUT__ +{ + MV_IO_PATTERN_PWM = 0x05, // PWM + MV_IO_PATTERN_SINGLE = 0x06, // SINGLE +} MV_IO_PATTERN_OUT; + +/** @enum MV_IO_PORT_NUMBER + * @brief ch:Portڶ | en: port definition + * ch:7Portھ7궨ʾ | en:The eight port ports of input and output are represented by these seven macro definitions + * ch:ҪͬʱPortԽ㣨: MV_IO_PORT_1 | MV_IO_PORT_2 + * en: To enable the output of two port ports at the same time, the or operation can be performed(ex: MV_IO_PORT_1 | MV_IO_PORT_2) + */ +typedef enum MV_IO_PORT_NUMBER__ +{ + MV_IO_PORT_1 = 0x1, // ch:˿1 | en: port1 + MV_IO_PORT_2 = 0x2, // ch:˿2 | en: port2 + MV_IO_PORT_3 = 0x4, // ch:˿3 | en: port3 + MV_IO_PORT_4 = 0x8, // ch:˿4 | en: port4 + MV_IO_PORT_5 = 0x10, // ch:˿5 | en: port5 + MV_IO_PORT_6 = 0x20, // ch:˿6 | en: port6 + MV_IO_PORT_7 = 0x40, // ch:˿7 | en: port7 + MV_IO_PORT_8 = 0x80, // ch:˿8 | en: port8 +} MV_IO_PORT_NUMBER; + +/** @enum MV_IO_EDGE_TYPE + * @brief ch:ض,ûʾźŵĴ | en:Edge definition + */ +typedef enum MV_IO_EDGE_TYPE__ +{ + MV_IO_EDGE_UNKNOW = 0x00, // ch:δ֪ | en: Unknow + MV_IO_EDGE_RISING = 0x01, // ch: | en: Rising edge + MV_IO_EDGE_FALLING = 0x02, // ch:½ | en: Falling edge +} MV_IO_EDGE_TYPE; + +/** @enum MV_IO_ENABLE_TYPE + * @brief ch:ʹͶ壬ڿƴģʽµĴ | en: Enable type definition, used to control the trigger in serial mode + */ +typedef enum MV_IO_ENABLE_TYPE__ +{ + MV_IO_ENABLE_START = 0x00, // ch:ʹܿʼ | en: Enable + MV_IO_ENABLE_END = 0x01, // ch:ʹܽ | en: Disable +} MV_IO_ENABLE_TYPE; + +/** @enum MV_IO_LIGHTSTATE + * @brief ch:Դ | en: Light states + */ +typedef enum MV_IO_LIGHTSTATE__ +{ + MV_IO_LIGHTSTATE_ON = 0x0001, // ch: | en:Light on after triggering + MV_IO_LIGHTSTATE_OFF = 0x0002, // ch: | en:Light off after triggering +} MV_IO_LIGHTSTATE; + +// Ϣ +typedef enum MVCL_MSG_TYPE__ +{ + MSG_TYPE_UNKNOW = 0x00, // ch:δ֪ | en:Unknow + MSG_TYPE_NORMAL = 0x02, // ch:ʶϢ | en:Normal +}MVCL_MSG_TYPE; + +/************************************************************************* + * ch:ṹ嶨 | en:Struct definition + *************************************************************************/ + +/** @struct MV_IO_SERIAL + * @brief ch:ڲ | en:Serial param + */ +typedef struct MV_IO_SERIAL__ +{ + char strComName[MV_IO_MAX_COM_NAME_LENGTH]; // ch: | en:Serial port name + unsigned int nReserved[8]; // ch:ֶ | en:Reserve +} MV_IO_SERIAL; + +/** @struct MV_IO_LIGHT_PARAM + * @brief ch:Ȳ | en:Parameter setting of light source module + */ +typedef struct MV_IO_LIGHT_PARAM__ +{ + unsigned char nPortNumber; // ch:ȶ˿ | en:Light port + unsigned short nLightValue; // ch:Դֵ(0-100֮) | en:Light value(0-100) + unsigned short nLightState; // ch:dz | en:Light on or off after triggering + unsigned short nLightEdge; // ch:ش½ش | en:Rising or falling edge trigger + unsigned int nDurationTime; // ch:ʱ | en:Duration Time + unsigned int nReserved[3]; // ch:ֶ | en:Reserved +} MV_IO_LIGHT_PARAM; + +/** @struct MV_IO_ASSOCIATE_PARAM + * @brief ch:˿ڲ | en:Input associated output port parameter setting + */ +typedef struct MV_IO_ASSOCIATEPORT_PARAM__ +{ + unsigned short nInPortNum; // ch:˿ | en:Associated input port + unsigned short nOutPortNum; // ch:˿ڣ(PORT_1)1ſڣ(PORT_1 | PORT_2)1ź2ſڣ(Դ) + // en:Associated output port, (Port_ 1)For the associated port 1, (Port_ 1 | PORT_ 2) Represents the connection between port 1 and port 2, and so on + unsigned int nReserved[4]; // ch:ֶ | en:Reserved +} MV_IO_ASSOCIATEPORT_PARAM; + + +/** @struct MV_IO_OUTPUT_ENABLE + * @brief ch:ʹ | en:Set output enable + */ +typedef struct MV_IO_OUTPUT_ENABLE__ +{ + unsigned char nPortNumber; // ʹܶ˿,˿ͬʱʹִܿл | en:Enable port, if more than one port is enabled at the same time, it can perform or operation + unsigned char nType; // MV_IO_ENABLE_START ʾʹܿʼMV_IO_ENABLE_ENDʾʹܽ | en:en:MV_IO_ENABLE_START:start of enabling,MV_IO_ENABLE_END:end of enabling + unsigned int nReserved[4]; // ֶ | en:Reserved +} MV_IO_OUTPUT_ENABLE; + +/** @struct MV_IO_INPUT_LEVEL + * @brief ch:ƽ en: Input level + */ +typedef struct MV_IO_INPUT_LEVEL__ +{ + unsigned char nPortNumber; // ch:˿ں,οMV_IO_PORT_NUMBER | en: Port number.reference MV_IO_PORT_NUMBER + unsigned char nLevel0; // ch:1ſڵƽϢ |en:Level information of port1 + unsigned char nLevel1; // ch:2ſڵƽϢ |en:Level information of port2 + unsigned char nLevel2; // ch:3ſڵƽϢ |en:Level information of port3 + unsigned char nLevel3; // ch:4ſڵƽϢ |en:Level information of port4 + unsigned char nLevel4; // ch:5ſڵƽϢ |en:Level information of port5 + unsigned char nLevel5; // ch:6ſڵƽϢ |en:Level information of port6 + unsigned char nLevel6; // ch:7ſڵƽϢ |en:Level information of port7 + unsigned char nLevel7; // ch:8ſڵƽϢ |en:Level information of port8 + unsigned int nReserved[8]; // ch:ֽ | en:Reserved +}MV_IO_INPUT_LEVEL; + +/** @struct MV_IO_INPUT_EDGE + * @brief ch:Ϣ͵Ľṹ | en:Detects the structure of the input along the information type + */ +typedef struct MV_IO_INPUT_EDGE_TYPE__ +{ + unsigned char nPortNumber; // ch:˿ں | en:Port number + unsigned short nTriggerTimes; // ch:Ӧ˿ڴ | en:Trigger times of corresponding port + enum MV_IO_EDGE_TYPE enEdgeType; // ch: | en:Trigger edge type + unsigned int nReserved[8]; // ch:ֽ | en:Reserved +}MV_IO_INPUT_EDGE_TYPE; + +/** @struct MV_IO_VERSION + * @brief ch:SDK汾 | en:SDK vision + */ +typedef struct MV_IO_VERSION__ +{ + unsigned int nMainVersion; // ch:汾 | en:Major version + unsigned int nSubVersion; // ch:ΰ汾 | en:Minor version + unsigned int nModifyVersion; // ch:޶汾 | en:Revision + unsigned int nYear; // ch: | en:Year + unsigned int nMonth; // ch: | en:month + unsigned int nDay; // ch: | en:date + unsigned int nReserved[8]; // ch:ֽ | en:Reserved +}MV_IO_VERSION; + +/** @struct MV_IO_SET_INPUT + * @brief ch:˿ | en:Input port setting + */ +typedef struct MV_IO_SET_INPUT__ +{ + unsigned int nPort; // ch:˿ | Input port + unsigned int nEnable; // ch:ʹ״̬1ʾ0ʾر | en:Enable state, 1 is on, 0 is off + unsigned int nEdge; // ch: | en:Trigger edge + unsigned int nDelayTime; // ch:ӳ | en:Trigger delay + unsigned int nGlitch; // ch:ȥʱ | en:Debounce time + unsigned int nReserved[8]; // ch:ֽ | en:Reserved +}MV_IO_SET_INPUT; + +/** @struct MV_IO_SET_OUTPUT + * @brief ch:˿ | en:Output port setting + */ +typedef struct MV_IO_SET_OUTPUT__ +{ + unsigned int nPort; // ˿ | en:Output port + unsigned int nType; // ģʽ(ģʽPWMģʽ) | en:Output mode(Single pulse and PWM mode ) + unsigned int nPulseWidth; // | en:Pulse width + unsigned int nPulsePeriod; // | en:Pulse period + unsigned int nDurationTime; // ʱ | en:Pulse duration + unsigned int nValidLevel; // Чƽ1ʾߵƽ0ʾ͵ƽ | en:Effective level, 1 is high level, 0 is low level + unsigned int nReserved[8]; // ֽ | en:Reserved +}MV_IO_SET_OUTPUT; + + +/** @struct MV_IO_LOCAL_UPGRADE + * @brief ch:̼״̬ | en:Firmware upgrade status + */ +typedef struct MV_IO_LOCAL_UPGRADE__ +{ + unsigned int nProcPercent; // ch: | en:Upgrade progress + char chProcState[MV_IO_MAX_PROC_STATE_LEN]; // ch:״̬ | en:Upgrade status + + unsigned int nReserved[8]; // ch:ֽ | en:Reserved +}MV_IO_LOCAL_UPGRADE; + + +// ch:ƽص | en:Detection level callback function +typedef void (__stdcall* DetectFunType)(void *, MV_IO_INPUT_EDGE_TYPE*, void*); + +/** @struct MV_SERIAL_DEVICE + * @brief ch: 豸 en: serial device + */ +typedef struct MV_SERIAL_DEVICE_ +{ + void* pMvSerial; // ھ + DetectFunType pCallbackFun; // ؼ⺯ + void* hCallBackThreadHandle; // ص + unsigned int bCallbackRunning; // жϻص߳Ƿִ + void* hSerialRecvThreadHandle; // ڽ߳̾ + unsigned int bSerialRecvRunning; // жϴǷڽ + char nReserved[32]; // ֽ +}MV_SERIAL_DEVICE; + +/** @struct MV_SERIAL_DATA + * @brief ch: | en: serial Data + */ +typedef struct MV_SERIAL_DATA_ +{ + unsigned int bUsed; // ch:־λǷʹ | en:Flag bit, whether the data is used or not + MVCL_MSG_TYPE nType; // ch: | en: Data type + unsigned int nRecvLen; // ch:ݳ | en:Received data length + double fRecvTime; // ch:ʱ | en:Received data time + char* pSerialRecvBuf; // ch:յ | en:Data received + char* pInitRecvBuf; // ch:ʼ | en:Initial data +}MV_SERIAL_DATA; + + +#endif + diff --git a/src/TcpServer/TcpServer.cpp b/src/TcpServer/TcpServer.cpp new file mode 100644 index 0000000..51959ca --- /dev/null +++ b/src/TcpServer/TcpServer.cpp @@ -0,0 +1,98 @@ +#include "Tcpserver.h" +#include +TcpServer::TcpServer(QObject *parent) : + QTcpServer(parent) +{ + m_tcpServerPtr = nullptr; + m_tcpSocketPtr = nullptr; + m_tcpServerPtr = new QTcpServer(this); +} + +TcpServer::~TcpServer() +{ + if (m_tcpServerPtr) + delete m_tcpServerPtr; +} + +bool TcpServer::startConnect(QString address, quint16 port) +{ + if (m_tcpServerPtr == nullptr) + return false; + if (!m_tcpServerPtr->listen(QHostAddress(address), port)) + { + return false; + } + connect(m_tcpServerPtr, &QTcpServer::newConnection, this, &TcpServer::onNewConnection); + return true; +} +bool TcpServer::startConnect() +{ + if (m_tcpServerPtr == nullptr) + return false; + if (!m_tcpServerPtr->listen(QHostAddress(m_serverIP), m_serverPort)) + { + return false; + } + connect(m_tcpServerPtr, &QTcpServer::newConnection, this, &TcpServer::onNewConnection); + return true; +} +void TcpServer::onCloseConnect() +{ + + if (m_tcpServerPtr != nullptr) + { + if (m_tcpSocketPtr != nullptr) + { + m_tcpSocketPtr->disconnectFromHost(); + m_tcpSocketPtr->close(); + m_tcpSocketPtr = nullptr; + } + m_tcpServerPtr->disconnect(); + m_tcpServerPtr->close(); + } + +} +void TcpServer::onNewConnection() +{ + //ȡӵ׽ + m_tcpSocketPtr = m_tcpServerPtr->nextPendingConnection(); + + m_clientIp = m_tcpSocketPtr->peerAddress().toString(); + m_clientPort = m_tcpSocketPtr->peerPort(); + emit sgConnected(m_clientIp, m_clientPort); + + connect(m_tcpSocketPtr, &QTcpSocket::readyRead, this, &TcpServer::onReceiveMsg); + //connect(m_tcpSocketPtr, &QTcpSocket::stateChanged, this, &TcpServer::onStateChanged); + //connect(m_tcpSocketPtr, SIGNAL(error(QAbstractSocket::SocketError)), this, &TcpServer::onSocketError); +} + +void TcpServer::onReceiveMsg() +{ + QByteArray dataByte = m_tcpSocketPtr->readAll(); + if (!dataByte.isEmpty()) + { + emit sgReceived(m_clientIp, m_clientPort, dataByte); + } +} + +//void TcpServer::onDisconnected() +//{ +// emit sgDisconnected(m_clientIp, m_clientPort); +//} +//void TcpServer::onStateChanged(QAbstractSocket::SocketState socketState) +//{ +// if (socketState == QAbstractSocket::UnconnectedState) +// { +// emit sgDisconnected(m_clientIp, m_clientPort); +// m_tcpSocketPtr->deleteLater(); +// } +//} +// +//void TcpServer::onSocketError(QAbstractSocket::SocketError socketError) +//{ +// int error = m_tcpSocketPtr->error(); +// if (error == QAbstractSocket::RemoteHostClosedError) +// { +// emit sgDisconnected(m_clientIp, m_clientPort); +// } +//} \ No newline at end of file diff --git a/src/TcpServer/TcpServer.h b/src/TcpServer/TcpServer.h new file mode 100644 index 0000000..1a1adea --- /dev/null +++ b/src/TcpServer/TcpServer.h @@ -0,0 +1,72 @@ +#ifndef _H_TCPSERVER_H_ +#define _H_TCPSERVER_H_ + +#include +#include + +#include +#include +#include + +//#include "tcpsocket.h" + +#include + +#ifndef BUILD_STATIC +# if defined(TCPSERVER_LIB) +# define TCPSERVER_EXPORT Q_DECL_EXPORT +# else +# define TCPSERVER_EXPORT Q_DECL_IMPORT +# endif +#else +# define TCPSERVER_EXPORT +#endif + +class TCPSERVER_EXPORT TcpServer : public QTcpServer +{ + Q_OBJECT + +public: + explicit TcpServer(QObject *parent = 0); + ~TcpServer(); + + bool startConnect(); + bool startConnect(QString address, quint16 port); + void onCloseConnect(); + + void setServerIpPort(QString ip, quint16 port) + { + m_serverIP = ip; + m_serverPort = port; + } +signals: + void sgConnected(QString ip, quint16 port); + void sgReceived(QString ip, quint16 port, const QByteArray &msg); + void sgDisconnected(QString ip, quint16 port); +protected: + void SendHeartHitBack(); + +private: + + QTcpServer *m_tcpServerPtr; //׽ + QTcpSocket *m_tcpSocketPtr; //ͨ׽ + + bool m_bGetHeader{ false }; + int m_goalSize{ 0 }; + int m_nowSize{ 0 }; + + QString m_clientIp; + quint16 m_clientPort; + QString m_serverIP; + quint16 m_serverPort; + QByteArray m_receiveData; + +private slots: + void onNewConnection(); + void onReceiveMsg(); + //void onDisconnected(); + //void onStateChanged(QAbstractSocket::SocketState socketState); + //void onSocketError(QAbstractSocket::SocketError socketError); +}; + +#endif // !_H_TCPSERVER_H_ diff --git a/src/VisionController/VisionController.cpp b/src/VisionController/VisionController.cpp new file mode 100644 index 0000000..fe12660 --- /dev/null +++ b/src/VisionController/VisionController.cpp @@ -0,0 +1,231 @@ +#pragma execution_character_set("utf-8") +#include "VisionController.h" + +VisionController::VisionController(QWidget *parent) + : QMainWindow(parent) +{ + ui.setupUi(this); + + m_tcpServerPtr = nullptr; + m_tcpServerPtr = new TcpServer(this); + QString path = QApplication::applicationDirPath(); + QString serverIP = "127.0.0.1"; + quint16 serverPort = 9900; + readServerConfig(path, serverIP, serverPort); + ui.LineEdit_IP->setText(serverIP); + ui.LineEdit_Port->setText(tr("%1").arg(serverPort)); + ui.LineEdit_IP->setEnabled(false); + if (m_tcpServerPtr->startConnect(serverIP, serverPort)) + { + //QString msg = QString("1%: 2% ɹ").arg(serverIp).arg(port); + QString showMsg = QString("%1: %2 ɹ").arg(serverIP).arg(serverPort); + ui.textLog->appendPlainText(showMsg); + ui.ButtonStart->setEnabled(false); + ui.ButtonStop->setEnabled(true); + } + else + { + QString showMsg = QString("%1: %2 ʧܡ").arg(serverIP).arg(serverPort); + ui.textLog->appendPlainText(showMsg); + } + connect(ui.ButtonStart, SIGNAL(clicked()), this, SLOT(onButtonClicked())); + connect(ui.ButtonStop, SIGNAL(clicked()), this, SLOT(onButtonClicked())); + connect(ui.ButtonClear, SIGNAL(clicked()), this, SLOT(onButtonClicked())); + + connect(m_tcpServerPtr, &TcpServer::sgConnected, this, &VisionController::newConnected); + connect(m_tcpServerPtr, &TcpServer::sgReceived, this, &VisionController::receivedData); + connect(m_tcpServerPtr, &TcpServer::sgDisconnected, this, &VisionController::onDisconnected); + m_ioControllerPtr = new IOController(); + unsigned int serialNum = 2; + if (!m_ioControllerPtr->controllerInitialization(serialNum)) + { + QString showMsg = QString("Com%1ʼʧ").arg(serialNum); + ui.textLog->appendPlainText(showMsg); + } + else + { + QString showMsg = QString("Com%1ʼɹ").arg(serialNum); + ui.textLog->appendPlainText(showMsg); + } +} + +bool VisionController::readServerConfig(QString path, QString& serverIP, quint16& port) +{ + QString filePath = path + "\\..\\config\\tcpServer.json"; + QFile jsonFile(filePath); + if (!jsonFile.exists()) + { + qDebug() << "ļ: " << filePath << "ڣ"; + return false; + } + if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) + { + qDebug() << "ļ" << filePath << "ʧܣ"; + return false; + } + QByteArray dataArray = jsonFile.readAll(); + jsonFile.close(); + QJsonParseError jsonError; + QJsonDocument jsonDocument = QJsonDocument::fromJson(dataArray, &jsonError); + if (jsonError.error != QJsonParseError::NoError) + { + qDebug() << "ļ" << filePath << "ʽ"; + return false; + } + + QJsonObject jsonObject = jsonDocument.object(); + QJsonObject addressObj = jsonObject.value("address").toObject(); + serverIP = addressObj.value("IP").toString(); + port = addressObj.value("Port").toString().toUInt(); + + return true; +} +bool VisionController::writeServerConfig(QString path, QString serverIP, quint16 serverPort) +{ + QString filePath = path + "\\..\\config\\tcpServer.json"; + QFile jsonFile(filePath); + if (!jsonFile.open(QIODevice::WriteOnly)) + { + qDebug() << "ļ" << filePath << "ʧܣ"; + return false; + } + QJsonObject addressObj; + QJsonObject subObj; + subObj.insert("IP", serverIP); + subObj.insert("Port", tr("%1").arg(serverPort)); + addressObj.insert("address", QJsonObject(subObj)); + QJsonDocument jsonDoc(addressObj); + QByteArray jsonData = jsonDoc.toJson(); + jsonFile.write(jsonData); + jsonFile.close(); + return true; +} +VisionController::~VisionController() +{ + if (m_ioControllerPtr) + { + delete m_ioControllerPtr; + //m_ioControllerPtr = nullptr; + } + + if (m_tcpServerPtr) + { + delete m_tcpServerPtr; + } +} + +Q_SLOT void VisionController::onButtonClicked() +{ + QString strObj = sender()->objectName(); + if (strObj == "ButtonStart") + { + QString serverIp = ui.LineEdit_IP->text(); + quint16 port = ui.LineEdit_Port->text().toUInt(); + QString path = QApplication::applicationDirPath(); + writeServerConfig(path, serverIp, port); + if (m_tcpServerPtr->startConnect(serverIp, port)) + { + //QString msg = QString("1%: 2% ɹ").arg(serverIp).arg(port); + QString showMsg = QString("%1: %2 ɹ").arg(serverIp).arg(port); + ui.textLog->appendPlainText(showMsg); + ui.ButtonStart->setEnabled(false); + ui.ButtonStop->setEnabled(true); + } + else + { + QString showMsg = QString("%1: %2 ʧܡ").arg(serverIp).arg(port); + ui.textLog->appendPlainText(showMsg); + } + } + else if (strObj == "ButtonStop") + { + if (m_tcpServerPtr != nullptr) + { + m_tcpServerPtr->onCloseConnect(); + ui.ButtonStart->setEnabled(true); + ui.ButtonStop->setEnabled(false); + //delete m_tcpServerPtr; + } + } + else if (strObj == "ButtonClear") + { + ui.textLog->clear(); + } +} +Q_SLOT void VisionController::newConnected(QString ip, quint16 port) +{ + QString showMsg = QString("ͻߣ%1: %2").arg(ip).arg(port); + ui.textLog->appendPlainText(showMsg); +} +Q_SLOT void VisionController::receivedData(QString ip, quint16 port, const QByteArray& dataByte) +{ + QString showMsg = QString("ͻˣ%1: %2").arg(ip).arg(port); + showMsg.append(dataByte); + ui.textLog->appendPlainText(showMsg); + QString msg = QString(dataByte); + + if (msg.startsWith("<") && msg.endsWith(">")) + { + msg.chop(1); + msg.remove(0, 1); + QStringList splitList = msg.split(","); + unsigned int port = splitList[0].toInt(); + unsigned int state = splitList[1].toInt(); + QString mode = splitList[2]; + if (mode == "post") + { + if (!m_ioControllerPtr->controlPort(port, state)) + { + if (state == 0) + { + QString errorMsg = QString("˿Port%1 رʧܣ").arg(port); + ui.textLog->appendPlainText(errorMsg); + } + else if (state == 1) + { + QString errorMsg = QString("˿Port%1 ʧܣ").arg(port); + ui.textLog->appendPlainText(errorMsg); + } + } + else + { + if (state == 0) + { + QString successMsg = QString("˿port%1 رճɹ").arg(port); + ui.textLog->appendPlainText(successMsg); + } + else if (state == 1) + { + QString successMsg = QString("˿port%1 򿪳ɹ").arg(port); + ui.textLog->appendPlainText(successMsg); + } + } + } + else if (mode == "get") + { + unsigned int portState; + if (m_ioControllerPtr->getPortState(port, portState)) + { + QString successMsg = QString("˿port%1״̬Ϊ%2").arg(port).arg(portState); + ui.textLog->appendPlainText(successMsg); + } + else + { + QString errorMsg = QString("˿port%1״̬ȡʧܣ").arg(port); + ui.textLog->appendPlainText(errorMsg); + } + } + } +} +Q_SLOT void VisionController::onDisconnected(QString ip, quint16 port) +{ + QString msg = QString("ͻˣ%1%2Ͽӣ").arg(ip).arg(port); + ui.textLog->appendPlainText(msg); +} +void VisionController::closeEvent(QCloseEvent *event) +{ + QString serverIp = ui.LineEdit_IP->text(); + quint16 port = ui.LineEdit_Port->text().toUInt(); + QString path = QApplication::applicationDirPath(); + writeServerConfig(path, serverIp, port); +} \ No newline at end of file diff --git a/src/VisionController/VisionController.h b/src/VisionController/VisionController.h new file mode 100644 index 0000000..5cc5860 --- /dev/null +++ b/src/VisionController/VisionController.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include "ui_VisionController.h" +#include "TcpServer.h" +#include "IOController.h" + +class VisionController : public QMainWindow +{ + Q_OBJECT + +public: + VisionController(QWidget *parent = Q_NULLPTR); + ~VisionController(); +protected: + virtual void closeEvent(QCloseEvent *event); + +private: + Ui::VisionControllerClass ui; + + Q_SLOT void onButtonClicked(); + Q_SLOT void newConnected(QString ip, quint16 port); + Q_SLOT void receivedData(QString ip, quint16 port, const QByteArray &dataByte); + Q_SLOT void onDisconnected(QString ip, quint16 port); + bool readServerConfig(QString path, QString& serverIP, quint16& port); + bool writeServerConfig(QString path, QString serverIP, quint16 port); + TcpServer* m_tcpServerPtr; + IOController* m_ioControllerPtr{nullptr}; + //IOInterface* m_ioInterfacePtr{ nullptr }; +}; diff --git a/src/VisionController/main.cpp b/src/VisionController/main.cpp new file mode 100644 index 0000000..f0926b2 --- /dev/null +++ b/src/VisionController/main.cpp @@ -0,0 +1,10 @@ +#include "VisionController.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + VisionController w; + w.show(); + return a.exec(); +} diff --git a/tpvs17/IOController/IOController.vcxproj b/tpvs17/IOController/IOController.vcxproj new file mode 100644 index 0000000..ee9512e --- /dev/null +++ b/tpvs17/IOController/IOController.vcxproj @@ -0,0 +1,115 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {FB680084-3EA6-4ECA-BC68-2644C45CC825} + Qt4VSv1.0 + 10.0.17763.0 + + + + DynamicLibrary + v141 + + + DynamicLibrary + v141 + + + + $(MSBuildProjectDirectory)\QtMsBuild + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;IOCONTROLLER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + true + + + Windows + $(OutDir)\$(ProjectName).dll + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + qtmaind.lib;Qt5Cored.lib;%(AdditionalDependencies) + + + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;IOCONTROLLER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;%(AdditionalIncludeDirectories) + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;IOCONTROLLER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(SolutionDir)..\src\IOController\NewSdkInc;%(AdditionalIncludeDirectories) + + MultiThreadedDLL + true + + + Windows + $(SolutionDir)..\runner17\$(ProjectName).dll + $(QTDIR)\lib;$(QTDIR);$(OutDir);%(AdditionalLibraryDirectories) + false + qtmain.lib;Qt5Core.lib;MvIOInterfaceBox.lib;%(AdditionalDependencies) + + + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;IOCONTROLLER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(SolutionDir)..\src\IOController\NewSdkInc;%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tpvs17/IOController/IOController.vcxproj.filters b/tpvs17/IOController/IOController.vcxproj.filters new file mode 100644 index 0000000..0280666 --- /dev/null +++ b/tpvs17/IOController/IOController.vcxproj.filters @@ -0,0 +1,50 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + {549a6910-6555-4b27-a3de-dec5b66aca6a} + + + + + Header Files\NewSdkInc + + + Header Files\NewSdkInc + + + Header Files\NewSdkInc + + + Header Files + + + + + Source Files + + + \ No newline at end of file diff --git a/tpvs17/IOController/IOController.vcxproj.user b/tpvs17/IOController/IOController.vcxproj.user new file mode 100644 index 0000000..4195e6b --- /dev/null +++ b/tpvs17/IOController/IOController.vcxproj.user @@ -0,0 +1,12 @@ + + + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + PATH=$(QTDIR)\bin%3b$(PATH) + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + PATH=$(QTDIR)\bin%3b$(PATH) + + \ No newline at end of file diff --git a/tpvs17/TcpServer/TcpServer.vcxproj b/tpvs17/TcpServer/TcpServer.vcxproj new file mode 100644 index 0000000..d817062 --- /dev/null +++ b/tpvs17/TcpServer/TcpServer.vcxproj @@ -0,0 +1,117 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {58DB7028-F0B5-4D49-AE6C-F29CE2942198} + Qt4VSv1.0 + 10.0.17763.0 + + + + DynamicLibrary + v141 + + + DynamicLibrary + v141 + + + + $(MSBuildProjectDirectory)\QtMsBuild + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_NETWORK_LIB;TCPSERVER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + true + + + Windows + $(OutDir)\$(ProjectName).dll + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + qtmaind.lib;Qt5Cored.lib;Qt5Networkd.lib;%(AdditionalDependencies) + + + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_NETWORK_LIB;TCPSERVER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_NETWORK_LIB;TCPSERVER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork;%(AdditionalIncludeDirectories) + None + MultiThreadedDLL + true + MaxSpeed + + + Windows + $(SolutionDir)..\runner17\$(ProjectName).dll + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + false + qtmain.lib;Qt5Core.lib;Qt5Network.lib;%(AdditionalDependencies) + + + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_NETWORK_LIB;TCPSERVER_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtNetwork + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tpvs17/TcpServer/TcpServer.vcxproj.filters b/tpvs17/TcpServer/TcpServer.vcxproj.filters new file mode 100644 index 0000000..3021139 --- /dev/null +++ b/tpvs17/TcpServer/TcpServer.vcxproj.filters @@ -0,0 +1,38 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/tpvs17/TcpServer/TcpServer.vcxproj.user b/tpvs17/TcpServer/TcpServer.vcxproj.user new file mode 100644 index 0000000..4195e6b --- /dev/null +++ b/tpvs17/TcpServer/TcpServer.vcxproj.user @@ -0,0 +1,12 @@ + + + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + PATH=$(QTDIR)\bin%3b$(PATH) + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + PATH=$(QTDIR)\bin%3b$(PATH) + + \ No newline at end of file diff --git a/tpvs17/VisionController.sln b/tpvs17/VisionController.sln new file mode 100644 index 0000000..f22d4ee --- /dev/null +++ b/tpvs17/VisionController.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.852 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VisionController", "VisionController\VisionController.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IOController", "IOController\IOController.vcxproj", "{FB680084-3EA6-4ECA-BC68-2644C45CC825}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TcpServer", "TcpServer\TcpServer.vcxproj", "{58DB7028-F0B5-4D49-AE6C-F29CE2942198}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.ActiveCfg = Debug|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|x64.Build.0 = Debug|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.ActiveCfg = Release|x64 + {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|x64.Build.0 = Release|x64 + {FB680084-3EA6-4ECA-BC68-2644C45CC825}.Debug|x64.ActiveCfg = Debug|x64 + {FB680084-3EA6-4ECA-BC68-2644C45CC825}.Debug|x64.Build.0 = Debug|x64 + {FB680084-3EA6-4ECA-BC68-2644C45CC825}.Release|x64.ActiveCfg = Release|x64 + {FB680084-3EA6-4ECA-BC68-2644C45CC825}.Release|x64.Build.0 = Release|x64 + {58DB7028-F0B5-4D49-AE6C-F29CE2942198}.Debug|x64.ActiveCfg = Debug|x64 + {58DB7028-F0B5-4D49-AE6C-F29CE2942198}.Debug|x64.Build.0 = Debug|x64 + {58DB7028-F0B5-4D49-AE6C-F29CE2942198}.Release|x64.ActiveCfg = Release|x64 + {58DB7028-F0B5-4D49-AE6C-F29CE2942198}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {62AB1429-5087-41C5-9263-67FBA9A870BB} + EndGlobalSection +EndGlobal diff --git a/tpvs17/VisionController/VisionController.qrc b/tpvs17/VisionController/VisionController.qrc new file mode 100644 index 0000000..771800c --- /dev/null +++ b/tpvs17/VisionController/VisionController.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/tpvs17/VisionController/VisionController.ui b/tpvs17/VisionController/VisionController.ui new file mode 100644 index 0000000..9bed01d --- /dev/null +++ b/tpvs17/VisionController/VisionController.ui @@ -0,0 +1,214 @@ + + + VisionControllerClass + + + + 0 + 0 + 631 + 495 + + + + VisionController + + + + + + 10 + 0 + 611 + 441 + + + + Pannel + + + + + 10 + 20 + 271 + 131 + + + + Server Setting + + + + + 20 + 30 + 231 + 31 + + + + + + + IP: + + + + + + + + + + Port: + + + + + + + + + + + + 40 + 80 + 191 + 31 + + + + + + + Start + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Stop + + + + + + + + + + 320 + 30 + 281 + 191 + + + + Text Log + + + + + 20 + 20 + 251 + 131 + + + + + + + 20 + 160 + 75 + 23 + + + + Clear + + + + + + + 10 + 180 + 281 + 251 + + + + Client List + + + + + 10 + 20 + 261 + 221 + + + + + Num + + + + + IP + + + + + Port + + + + + + + + + + 0 + 0 + 631 + 23 + + + + + + TopToolBarArea + + + false + + + + + + + + + + diff --git a/tpvs17/VisionController/VisionController.vcxproj b/tpvs17/VisionController/VisionController.vcxproj new file mode 100644 index 0000000..6b3cbe3 --- /dev/null +++ b/tpvs17/VisionController/VisionController.vcxproj @@ -0,0 +1,140 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {B12702AD-ABFB-343A-A199-8E24837244A3} + Qt4VSv1.0 + 10.0.17763.0 + + + + Application + v141 + + + Application + v141 + + + + $(MSBuildProjectDirectory)\QtMsBuild + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + $(SolutionDir)$(Platform)\$(Configuration)\ + + + + + + + + + + + + + + + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) + Disabled + ProgramDatabase + MultiThreadedDebugDLL + true + + + Windows + $(OutDir)\$(ProjectName).exe + $(QTDIR)\lib;%(AdditionalLibraryDirectories) + true + qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Networkd.lib;Qt5Widgetsd.lib;%(AdditionalDependencies) + + + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + + + Uic'ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h + + + Rcc'ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp + + + + + true + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWidgets;$(SolutionDir)..\src\TcpServer;$(SolutionDir)..\src\IOController;$(SolutionDir)..\src\IOController\NewSdkInc;$(SolutionDir)..\src\VisionController;$(OutDir);%(AdditionalIncludeDirectories) + None + MultiThreadedDLL + true + MaxSpeed + + + Windows + $(SolutionDir)..\runner17\$(ProjectName).exe + $(QTDIR)\lib;$(OutDir);%(AdditionalLibraryDirectories) + false + qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Network.lib;Qt5Widgets.lib;IOController.lib;TcpServer.lib;%(AdditionalDependencies) + + + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + Moc'ing %(Identity)... + .\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtWidgets;$(SolutionDir)..\src\TcpServer;$(SolutionDir)..\src\IOController;$(SolutionDir)..\src\IOController\NewSdkInc;$(SolutionDir)..\src\VisionController;%(AdditionalIncludeDirectories) + UNICODE;_UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_WIDGETS_LIB;%(PreprocessorDefinitions) + + + Uic'ing %(Identity)... + .\GeneratedFiles\ui_%(Filename).h + + + Rcc'ing %(Identity)... + .\GeneratedFiles\qrc_%(Filename).cpp + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tpvs17/VisionController/VisionController.vcxproj.filters b/tpvs17/VisionController/VisionController.vcxproj.filters new file mode 100644 index 0000000..31b1a61 --- /dev/null +++ b/tpvs17/VisionController/VisionController.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {99349809-55BA-4b9d-BF79-8FDBB0286EB3} + ui + + + {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} + qrc;* + false + + + {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} + moc;h;cpp + False + + + + + Form Files + + + + + Resource Files + + + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/tpvs17/VisionController/VisionController.vcxproj.user b/tpvs17/VisionController/VisionController.vcxproj.user new file mode 100644 index 0000000..2ad395e --- /dev/null +++ b/tpvs17/VisionController/VisionController.vcxproj.user @@ -0,0 +1,14 @@ + + + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + PATH=$(QTDIR)\bin%3b$(PATH) + + + D:\Qt\Qt5.9.4\5.9.4\msvc2017_64 + $(SolutionDir)..\runner17\$(ProjectName).exe + WindowsLocalDebugger + PATH=$(QTDIR)\bin%3b$(PATH) + + \ No newline at end of file diff --git a/tpvs17/x64/Release/MvIOInterfaceBox.lib b/tpvs17/x64/Release/MvIOInterfaceBox.lib new file mode 100644 index 0000000..55387e0 Binary files /dev/null and b/tpvs17/x64/Release/MvIOInterfaceBox.lib differ