25 lines
631 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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();
}