Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

SIG_SimulationWindow.cpp

00001 #include "SIGEL_SlaveGUI/SIG_SimulationWindow.h"
00002 
00003 #include "SIGEL_SlaveGUI/SIG_SimulationWidget.h"
00004 #include "SIGEL_SlaveGUI/SIG_SimulationVisualisationWidget.h"
00005 
00006 #include <qstatusbar.h>
00007 
00008 namespace SIGEL_SlaveGUI
00009 {
00010 
00011   SIG_SimulationWindow::SIG_SimulationWindow( QWidget *parent,
00012                                               char const *name = 0,
00013                                               WFlags f = WType_TopLevel )
00014     : QMainWindow( parent,
00015                    name,
00016                    f )
00017   {
00018     this->setUsesTextLabel( false );
00019     this->setDockEnabled( Left, false );
00020     this->setDockEnabled( Right, false );
00021     this->setDockEnabled( Bottom, false );
00022 
00023     this->setUsesBigPixmaps( true );
00024 
00025     new QStatusBar( this );
00026 
00027     simulationWidget = new SIG_SimulationWidget(this, "simulationWidget");
00028     setCentralWidget( simulationWidget );
00029 
00030     simulationControlBar = new QToolBar( this, "simulationControlBar" );
00031 
00032     simulationControls = new SIG_SimulationControls(this, "simulationControls");
00033 
00034     simulationControls->addTo( simulationControlBar );
00035     this->addToolBar( simulationControlBar );
00036 
00037     QObject::connect( simulationControls->playAction,
00038                       SIGNAL(activated()),
00039                       simulationWidget->visualisationWidget,
00040                       SLOT(slotStartSimulation()) );
00041 
00042     QObject::connect( simulationControls->stopAction,
00043                       SIGNAL(activated()),
00044                       simulationWidget,
00045                       SLOT(slotStopSimulation()) );
00046 
00047     QObject::connect( simulationControls->stepAction,
00048                       SIGNAL(activated()),
00049                       simulationWidget->visualisationWidget,
00050                       SLOT(slotStepSimulation()) );
00051 
00052     QObject::connect( simulationControls->fForwardAction,
00053                       SIGNAL(activated()),
00054                       simulationWidget->visualisationWidget,
00055                       SLOT(slotFForwardSimulation()) );
00056 
00057     QObject::connect( simulationWidget->visualisationWidget,
00058                       SIGNAL(signalSimulationAbort()),
00059                       simulationControls,
00060                       SLOT(slotPlayPressed()) );
00061 
00062     QObject::connect( simulationWidget->visualisationWidget,
00063                       SIGNAL( signalRecordingAllowed( bool ) ),
00064                       simulationControls,
00065                       SLOT( slotRecordingAllowed( bool ) ) );
00066 
00067     QObject::connect( simulationControls->alterMovieSettingsAction,
00068                       SIGNAL( activated() ),
00069                       simulationWidget->visualisationWidget,
00070                       SLOT( slotAlterMovieSettingsClicked() ) );
00071 
00072     QObject::connect( simulationControls->stopAction,
00073                       SIGNAL(activated()),
00074                       this,
00075                       SLOT( slotStopPressed()) );
00076 
00077     this->resize( 780, 810 );
00078     this->setMinimumSize( 780, 810 );
00079   };
00080 
00081   SIG_SimulationWindow::~SIG_SimulationWindow()
00082   { };
00083 
00084   void SIG_SimulationWindow::visualizeThis(SIGEL_Robot::SIG_Robot const &robot,
00085                                            SIGEL_Environment::SIG_Environment const &environment,
00086                                            SIGEL_Simulation::SIG_SimulationParameters const &simulationParameters,
00087                                            SIGEL_Program::SIG_Program const &program)
00088   {
00089     simulationWidget->visualizeThis(robot, environment, simulationParameters, program);
00090   };
00091 
00092   void SIG_SimulationWindow::slotStopPressed()
00093   {
00094     // reset the button
00095     simulationControls->alterMovieSettingsAction->setIconSet( simulationControls->recordingDisallowedIcons );
00096 
00097     // reset the data that has to be resetted in the simulationVisualisationWidget
00098     simulationWidget->visualisationWidget->resetRecorder();
00099   };
00100 
00101 }

Generated at Mon Sep 3 01:32:33 2001 for PG 368 - SIGEL by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000