VisionController Version1.0:
1 实现Tcp服务器,支持一个Tcp客户端连接 2 能够接收客户端发送的信息控制IO口输出merge-requests/1/head
commit
eb72df6210
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"address": {
|
||||||
|
"IP": "127.0.0.1",
|
||||||
|
"Port": "9900"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@ -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;
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
#ifndef _H_IOController_H_
|
||||||
|
#define _H_IOController_H_
|
||||||
|
|
||||||
|
//#define MAX_DEVICE 6
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
|
#include <QtCore>
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
#include <QMap>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#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<std::string, void*> m_mpComsHandle;
|
||||||
|
//QMap<std::string, MV_IO_SERIAL> m_mpStIOSerial;
|
||||||
|
QMap<std::string, bool> m_mpComsState;
|
||||||
|
std::string m_comName;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !_H_IOController_H_
|
||||||
|
|
||||||
@ -0,0 +1,98 @@
|
|||||||
|
#include "Tcpserver.h"
|
||||||
|
#include <QDebug>
|
||||||
|
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);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
#ifndef _H_TCPSERVER_H_
|
||||||
|
#define _H_TCPSERVER_H_
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <QHash>
|
||||||
|
#include <QTcpServer>
|
||||||
|
#include <QTcpSocket>
|
||||||
|
|
||||||
|
//#include "tcpsocket.h"
|
||||||
|
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
#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_
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
|
||||||
|
#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 };
|
||||||
|
};
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#include "VisionController.h"
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
VisionController w;
|
||||||
|
w.show();
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||||
|
<Extensions>moc;h;cpp</Extensions>
|
||||||
|
<SourceControlFiles>False</SourceControlFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files\NewSdkInc">
|
||||||
|
<UniqueIdentifier>{549a6910-6555-4b27-a3de-dec5b66aca6a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\src\IOController\NewSdkInc\MvErrorDefine.h">
|
||||||
|
<Filter>Header Files\NewSdkInc</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\IOController\NewSdkInc\MvIOInterfaceBox.h">
|
||||||
|
<Filter>Header Files\NewSdkInc</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\IOController\NewSdkInc\MvIOInterfaceBoxDefine.h">
|
||||||
|
<Filter>Header Files\NewSdkInc</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\src\IOController\IOController.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\src\IOController\IOController.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||||
|
<Extensions>moc;h;cpp</Extensions>
|
||||||
|
<SourceControlFiles>False</SourceControlFiles>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\src\TcpServer\TcpServer.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="..\..\src\TcpServer\TcpServer.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="VisionController">
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
@ -0,0 +1,214 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>VisionControllerClass</class>
|
||||||
|
<widget class="QMainWindow" name="VisionControllerClass">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>631</width>
|
||||||
|
<height>495</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>VisionController</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralWidget">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>611</width>
|
||||||
|
<height>441</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Pannel</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>271</width>
|
||||||
|
<height>131</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Server Setting</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>231</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>IP:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="LineEdit_IP"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Port:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="LineEdit_Port"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>40</x>
|
||||||
|
<y>80</y>
|
||||||
|
<width>191</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="ButtonStart">
|
||||||
|
<property name="text">
|
||||||
|
<string>Start</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="ButtonStop">
|
||||||
|
<property name="text">
|
||||||
|
<string>Stop</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>320</x>
|
||||||
|
<y>30</y>
|
||||||
|
<width>281</width>
|
||||||
|
<height>191</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Text Log</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPlainTextEdit" name="textLog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>251</width>
|
||||||
|
<height>131</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="ButtonClear">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>20</x>
|
||||||
|
<y>160</y>
|
||||||
|
<width>75</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Clear</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>180</y>
|
||||||
|
<width>281</width>
|
||||||
|
<height>251</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Client List</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>261</width>
|
||||||
|
<height>221</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Num</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>IP</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Port</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menuBar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>631</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolBar" name="mainToolBar">
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusBar"/>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<resources>
|
||||||
|
<include location="VisionController.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;*</Extensions>
|
||||||
|
<ParseFiles>false</ParseFiles>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11}</UniqueIdentifier>
|
||||||
|
<Extensions>moc;h;cpp</Extensions>
|
||||||
|
<SourceControlFiles>False</SourceControlFiles>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtUic Include="VisionController.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="VisionController.qrc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</QtRcc>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\src\VisionController\main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\src\VisionController\VisionController.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtMoc Include="..\..\src\VisionController\VisionController.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<QTDIR>D:\Qt\Qt5.9.4\5.9.4\msvc2017_64</QTDIR>
|
||||||
|
<LocalDebuggerCommand>$(SolutionDir)..\runner17\$(ProjectName).exe</LocalDebuggerCommand>
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
Binary file not shown.
Loading…
Reference in New Issue