|
@@ -642,6 +642,13 @@ void MainWindow::CreateTab1View(QTabWidget * p)
|
|
|
pPB->setGeometry(nXPos,nYPos,mnFontHeight*10,nLEHeight);
|
|
|
connect(pPB,SIGNAL(clicked(bool)),this,SLOT(onClickSetMove()));
|
|
|
|
|
|
+ nXPos = 30 + mnFontHeight*10;
|
|
|
+
|
|
|
+ pPB = new QPushButton(pGroup);
|
|
|
+ pPB->setText("Reset Move");
|
|
|
+ pPB->setGeometry(nXPos,nYPos,mnFontHeight*10,nLEHeight);
|
|
|
+ connect(pPB,SIGNAL(clicked(bool)),this,SLOT(onClickReSetMove()));
|
|
|
+
|
|
|
|
|
|
|
|
|
nXPos = 10;
|
|
@@ -1279,8 +1286,8 @@ void MainWindow::onClickDefView()
|
|
|
mnMoveY = mnDefMoveY;
|
|
|
|
|
|
mpSlider_Scale->setValue(mnfac);
|
|
|
- mpSlider_MoveX->setValue(mnMoveX*100/VIEW_WIDTH);
|
|
|
- mpSlider_MoveY->setValue(mnMoveY*100/VIEW_HEIGHT);
|
|
|
+// mpSlider_MoveX->setValue(mnMoveX*100/VIEW_WIDTH);
|
|
|
+// mpSlider_MoveY->setValue(mnMoveY*100/VIEW_HEIGHT);
|
|
|
// mbRefresh = true;
|
|
|
update();
|
|
|
}
|
|
@@ -2648,6 +2655,13 @@ int MainWindow::CreateJunctionID()
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+static bool IsNaN(double dat)
|
|
|
+{
|
|
|
+ qint64 & ref=*(qint64 *)&dat;
|
|
|
+ return (ref&0x7FF0000000000000) == 0x7FF0000000000000 && (ref&0xfffffffffffff)!=0;
|
|
|
+}
|
|
|
+
|
|
|
void MainWindow::onClickLoad()
|
|
|
{
|
|
|
QString str = QFileDialog::getOpenFileName(this,"Load XODR",".","*.xodr");
|
|
@@ -2661,6 +2675,20 @@ void MainWindow::onClickLoad()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ int nroadnum = pxodr->GetRoadCount();
|
|
|
+ int i;
|
|
|
+ for(i=0;i<nroadnum;i++)
|
|
|
+ {
|
|
|
+ Road * pRoad = pxodr->GetRoad(i);
|
|
|
+ if(IsNaN(pRoad->GetRoadLength()))
|
|
|
+ {
|
|
|
+ pxodr->DeleteRoad(i);
|
|
|
+ i--;
|
|
|
+ nroadnum--;
|
|
|
+ qDebug("delete road %s because length is NaN",pRoad->GetRoadId().data());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
bool bNeedMove = false;
|
|
@@ -2717,7 +2745,7 @@ void MainWindow::onClickLoad()
|
|
|
int noldjunctioncount = mxodr.GetJunctionCount();
|
|
|
int nnewcount = pxodr->GetRoadCount();
|
|
|
int nnewjunctioncount = pxodr->GetJunctionCount();
|
|
|
- int i;
|
|
|
+// int i;
|
|
|
|
|
|
if(bNeedAjustID)
|
|
|
{
|
|
@@ -4967,3 +4995,34 @@ void MainWindow::onClickSetMove()
|
|
|
|
|
|
// updateView();
|
|
|
}
|
|
|
+
|
|
|
+void MainWindow::onClickReSetMove()
|
|
|
+{
|
|
|
+ mfViewMoveX = 0;
|
|
|
+ mfViewMoveY = 0;
|
|
|
+
|
|
|
+ mbRefresh = true;
|
|
|
+ update();
|
|
|
+
|
|
|
+ mpLEViewMoveX->setText(QString::number(mfViewMoveX,'f',2));
|
|
|
+ mpLEViewMoveY->setText(QString::number(mfViewMoveY,'f',2));
|
|
|
+}
|
|
|
+
|
|
|
+void MainWindow::on_actionSummary_Road_triggered()
|
|
|
+{
|
|
|
+ int nroadnum = mxodr.GetRoadCount();
|
|
|
+ int i;
|
|
|
+ double flen = 0;
|
|
|
+ for(i=0;i<nroadnum;i++)
|
|
|
+ {
|
|
|
+ if(fabs(mxodr.GetRoad(i)->GetRoadLength())>10000)
|
|
|
+ {
|
|
|
+ Road * pRoad = mxodr.GetRoad(i);
|
|
|
+ int a = 1;
|
|
|
+ }
|
|
|
+ flen = flen + mxodr.GetRoad(i)->GetRoadLength();
|
|
|
+ }
|
|
|
+ char strout[256];
|
|
|
+ snprintf(strout,256,"Road Count:%d Length Total:%f",nroadnum,flen);
|
|
|
+ QMessageBox::information(this,"Summary",QString(strout),QMessageBox::YesAll);
|
|
|
+}
|