添加了 归零等操作
增加了testdll 样例
This commit is contained in:
131
testdll/GeneratedFiles/Debug/moc_testdll.cpp
Normal file
131
testdll/GeneratedFiles/Debug/moc_testdll.cpp
Normal file
@ -0,0 +1,131 @@
|
||||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'testdll.h'
|
||||
**
|
||||
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.8.0)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../../testdll.h"
|
||||
#include <QtCore/qbytearray.h>
|
||||
#include <QtCore/qmetatype.h>
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'testdll.h' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 67
|
||||
#error "This file was generated using the moc from 5.8.0. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
QT_WARNING_PUSH
|
||||
QT_WARNING_DISABLE_DEPRECATED
|
||||
struct qt_meta_stringdata_testdll_t {
|
||||
QByteArrayData data[8];
|
||||
char stringdata0[65];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||
qptrdiff(offsetof(qt_meta_stringdata_testdll_t, stringdata0) + ofs \
|
||||
- idx * sizeof(QByteArrayData)) \
|
||||
)
|
||||
static const qt_meta_stringdata_testdll_t qt_meta_stringdata_testdll = {
|
||||
{
|
||||
QT_MOC_LITERAL(0, 0, 7), // "testdll"
|
||||
QT_MOC_LITERAL(1, 8, 12), // "onbeginstart"
|
||||
QT_MOC_LITERAL(2, 21, 0), // ""
|
||||
QT_MOC_LITERAL(3, 22, 10), // "onfanzhuan"
|
||||
QT_MOC_LITERAL(4, 33, 6), // "onstop"
|
||||
QT_MOC_LITERAL(5, 40, 8), // "onlogcom"
|
||||
QT_MOC_LITERAL(6, 49, 3), // "str"
|
||||
QT_MOC_LITERAL(7, 53, 11) // "oninfomotor"
|
||||
|
||||
},
|
||||
"testdll\0onbeginstart\0\0onfanzhuan\0"
|
||||
"onstop\0onlogcom\0str\0oninfomotor"
|
||||
};
|
||||
#undef QT_MOC_LITERAL
|
||||
|
||||
static const uint qt_meta_data_testdll[] = {
|
||||
|
||||
// content:
|
||||
7, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
5, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// slots: name, argc, parameters, tag, flags
|
||||
1, 0, 39, 2, 0x0a /* Public */,
|
||||
3, 0, 40, 2, 0x0a /* Public */,
|
||||
4, 0, 41, 2, 0x0a /* Public */,
|
||||
5, 1, 42, 2, 0x0a /* Public */,
|
||||
7, 0, 45, 2, 0x0a /* Public */,
|
||||
|
||||
// slots: parameters
|
||||
QMetaType::Void,
|
||||
QMetaType::Void,
|
||||
QMetaType::Void,
|
||||
QMetaType::Void, QMetaType::QString, 6,
|
||||
QMetaType::Void,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
void testdll::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
testdll *_t = static_cast<testdll *>(_o);
|
||||
Q_UNUSED(_t)
|
||||
switch (_id) {
|
||||
case 0: _t->onbeginstart(); break;
|
||||
case 1: _t->onfanzhuan(); break;
|
||||
case 2: _t->onstop(); break;
|
||||
case 3: _t->onlogcom((*reinterpret_cast< QString(*)>(_a[1]))); break;
|
||||
case 4: _t->oninfomotor(); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObject testdll::staticMetaObject = {
|
||||
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_testdll.data,
|
||||
qt_meta_data_testdll, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
|
||||
};
|
||||
|
||||
|
||||
const QMetaObject *testdll::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *testdll::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return Q_NULLPTR;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_testdll.stringdata0))
|
||||
return static_cast<void*>(const_cast< testdll*>(this));
|
||||
return QMainWindow::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int testdll::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QMainWindow::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 5)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 5;
|
||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
if (_id < 5)
|
||||
*reinterpret_cast<int*>(_a[0]) = -1;
|
||||
_id -= 5;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
QT_WARNING_POP
|
||||
QT_END_MOC_NAMESPACE
|
46
testdll/GeneratedFiles/qrc_testdll.cpp
Normal file
46
testdll/GeneratedFiles/qrc_testdll.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
** Resource object code
|
||||
**
|
||||
** Created by: The Resource Compiler for Qt version 5.8.0
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef QT_NAMESPACE
|
||||
# define QT_RCC_PREPEND_NAMESPACE(name) ::QT_NAMESPACE::name
|
||||
# define QT_RCC_MANGLE_NAMESPACE0(x) x
|
||||
# define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
|
||||
# define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
|
||||
# define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
|
||||
QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
|
||||
#else
|
||||
# define QT_RCC_PREPEND_NAMESPACE(name) name
|
||||
# define QT_RCC_MANGLE_NAMESPACE(name) name
|
||||
#endif
|
||||
|
||||
#ifdef QT_NAMESPACE
|
||||
namespace QT_NAMESPACE {
|
||||
#endif
|
||||
|
||||
#ifdef QT_NAMESPACE
|
||||
}
|
||||
#endif
|
||||
|
||||
int QT_RCC_MANGLE_NAMESPACE(qInitResources_testdll)();
|
||||
int QT_RCC_MANGLE_NAMESPACE(qInitResources_testdll)()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_testdll)();
|
||||
int QT_RCC_MANGLE_NAMESPACE(qCleanupResources_testdll)()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct initializer {
|
||||
initializer() { QT_RCC_MANGLE_NAMESPACE(qInitResources_testdll)(); }
|
||||
~initializer() { QT_RCC_MANGLE_NAMESPACE(qCleanupResources_testdll)(); }
|
||||
} dummy;
|
||||
}
|
149
testdll/GeneratedFiles/ui_testdll.h
Normal file
149
testdll/GeneratedFiles/ui_testdll.h
Normal file
@ -0,0 +1,149 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'testdll.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 5.8.0
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_TESTDLL_H
|
||||
#define UI_TESTDLL_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QStatusBar>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
#include <QtWidgets/QToolBar>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_testdllClass
|
||||
{
|
||||
public:
|
||||
QWidget *centralWidget;
|
||||
QVBoxLayout *verticalLayout;
|
||||
QHBoxLayout *horizontalLayout_2;
|
||||
QLabel *label;
|
||||
QLineEdit *lineEdit;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QPushButton *startmotor;
|
||||
QPushButton *pushButton;
|
||||
QPushButton *pushButton_3;
|
||||
QPushButton *pushButton_2;
|
||||
QTextEdit *textEdit;
|
||||
QMenuBar *menuBar;
|
||||
QToolBar *mainToolBar;
|
||||
QStatusBar *statusBar;
|
||||
|
||||
void setupUi(QMainWindow *testdllClass)
|
||||
{
|
||||
if (testdllClass->objectName().isEmpty())
|
||||
testdllClass->setObjectName(QStringLiteral("testdllClass"));
|
||||
testdllClass->resize(600, 400);
|
||||
centralWidget = new QWidget(testdllClass);
|
||||
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
||||
verticalLayout = new QVBoxLayout(centralWidget);
|
||||
verticalLayout->setSpacing(6);
|
||||
verticalLayout->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
|
||||
horizontalLayout_2 = new QHBoxLayout();
|
||||
horizontalLayout_2->setSpacing(6);
|
||||
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
|
||||
label = new QLabel(centralWidget);
|
||||
label->setObjectName(QStringLiteral("label"));
|
||||
|
||||
horizontalLayout_2->addWidget(label);
|
||||
|
||||
lineEdit = new QLineEdit(centralWidget);
|
||||
lineEdit->setObjectName(QStringLiteral("lineEdit"));
|
||||
|
||||
horizontalLayout_2->addWidget(lineEdit);
|
||||
|
||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
horizontalLayout_2->addItem(horizontalSpacer);
|
||||
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout_2);
|
||||
|
||||
horizontalLayout = new QHBoxLayout();
|
||||
horizontalLayout->setSpacing(6);
|
||||
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
|
||||
startmotor = new QPushButton(centralWidget);
|
||||
startmotor->setObjectName(QStringLiteral("startmotor"));
|
||||
|
||||
horizontalLayout->addWidget(startmotor);
|
||||
|
||||
pushButton = new QPushButton(centralWidget);
|
||||
pushButton->setObjectName(QStringLiteral("pushButton"));
|
||||
|
||||
horizontalLayout->addWidget(pushButton);
|
||||
|
||||
pushButton_3 = new QPushButton(centralWidget);
|
||||
pushButton_3->setObjectName(QStringLiteral("pushButton_3"));
|
||||
|
||||
horizontalLayout->addWidget(pushButton_3);
|
||||
|
||||
pushButton_2 = new QPushButton(centralWidget);
|
||||
pushButton_2->setObjectName(QStringLiteral("pushButton_2"));
|
||||
|
||||
horizontalLayout->addWidget(pushButton_2);
|
||||
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout);
|
||||
|
||||
textEdit = new QTextEdit(centralWidget);
|
||||
textEdit->setObjectName(QStringLiteral("textEdit"));
|
||||
|
||||
verticalLayout->addWidget(textEdit);
|
||||
|
||||
testdllClass->setCentralWidget(centralWidget);
|
||||
menuBar = new QMenuBar(testdllClass);
|
||||
menuBar->setObjectName(QStringLiteral("menuBar"));
|
||||
menuBar->setGeometry(QRect(0, 0, 600, 23));
|
||||
testdllClass->setMenuBar(menuBar);
|
||||
mainToolBar = new QToolBar(testdllClass);
|
||||
mainToolBar->setObjectName(QStringLiteral("mainToolBar"));
|
||||
testdllClass->addToolBar(Qt::TopToolBarArea, mainToolBar);
|
||||
statusBar = new QStatusBar(testdllClass);
|
||||
statusBar->setObjectName(QStringLiteral("statusBar"));
|
||||
testdllClass->setStatusBar(statusBar);
|
||||
|
||||
retranslateUi(testdllClass);
|
||||
|
||||
QMetaObject::connectSlotsByName(testdllClass);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *testdllClass)
|
||||
{
|
||||
testdllClass->setWindowTitle(QApplication::translate("testdllClass", "testdll", Q_NULLPTR));
|
||||
label->setText(QApplication::translate("testdllClass", "\351\200\237\345\272\246", Q_NULLPTR));
|
||||
lineEdit->setText(QApplication::translate("testdllClass", "2000", Q_NULLPTR));
|
||||
startmotor->setText(QApplication::translate("testdllClass", "\346\255\243\350\275\254", Q_NULLPTR));
|
||||
pushButton->setText(QApplication::translate("testdllClass", "\345\217\215\350\275\254", Q_NULLPTR));
|
||||
pushButton_3->setText(QApplication::translate("testdllClass", "\346\237\245\350\257\242\347\212\266\346\200\201", Q_NULLPTR));
|
||||
pushButton_2->setText(QApplication::translate("testdllClass", "\345\201\234\346\255\242", Q_NULLPTR));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class testdllClass: public Ui_testdllClass {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_TESTDLL_H
|
10
testdll/main.cpp
Normal file
10
testdll/main.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "testdll.h"
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
testdll w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
79
testdll/testdll.cpp
Normal file
79
testdll/testdll.cpp
Normal file
@ -0,0 +1,79 @@
|
||||
#include "testdll.h"
|
||||
#include "QThread"
|
||||
|
||||
testdll::testdll(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
motor = new VinceControl(NETTCP, 6000);
|
||||
connect(ui.startmotor, &QPushButton::clicked, this, &testdll::onbeginstart);
|
||||
connect(ui.pushButton, &QPushButton::clicked, this, &testdll::onfanzhuan);
|
||||
connect(ui.pushButton_2, &QPushButton::clicked, this, &testdll::onstop);
|
||||
connect(ui.pushButton_3, &QPushButton::clicked, this, &testdll::oninfomotor);
|
||||
connect(motor, &VinceControl::SendLogToCallClass, this, &testdll::onlogcom);
|
||||
timer = new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()), this, SLOT(oninfomotor()));
|
||||
timer->start(2000);
|
||||
|
||||
|
||||
}
|
||||
|
||||
testdll::~testdll()
|
||||
{
|
||||
motor->StopMotormove();
|
||||
delete motor;
|
||||
|
||||
}
|
||||
|
||||
void testdll::onbeginstart()
|
||||
{
|
||||
//motor->Handshacke();
|
||||
motor->EnableMotro();
|
||||
|
||||
//motor->StopMotormove();
|
||||
long aa = ui.lineEdit->text().toLong();
|
||||
motor->StopMotormove();
|
||||
motor->SettingSpeed(aa);
|
||||
motor->MoveMotar(true);
|
||||
//fangxiang = !fangxiang;
|
||||
//QThread::sleep(5);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void testdll::onfanzhuan()
|
||||
{
|
||||
|
||||
// motor->StopMotormove();
|
||||
long aa = ui.lineEdit->text().toLong();
|
||||
motor->StopMotormove();
|
||||
motor->SettingSpeed(aa);
|
||||
motor->MoveMotar(false);
|
||||
motor->SendCommandtoMotor("cfg\n");
|
||||
//fangxiang = !fangxiang;
|
||||
//QThread::sleep(5);
|
||||
}
|
||||
|
||||
void testdll::onstop()
|
||||
{
|
||||
//motor->StopMotormove();
|
||||
//motor->SendCommandtoMotor("cfg\n");
|
||||
motor->SettingZeroLocation();
|
||||
}
|
||||
|
||||
void testdll::onlogcom(QString str)
|
||||
{
|
||||
ui.textEdit->append(str);
|
||||
//motor->SendCommandtoMotor("cfg\n");
|
||||
}
|
||||
|
||||
void testdll::oninfomotor()
|
||||
{
|
||||
if (motor->IsMotorInit)
|
||||
{
|
||||
motor->GetState();
|
||||
}
|
||||
|
||||
}
|
28
testdll/testdll.h
Normal file
28
testdll/testdll.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef TESTDLL_H
|
||||
#define TESTDLL_H
|
||||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include "ui_testdll.h"
|
||||
#include "vincecontrol.h"
|
||||
#include "QTimer"
|
||||
class testdll : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
testdll(QWidget *parent = 0);
|
||||
~testdll();
|
||||
|
||||
private:
|
||||
Ui::testdllClass ui;
|
||||
VinceControl *motor;
|
||||
QTimer *timer;
|
||||
public slots :
|
||||
void onbeginstart();
|
||||
void onfanzhuan();
|
||||
void onstop();
|
||||
void onlogcom(QString str);
|
||||
void oninfomotor();
|
||||
};
|
||||
|
||||
#endif // TESTDLL_H
|
4
testdll/testdll.qrc
Normal file
4
testdll/testdll.qrc
Normal file
@ -0,0 +1,4 @@
|
||||
<RCC>
|
||||
<qresource prefix="testdll">
|
||||
</qresource>
|
||||
</RCC>
|
111
testdll/testdll.ui
Normal file
111
testdll/testdll.ui
Normal file
@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>testdllClass</class>
|
||||
<widget class="QMainWindow" name="testdllClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>testdll</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>速度</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="text">
|
||||
<string>2000</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>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="startmotor">
|
||||
<property name="text">
|
||||
<string>正转</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>反转</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="text">
|
||||
<string>查询状态</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>停止</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</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="testdll.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
232
testdll/testdll.vcxproj
Normal file
232
testdll/testdll.vcxproj
Normal file
@ -0,0 +1,232 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{FE2F26F1-B5DA-4B8A-BA06-9B4E489DEDF1}</ProjectGuid>
|
||||
<Keyword>Qt4VSv1.0</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtSerialPort;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5Networkd.lib;Qt5SerialPortd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_DLL;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtSerialPort;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\x64\Debug;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>vincecontrol.lib;qtmaind.lib;Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5Networkd.lib;Qt5SerialPortd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtSerialPort;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat />
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5SerialPort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>UNICODE;WIN32;WIN64;QT_DLL;QT_NO_DEBUG;NDEBUG;QT_CORE_LIB;QT_GUI_LIB;QT_WIDGETS_LIB;QT_NETWORK_LIB;QT_SERIALPORT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtSerialPort;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DebugInformationFormat />
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OutputFile>$(OutDir)\$(ProjectName).exe</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<AdditionalDependencies>qtmain.lib;Qt5Core.lib;Qt5Gui.lib;Qt5Widgets.lib;Qt5Network.lib;Qt5SerialPort.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GeneratedFiles\Debug\moc_testdll.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\qrc_testdll.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Release\moc_testdll.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="testdll.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="testdll.h">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing testdll.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_SERIALPORT_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtSerialPort"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Moc%27ing testdll.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_SERIALPORT_LIB "-I.\.." "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtSerialPort"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing testdll.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_SERIALPORT_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtSerialPort"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Moc%27ing testdll.h...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUNICODE -DWIN32 -DWIN64 -DQT_DLL -DQT_NO_DEBUG -DNDEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_SERIALPORT_LIB "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(QTDIR)\include\QtNetwork" "-I$(QTDIR)\include\QtSerialPort"</Command>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="testdll.ui">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Uic%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\ui_%(Filename).h;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\uic.exe" -o ".\GeneratedFiles\ui_%(Filename).h" "%(FullPath)"</Command>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GeneratedFiles\ui_testdll.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="testdll.qrc">
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(FullPath);%(AdditionalInputs)</AdditionalInputs>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Rcc%27ing %(Identity)...</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\qrc_%(Filename).cpp;%(Outputs)</Outputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o .\GeneratedFiles\qrc_%(Filename).cpp</Command>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties MocDir=".\GeneratedFiles\$(ConfigurationName)" UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" lupdateOptions="" lupdateOnBuild="0" lreleaseOptions="" Qt5Version_x0020_x64="qt5.8" MocOptions="" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
70
testdll/testdll.vcxproj.filters
Normal file
70
testdll/testdll.vcxproj.filters
Normal file
@ -0,0 +1,70 @@
|
||||
<?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;cxx;c;def</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h</Extensions>
|
||||
</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>
|
||||
<Filter Include="Generated Files\Debug">
|
||||
<UniqueIdentifier>{6e1893f8-0829-4202-b060-6dfe5c596c3a}</UniqueIdentifier>
|
||||
<Extensions>cpp;moc</Extensions>
|
||||
<SourceControlFiles>False</SourceControlFiles>
|
||||
</Filter>
|
||||
<Filter Include="Generated Files\Release">
|
||||
<UniqueIdentifier>{09cc2671-132c-4254-beab-562321593421}</UniqueIdentifier>
|
||||
<Extensions>cpp;moc</Extensions>
|
||||
<SourceControlFiles>False</SourceControlFiles>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="testdll.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Debug\moc_testdll.cpp">
|
||||
<Filter>Generated Files\Debug</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\Release\moc_testdll.cpp">
|
||||
<Filter>Generated Files\Release</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GeneratedFiles\qrc_testdll.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CustomBuild Include="testdll.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="testdll.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="testdll.qrc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GeneratedFiles\ui_testdll.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
12
testdll/testdll.vcxproj.user
Normal file
12
testdll/testdll.vcxproj.user
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QTDIR>C:\Qt\Qt5.8.0\5.8\msvc2013_64</QTDIR>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QTDIR>C:\Qt\Qt5.8.0\5.8\msvc2013_64</QTDIR>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
</Project>
|
BIN
testdll/x64/Debug/main.obj
Normal file
BIN
testdll/x64/Debug/main.obj
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/moc_testdll.obj
Normal file
BIN
testdll/x64/Debug/moc_testdll.obj
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/qrc_testdll.obj
Normal file
BIN
testdll/x64/Debug/qrc_testdll.obj
Normal file
Binary file not shown.
13
testdll/x64/Debug/testdll.log
Normal file
13
testdll/x64/Debug/testdll.log
Normal file
@ -0,0 +1,13 @@
|
||||
生成启动时间为 2020/9/3 14:49:21。
|
||||
1>项目“D:\vspro\ProjectofIrisIMAGE\vincecontrol\vincecontrol\testdll\testdll.vcxproj”在节点 2 上(Build 个目标)。
|
||||
1>Link:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"D:\vspro\ProjectofIrisIMAGE\vincecontrol\x64\Debug\\testdll.exe" /NOLOGO /LIBPATH:..\..\x64\Debug /LIBPATH:C:\Qt\Qt5.8.0\5.8\msvc2013_64\lib vincecontrol.lib qtmaind.lib Qt5Cored.lib Qt5Guid.lib Qt5Widgetsd.lib Qt5Networkd.lib Qt5SerialPortd.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"D:\vspro\ProjectofIrisIMAGE\vincecontrol\x64\Debug\testdll.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:\vspro\ProjectofIrisIMAGE\vincecontrol\x64\Debug\testdll.lib" /MACHINE:X64 x64\Debug\moc_testdll.obj
|
||||
x64\Debug\qrc_testdll.obj
|
||||
x64\Debug\main.obj
|
||||
x64\Debug\testdll.obj
|
||||
testdll.vcxproj -> D:\vspro\ProjectofIrisIMAGE\vincecontrol\x64\Debug\testdll.exe
|
||||
1>已完成生成项目“D:\vspro\ProjectofIrisIMAGE\vincecontrol\vincecontrol\testdll\testdll.vcxproj”(Build 个目标)的操作。
|
||||
|
||||
生成成功。
|
||||
|
||||
已用时间 00:00:00.73
|
BIN
testdll/x64/Debug/testdll.obj
Normal file
BIN
testdll/x64/Debug/testdll.obj
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/CL.read.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/CL.read.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/CL.write.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/CL.write.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/cl.command.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/cl.command.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/custombuild.command.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/custombuild.command.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/custombuild.read.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/custombuild.read.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/custombuild.write.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/custombuild.write.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/link.command.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/link.command.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/link.read.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/link.read.1.tlog
Normal file
Binary file not shown.
BIN
testdll/x64/Debug/testdll.tlog/link.write.1.tlog
Normal file
BIN
testdll/x64/Debug/testdll.tlog/link.write.1.tlog
Normal file
Binary file not shown.
2
testdll/x64/Debug/testdll.tlog/testdll.lastbuildstate
Normal file
2
testdll/x64/Debug/testdll.tlog/testdll.lastbuildstate
Normal file
@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
|
||||
Debug|x64|D:\vspro\ProjectofIrisIMAGE\vincecontrol\|
|
BIN
testdll/x64/Debug/vc120.pdb
Normal file
BIN
testdll/x64/Debug/vc120.pdb
Normal file
Binary file not shown.
@ -80,7 +80,7 @@ void VinceControl::Handshacke(QString motorid)
|
||||
str.append(buf);
|
||||
SendLog(str);
|
||||
}
|
||||
|
||||
initMotor(motorid);
|
||||
}
|
||||
|
||||
void VinceControl::SetRS485ID(QString id)
|
||||
@ -375,26 +375,89 @@ void VinceControl::initme()
|
||||
|
||||
}
|
||||
|
||||
void VinceControl::initMotor(QString motornetid /*= "non"*/)
|
||||
{
|
||||
QByteArray buf;
|
||||
//<2F><><EFBFBD><EFBFBD>s1<73>½<EFBFBD>ʱֹͣ<CDA3><D6B9>ת
|
||||
QString commonstr = "cfg s1f=2\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
|
||||
commonstr = "cfg zmd=1\n";//<2F><><EFBFBD>㳢<EFBFBD>Դ<EFBFBD><D4B4><EFBFBD>
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
commonstr = "cfg snr=0\n";//<2F><><EFBFBD>㴫<EFBFBD><E3B4AB><EFBFBD><EFBFBD>
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
commonstr = "cfg osv=0\n";//<2F><><EFBFBD>㴫<EFBFBD><E3B4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>ƿΪ<C6BF>͵<EFBFBD>ƽ
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
commonstr = "cfg zsd=3000\n";//<2F><><EFBFBD>㴫<EFBFBD><E3B4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>ƿΪ<C6BF>͵<EFBFBD>ƽ
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
//<2F><><EFBFBD>ø<EFBFBD><C3B8><EFBFBD><EFBFBD><EFBFBD><DEB4><EFBFBD><EFBFBD><EFBFBD>
|
||||
commonstr = "cfg msr=1\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
//<2F><><EFBFBD>ü<EFBFBD><C3BC><EFBFBD><DEB4><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>͵<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>
|
||||
commonstr = "cfg msv=0\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD>s2<73>½<EFBFBD>ʱֹͣ<CDA3><D6B9>ת
|
||||
commonstr = "cfg s2f=2\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB4><EFBFBD><EFBFBD><EFBFBD>
|
||||
commonstr = "cfg psr=2\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB4><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>͵<EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD>
|
||||
commonstr = "cfg psv=0\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
|
||||
}
|
||||
|
||||
void VinceControl::MovetoZero(QString motornetid )
|
||||
{
|
||||
MoveToLocation(0, motornetid);
|
||||
|
||||
}
|
||||
|
||||
long VinceControl::GetLocationNow()
|
||||
{
|
||||
return 10000;
|
||||
}
|
||||
|
||||
void VinceControl::MoveToLocation(long Location)
|
||||
long VinceControl::GetLocationNow(QString motornetid)
|
||||
{
|
||||
ByteBack back = GetState(motornetid);
|
||||
return back.Location;
|
||||
|
||||
}
|
||||
|
||||
void VinceControl::SettingUpandDownSpeed(int addspeed, int downspeed)
|
||||
void VinceControl::MoveToLocation(long Location, QString motornetid)
|
||||
{
|
||||
QString commonstr = "pos "+QString::number(Location)+"\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
QByteArray buf;
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
TranslateBytedata(buf, motornetid);
|
||||
|
||||
}
|
||||
|
||||
void VinceControl::SettingUpandDownSpeed(int addspeed, int downspeed, QString motornetid)
|
||||
{
|
||||
//<2F><><EFBFBD>ü<EFBFBD><C3BC>ٶ<EFBFBD>
|
||||
QString commonstr = "cfg acc=" + QString::number(addspeed) + "\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
QByteArray buf;
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
TranslateBytedata(buf, motornetid);
|
||||
//<2F><><EFBFBD>ü<EFBFBD><C3BC>ٶ<EFBFBD>
|
||||
commonstr = "cfg dec=" + QString::number(addspeed) + "\n";
|
||||
SendCommandtoMotor(commonstr, motornetid);
|
||||
GetCommonRetrun(buf, motornetid);
|
||||
TranslateBytedata(buf, motornetid);
|
||||
}
|
||||
|
||||
void VinceControl::StopMotormove(QString motornetid )
|
||||
{
|
||||
QString commonstr = "stp\n";
|
||||
@ -405,6 +468,8 @@ void VinceControl::StopMotormove(QString motornetid )
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ByteBack VinceControl::GetState(QString motorid /*= "non"*/)
|
||||
{
|
||||
QString commonstr = "cts\n";
|
||||
@ -415,6 +480,16 @@ ByteBack VinceControl::GetState(QString motorid /*= "non"*/)
|
||||
return back;
|
||||
}
|
||||
|
||||
void VinceControl::SettingZeroLocation(QString motorid /*= "non"*/)
|
||||
{
|
||||
QString commonstr = "zero start\n";
|
||||
SendCommandtoMotor(commonstr, motorid);
|
||||
//
|
||||
QByteArray buf;
|
||||
GetCommonRetrun(buf, motorid);
|
||||
|
||||
}
|
||||
|
||||
VinceControl::VinceControl(ProTools proto, int port)
|
||||
{
|
||||
//VinceControl(proto);
|
||||
|
103
vincecontrol.h
103
vincecontrol.h
@ -68,10 +68,13 @@ struct ByteBack
|
||||
/********************************************************************
|
||||
* 描述:马达控制程序
|
||||
* 使用步骤
|
||||
* 1)初始话 需要告诉通讯协议(Vince规定的):
|
||||
* 2)如果是485 请设置id 默认为0
|
||||
* 3) serialconnect 建立链接
|
||||
* 4)使用
|
||||
* 1 初始化 需要告诉通讯协议(Vince规定的) 如:motor = new VinceControl(NETTCP, 6000);
|
||||
* 2 通过 motor->IsMotorInit 来判断是否右马达接入
|
||||
* 建议:
|
||||
* 1) 可以用SettingZeroLocation()结合传感器的是指来设置零为
|
||||
* 2)关于传感器的设置均在initmotor()函数里
|
||||
* 注意:
|
||||
* 类中所有默认参数再不设置的情况下均指网络通讯的第一个设备id
|
||||
* 2020-8-5:立新
|
||||
*******************************************************************/
|
||||
class VINCECONTROL_EXPORT VinceControl:public QObject
|
||||
@ -88,6 +91,7 @@ public:
|
||||
// Parameter: ProTools 通讯协议 RS485 或者 RS232
|
||||
//************************************
|
||||
VinceControl(ProTools proto);
|
||||
|
||||
//************************************
|
||||
// Method: VinceControl //走网络协议 需要两个参数 第一个为NETTCP 第二个为端口 6000或者6001
|
||||
// FullName: VinceControl::VinceControl
|
||||
@ -100,16 +104,15 @@ public:
|
||||
VinceControl(ProTools proto,int port);
|
||||
~VinceControl();
|
||||
//************************************
|
||||
// Method: serialconnect
|
||||
// FullName: VinceControl::serialconnect
|
||||
// Method: MoveToLocation 移动到某位置(据0点)
|
||||
// FullName: VinceControl::MoveToLocation
|
||||
// Access: public
|
||||
// Returns: bool
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: QString comname 串口名称
|
||||
// Parameter: QString bandrate 串口波特率
|
||||
// Parameter: long Location 距离零点的位置
|
||||
//************************************
|
||||
void MoveToLocation(long Location, QString motornetid = "non");
|
||||
|
||||
bool serialconnect(QString comname,QString bandrate);
|
||||
//************************************
|
||||
// Method: Handshacke
|
||||
// FullName: VinceControl::Handshacke
|
||||
@ -117,18 +120,18 @@ public:
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
//************************************
|
||||
|
||||
|
||||
void Handshacke(QString motorid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: SetRS485ID
|
||||
// FullName: VinceControl::SetRS485ID
|
||||
// Method: SettingZeroLocation 马达归零
|
||||
// FullName: VinceControl::SettingZeroLocation
|
||||
// Access: public
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: QString id RS485 id
|
||||
// Parameter: QString motorid
|
||||
//************************************
|
||||
void SetRS485ID(QString id);
|
||||
void SettingZeroLocation(QString motorid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: 电机使能
|
||||
// FullName: VinceControl::EnableMotro
|
||||
@ -165,6 +168,7 @@ public:
|
||||
// Parameter: int motorid
|
||||
//************************************
|
||||
void SendCommandtoMotor(QString str,QString modor);
|
||||
|
||||
//************************************
|
||||
// Method: MoveSetDistance 电机左移/右移 一定数量(不是距离)
|
||||
// FullName: VinceControl::MoveSetDistance
|
||||
@ -173,8 +177,8 @@ public:
|
||||
// Qualifier:
|
||||
// Parameter: long distance
|
||||
//************************************
|
||||
|
||||
void MoveSetDistance(long distance, QString motornetid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: MoveModar 电机左移/右移 direction是方向
|
||||
// FullName: VinceControl::MoveModar
|
||||
@ -184,6 +188,7 @@ public:
|
||||
// Parameter: bool direction 方向
|
||||
//************************************
|
||||
void MoveMotar(bool direction, QString motornetid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: SettingSpeed 设置速度
|
||||
// FullName: VinceControl::SettingSpeed
|
||||
@ -202,6 +207,7 @@ public:
|
||||
// Qualifier:
|
||||
//************************************
|
||||
void MovetoZero(QString motornetid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: GetLocationNow 获取当前至0点位置
|
||||
// FullName: VinceControl::GetLocationNow
|
||||
@ -209,16 +215,8 @@ public:
|
||||
// Returns: long 位置
|
||||
// Qualifier:
|
||||
//************************************
|
||||
long GetLocationNow();
|
||||
//************************************
|
||||
// Method: MoveToLocation 移动到某位置(据0点)
|
||||
// FullName: VinceControl::MoveToLocation
|
||||
// Access: public
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: long Location 距离零点的位置
|
||||
//************************************
|
||||
void MoveToLocation(long Location);
|
||||
long GetLocationNow(QString motornetid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: SettingUpandDownSpeed 设置加减速度
|
||||
// FullName: VinceControl::SettingUpandDownSpeed
|
||||
@ -228,10 +226,58 @@ public:
|
||||
// Parameter: int addspeed 加速度
|
||||
// Parameter: int downspeed 减速度
|
||||
//************************************
|
||||
void SettingUpandDownSpeed(int addspeed, int downspeed);
|
||||
void SettingUpandDownSpeed(int addspeed, int downspeed, QString motornetid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: StopMotormove 停止马达
|
||||
// FullName: VinceControl::StopMotormove
|
||||
// Access: public
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: QString motornetid
|
||||
//************************************
|
||||
void StopMotormove(QString motornetid = "non");
|
||||
|
||||
|
||||
//************************************
|
||||
// Method: GetState
|
||||
// FullName: VinceControl::GetState
|
||||
// Access: public
|
||||
// Returns: ByteBack
|
||||
// Qualifier:
|
||||
// Parameter: QString motorid
|
||||
//************************************
|
||||
ByteBack GetState(QString motorid = "non");
|
||||
|
||||
//************************************
|
||||
// Method: SetRS485ID
|
||||
// FullName: VinceControl::SetRS485ID
|
||||
// Access: public
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: QString id RS485 id
|
||||
//************************************
|
||||
void SetRS485ID(QString id);
|
||||
|
||||
//************************************
|
||||
// Method: serialconnect
|
||||
// FullName: VinceControl::serialconnect
|
||||
// Access: public
|
||||
// Returns: bool
|
||||
// Qualifier:
|
||||
// Parameter: QString comname 串口名称
|
||||
// Parameter: QString bandrate 串口波特率
|
||||
//************************************
|
||||
bool serialconnect(QString comname, QString bandrate);
|
||||
//************************************
|
||||
// Method: initMotor 设置左右极限 s1是为左极限 且到s1后会将s1位置设置为0 s2是右极限 归零传感器是指为s1
|
||||
// FullName: VinceControl::initMotor
|
||||
// Access: public
|
||||
// Returns: void
|
||||
// Qualifier:
|
||||
// Parameter: QString motornetid
|
||||
//************************************
|
||||
void initMotor(QString motornetid = "non");
|
||||
QStringList Motorlist;
|
||||
bool IsMotorInit;
|
||||
signals:
|
||||
@ -260,6 +306,7 @@ private:
|
||||
ByteBack TranslateBytedata(QByteArray buf, QString motornetid = "non");
|
||||
void initme();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // VINCECONTROL_H
|
||||
|
@ -3,10 +3,10 @@
|
||||
<PropertyGroup />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QTDIR>C:\Qt\Qt5.8.0\5.8\msvc2013_64</QTDIR>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QTDIR>C:\Qt\Qt5.8.0\5.8\msvc2013_64</QTDIR>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b"$(QTDIR)\bin%3b$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Reference in New Issue
Block a user