25 lines
631 B
C++
25 lines
631 B
C++
|
||
#include <iostream>
|
||
#include <QCoreApplication>
|
||
#include "BeltTearingPresenter.h"
|
||
|
||
int main(int argc, char *argv[])
|
||
{
|
||
QCoreApplication app(argc, argv);
|
||
|
||
// 创建并初始化Presenter
|
||
BeltTearingPresenter presenter;
|
||
|
||
// 启动TCP服务器,监听端口12345
|
||
if (!presenter.startServer(12345)) {
|
||
std::cout << "Failed to start server" << std::endl;
|
||
return -1;
|
||
}
|
||
|
||
// 开始发送模拟数据
|
||
presenter.startSendingSimulatedData();
|
||
|
||
std::cout << "BeltTearing Server started. Press Ctrl+C to exit." << std::endl;
|
||
|
||
return app.exec();
|
||
} |