|
@@ -39,9 +39,21 @@ DialogBigPic::DialogBigPic(QWidget *parent) :
|
|
|
mpPicViewRight = new IVPicView();
|
|
|
mpPicViewRight->start();
|
|
|
|
|
|
- mnLastPicTime = 0;
|
|
|
- mbDraw = false;
|
|
|
+// mnLastPicTime = 0;
|
|
|
+ int i;
|
|
|
+ for(i=0;i<3;i++)
|
|
|
+ {
|
|
|
+ mnLastPicTime[i] = 0;
|
|
|
+ mbDraw[i] = false;
|
|
|
+ }
|
|
|
+// mbDraw = false;
|
|
|
connect(mpPicView,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
|
|
|
+ connect(mpPicViewLeft,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
|
|
|
+ connect(mpPicViewRight,SIGNAL(painterupadate()),this,SLOT(onPainterUpdate()));
|
|
|
+
|
|
|
+ mpview->scale(0.8,0.8);
|
|
|
+ mpviewLeft->scale(0.4,0.4);
|
|
|
+ mpviewRight->scale(0.4,0.4);
|
|
|
|
|
|
QTimer * timer = new QTimer();
|
|
|
connect(timer,SIGNAL(timeout()),this,SLOT(onTimerPic()));
|
|
@@ -62,14 +74,55 @@ void DialogBigPic::onTimerPic()
|
|
|
|
|
|
bool bUpdate = false;
|
|
|
|
|
|
- int ncam = mnCamera;
|
|
|
- if((mnLastPicTime != gTimeRawPic[ncam])&&(gTimeRawPic[ncam]!= 0))
|
|
|
+// int ncam = mnCamera;
|
|
|
+// if((mnLastPicTime != gTimeRawPic[ncam])&&(gTimeRawPic[ncam]!= 0))
|
|
|
+// {
|
|
|
+// gMutexPic[ncam].lock();
|
|
|
+// mpPicView->SetPic(grawpic[ncam]);
|
|
|
+// gMutexPic[ncam].unlock();
|
|
|
+// bUpdate = true;
|
|
|
+// mbDraw = true;
|
|
|
+// }
|
|
|
+
|
|
|
+ int ncamcenter = 0;
|
|
|
+ int ncamleft = 2;
|
|
|
+ int ncamright = 3;
|
|
|
+ if(mbFront == false)
|
|
|
+ {
|
|
|
+ ncamcenter = 1;
|
|
|
+ ncamright = 2;
|
|
|
+ ncamleft = 3;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if((mnLastPicTime[0] != gTimeRawPic[ncamcenter])&&(gTimeRawPic[ncamcenter]!= 0))
|
|
|
+ {
|
|
|
+ gMutexPic[ncamcenter].lock();
|
|
|
+ mpPicView->SetPic(grawpic[ncamcenter]);
|
|
|
+ gMutexPic[ncamcenter].unlock();
|
|
|
+ bUpdate = true;
|
|
|
+ mnLastPicTime[0] = gTimeRawPic[ncamcenter];
|
|
|
+ // mbDraw[0] = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((mnLastPicTime[1] != gTimeRawPic[ncamleft])&&(gTimeRawPic[ncamleft]!= 0))
|
|
|
+ {
|
|
|
+ gMutexPic[ncamleft].lock();
|
|
|
+ mpPicViewLeft->SetPic(grawpic[ncamleft]);
|
|
|
+ gMutexPic[ncamleft].unlock();
|
|
|
+ bUpdate = true;
|
|
|
+ mnLastPicTime[1] = gTimeRawPic[ncamleft];
|
|
|
+// mbDraw[1] = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((mnLastPicTime[2] != gTimeRawPic[ncamright])&&(gTimeRawPic[ncamright]!= 0))
|
|
|
{
|
|
|
- gMutexPic[ncam].lock();
|
|
|
- mpPicView->SetPic(grawpic[ncam]);
|
|
|
- gMutexPic[ncam].unlock();
|
|
|
+ gMutexPic[ncamright].lock();
|
|
|
+ mpPicViewRight->SetPic(grawpic[ncamright]);
|
|
|
+ gMutexPic[ncamright].unlock();
|
|
|
bUpdate = true;
|
|
|
- mbDraw = true;
|
|
|
+ mnLastPicTime[2] = gTimeRawPic[ncamright];
|
|
|
+// mbDraw[2] = true;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -80,25 +133,52 @@ void DialogBigPic::onTimerPic()
|
|
|
void DialogBigPic::paintEvent(QPaintEvent *)
|
|
|
{
|
|
|
|
|
|
- if(mbDraw)
|
|
|
+ if(mbDraw[0])
|
|
|
{
|
|
|
QImage image = mpPicView->GetImage();
|
|
|
mscene->clear();
|
|
|
mscene->addPixmap(QPixmap::fromImage(image));
|
|
|
mpview->setScene(mscene);
|
|
|
mpview->show();
|
|
|
+ }
|
|
|
|
|
|
+ if(mbDraw[1])
|
|
|
+ {
|
|
|
+ QImage image = mpPicViewLeft->GetImage();
|
|
|
msceneLeft->clear();
|
|
|
msceneLeft->addPixmap(QPixmap::fromImage(image));
|
|
|
mpviewLeft->setScene(msceneLeft);
|
|
|
mpviewLeft->show();
|
|
|
+ }
|
|
|
|
|
|
+ if(mbDraw[2])
|
|
|
+ {
|
|
|
+ QImage image = mpPicViewRight->GetImage();
|
|
|
msceneRight->clear();
|
|
|
msceneRight->addPixmap(QPixmap::fromImage(image));
|
|
|
mpviewRight->setScene(msceneRight);
|
|
|
mpviewRight->show();
|
|
|
}
|
|
|
|
|
|
+// if(mbDraw)
|
|
|
+// {
|
|
|
+// QImage image = mpPicView->GetImage();
|
|
|
+// mscene->clear();
|
|
|
+// mscene->addPixmap(QPixmap::fromImage(image));
|
|
|
+// mpview->setScene(mscene);
|
|
|
+// mpview->show();
|
|
|
+
|
|
|
+// msceneLeft->clear();
|
|
|
+// msceneLeft->addPixmap(QPixmap::fromImage(image));
|
|
|
+// mpviewLeft->setScene(msceneLeft);
|
|
|
+// mpviewLeft->show();
|
|
|
+
|
|
|
+// msceneRight->clear();
|
|
|
+// msceneRight->addPixmap(QPixmap::fromImage(image));
|
|
|
+// mpviewRight->setScene(msceneRight);
|
|
|
+// mpviewRight->show();
|
|
|
+// }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
void DialogBigPic::resizeEvent(QResizeEvent *event)
|
|
@@ -121,6 +201,21 @@ void DialogBigPic::setRefresh(bool brefresh)
|
|
|
|
|
|
void DialogBigPic::onPainterUpdate()
|
|
|
{
|
|
|
+ if(sender() == mpPicView)
|
|
|
+ {
|
|
|
+// qDebug("front draw");
|
|
|
+ mbDraw[0] = true;
|
|
|
+ }
|
|
|
+ if(sender() == mpPicViewLeft)
|
|
|
+ {
|
|
|
+// qDebug("left draw");
|
|
|
+ mbDraw[1] = true;
|
|
|
+ }
|
|
|
+ if(sender() == mpPicViewRight)
|
|
|
+ {
|
|
|
+// qDebug("right draw");
|
|
|
+ mbDraw[2] = true;
|
|
|
+ }
|
|
|
update();
|
|
|
}
|
|
|
|
|
@@ -128,3 +223,13 @@ void DialogBigPic::setCamera(int n)
|
|
|
{
|
|
|
mnCamera = n;
|
|
|
}
|
|
|
+
|
|
|
+void DialogBigPic::SetFront()
|
|
|
+{
|
|
|
+ mbFront = true;
|
|
|
+}
|
|
|
+
|
|
|
+void DialogBigPic::SetRear()
|
|
|
+{
|
|
|
+ mbFront = false;
|
|
|
+}
|