00001 #ifndef MAINWINDOW_C 00002 #define MAINWINDOW_C 00003 00004 #include "Robots/SeaBeeIII/GUI/MainWindow.qt.H" 00005 00006 MainWindow::MainWindow(OptionManager& mgr, 00007 const std::string& descrName, const std::string& tagName) : 00008 ModelComponent(mgr, descrName, tagName), 00009 itsIceCommunicator(new IceCommunicator(mgr)) 00010 { 00011 addSubComponent(itsIceCommunicator); 00012 00013 } 00014 00015 QGridLayout* MainWindow::constructImageDisplays() 00016 { 00017 QGridLayout * camLayout = new QGridLayout; 00018 00019 itsFwdLeftCamera = new CameraDisplay(this); 00020 itsFwdRightCamera = new CameraDisplay(this); 00021 itsDwnLeftCamera = new CameraDisplay(this); 00022 itsDwnRightCamera = new CameraDisplay(this); 00023 00024 camLayout->addWidget(itsFwdLeftCamera, 0, 0); 00025 camLayout->addWidget(itsFwdRightCamera, 0, 1); 00026 camLayout->addWidget(itsDwnLeftCamera, 1, 0); 00027 camLayout->addWidget(itsDwnRightCamera, 1, 1); 00028 00029 connect( itsIceCommunicator.get(), SIGNAL(NewFwdLeftImg(QImage)), itsFwdLeftCamera, SLOT(updateImage(QImage))); 00030 connect( itsIceCommunicator.get(), SIGNAL(NewFwdRightImg(QImage)), itsFwdRightCamera, SLOT(updateImage(QImage))); 00031 connect( itsIceCommunicator.get(), SIGNAL(NewDwnLeftImg(QImage)), itsDwnLeftCamera, SLOT(updateImage(QImage))); 00032 connect( itsIceCommunicator.get(), SIGNAL(NewDwnRightImg(QImage)), itsDwnRightCamera, SLOT(updateImage(QImage))); 00033 00034 return camLayout; 00035 00036 } 00037 00038 void MainWindow::initIce(Ice::CommunicatorPtr ic, Ice::ObjectAdapterPtr adapter) 00039 { 00040 itsIceCommunicator->init(ic, adapter); 00041 } 00042 00043 void MainWindow::start2() 00044 { 00045 QVBoxLayout * mainLayout = new QVBoxLayout; 00046 00047 QGridLayout * imageDisplayLayout = constructImageDisplays(); 00048 00049 mainLayout->addLayout(imageDisplayLayout); 00050 00051 //Perform some kind of Qt magic 00052 QWidget *centralWidget = new QWidget; 00053 setCentralWidget(centralWidget); 00054 00055 centralWidget->setLayout(mainLayout); 00056 00057 } 00058 00059 00060 #endif //MAINWINDOW_C 00061 00062