修正使用代理之后UDP无法连接问题
This commit is contained in:
@@ -51,6 +51,7 @@ MenuBarUI::MenuBarUI(QWidget *parent) :
|
||||
|
||||
|
||||
ui->label_Status->hide();
|
||||
ui->pushButton_SelfTest->hide();
|
||||
|
||||
|
||||
//setArm(true);
|
||||
|
||||
+48
-38
@@ -890,10 +890,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||
|
||||
void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
|
||||
Q_UNUSED(event)
|
||||
|
||||
|
||||
menuBarUI->setGeometry(0,0,this->width(),100);
|
||||
|
||||
//qDebug() << "resize";
|
||||
@@ -910,16 +908,25 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
|
||||
if(MainIndex == 2)//renwu
|
||||
{
|
||||
/*
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
*/
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width(),this->height() - menuBarUI->height());
|
||||
}
|
||||
|
||||
|
||||
if(statusui->isHidden())
|
||||
{
|
||||
/*
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
*/
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
}
|
||||
|
||||
//if(MainIndex == 5)//renwu
|
||||
{
|
||||
if(statusui->isHidden())
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
}
|
||||
|
||||
|
||||
copk->setGeometry(this->width() - copk->width(),menuBarUI->height(),
|
||||
@@ -934,10 +941,10 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
statusui->width(),//copk->width() * 1.0,
|
||||
this->height() - menuBarUI->height());
|
||||
|
||||
|
||||
/*
|
||||
missionUI->setGeometry(this->width() - copk->width(),menuBarUI->height(),
|
||||
copk->width(),this->height() - menuBarUI->height());
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if(!healthui->isHidden())
|
||||
@@ -1151,7 +1158,8 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
|
||||
{
|
||||
map->setWPLock(false);
|
||||
map->setWPCreate(true);
|
||||
missionUI->show();
|
||||
//missionUI->show();
|
||||
missionUI->hide();
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1548,6 +1556,35 @@ void MainWindow::updateVehicle(MavLinkNode::_vehicle vehicle)//事件驱动式
|
||||
copk->setPitchTarget(vehicle.nav_controller_output.nav_pitch);//
|
||||
copk->setYawTarget(vehicle.nav_controller_output.nav_bearing);//
|
||||
|
||||
|
||||
|
||||
copk->setAirSpeed(vehicle.vfr_hud.airspeed,5);//真空速
|
||||
copk->setAirSpeedTarget(vehicle.vfr_hud.airspeed
|
||||
+vehicle.nav_controller_output.aspd_error,5);
|
||||
|
||||
|
||||
//c t g m
|
||||
switch (copk->AirSpeedFlag()) {
|
||||
default:
|
||||
case 0:
|
||||
copk->setSpeed(vehicle.vfr_hud.airspeed,copk->AirSpeedFlag());//表速
|
||||
break;
|
||||
case 1:
|
||||
//copk->setSpeed(info.vt,copk->AirSpeedFlag());//真空速
|
||||
break;
|
||||
case 2:
|
||||
copk->setSpeed(vehicle.vfr_hud.groundspeed,copk->AirSpeedFlag());//地速
|
||||
break;
|
||||
case 3:
|
||||
//copk->setSpeed(info.mi,copk->AirSpeedFlag());//马赫
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
//copk->setAOA(info.aoat1);
|
||||
|
||||
|
||||
|
||||
QString gps_str;
|
||||
gps_str.clear();
|
||||
|
||||
@@ -2435,34 +2472,7 @@ void MainWindow::EADC_Info(Parse::_eadc info)
|
||||
}
|
||||
|
||||
|
||||
if(copk)
|
||||
{
|
||||
|
||||
copk->setAirSpeed(info.vt,5);//真空速
|
||||
copk->setAirSpeedTarget(info.vt
|
||||
+0,5);
|
||||
|
||||
|
||||
//c t g m
|
||||
switch (copk->AirSpeedFlag()) {
|
||||
default:
|
||||
case 0:
|
||||
copk->setSpeed(info.vi,copk->AirSpeedFlag());//表速
|
||||
break;
|
||||
case 1:
|
||||
copk->setSpeed(info.vt,copk->AirSpeedFlag());//真空速
|
||||
break;
|
||||
case 2:
|
||||
copk->setSpeed(0,copk->AirSpeedFlag());//地速
|
||||
break;
|
||||
case 3:
|
||||
copk->setSpeed(info.mi,copk->AirSpeedFlag());//马赫
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
copk->setAOA(info.aoat1);
|
||||
}
|
||||
|
||||
|
||||
if(healthui)
|
||||
|
||||
+6
-4
@@ -571,11 +571,13 @@ bool DLink::setupClient(const QHostAddress &local_addr,int local_port,const QHos
|
||||
}
|
||||
|
||||
QUdpSocket *clientsock = new QUdpSocket(this);
|
||||
int rst = clientsock->bind(QHostAddress::AnyIPv4,local_port,QAbstractSocket::ShareAddress);
|
||||
|
||||
//int rst = clientsock->bind(QHostAddress::AnyIPv4,local_port,QAbstractSocket::ShareAddress);
|
||||
int rst = clientsock->open(QIODevice::ReadWrite);
|
||||
if(rst)
|
||||
{
|
||||
if(clientsock->open(QIODevice::ReadWrite))
|
||||
clientsock->setProxy(QNetworkProxy::NoProxy);
|
||||
|
||||
if(clientsock->bind(local_addr,local_port,QAbstractSocket::ShareAddress))
|
||||
{
|
||||
connect(clientsock, SIGNAL(readyRead()),
|
||||
this, SLOT(readPendingDatagramsClient()));
|
||||
@@ -599,7 +601,7 @@ bool DLink::setupClient(const QHostAddress &local_addr,int local_port,const QHos
|
||||
{
|
||||
clientsock->close();
|
||||
isSuccess = false;
|
||||
qWarning() << "sock not open";
|
||||
qWarning() << "sock open failure" << clientsock->state();
|
||||
delete clientsock;
|
||||
clientsock = nullptr;
|
||||
}
|
||||
|
||||
@@ -117,8 +117,9 @@ QByteArray OPMaps::GetImageFrom(const MapType::Types &type, const Point &pos, co
|
||||
qDebug() << "opmaps before make image url" << time.elapsed();
|
||||
#endif
|
||||
QString url = MakeImageUrl(type, pos, zoom, LanguageStr);
|
||||
qDebug() << "url" << url << type << zoom;
|
||||
|
||||
#ifdef DEBUG_TIMINGS
|
||||
qDebug() << "url" << url << type << zoom;
|
||||
qDebug() << "opmaps after make image url" << time.elapsed();
|
||||
#endif // url "http://vec02.maps.yandex.ru/tiles?l=map&v=2.10.2&x=7&y=5&z=3" string
|
||||
// "http://map3.pergo.com.tr/tile/02/000/000/007/000/000/002.png"
|
||||
|
||||
@@ -45,7 +45,7 @@ UrlFactory::UrlFactory()
|
||||
Proxy.setType (QNetworkProxy::HttpProxy);
|
||||
Proxy.setHostName ("127.0.0.1");
|
||||
Proxy.setPort (33210);
|
||||
QNetworkProxy::setApplicationProxy (Proxy);
|
||||
//QNetworkProxy::setApplicationProxy (Proxy);
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user