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

SIG_RobotView.cpp

00001 #include <qlabel.h>
00002 #include <qlistbox.h>
00003 
00004 #include "SIGEL_MasterGUI/SIG_RobotView.h"
00005 
00006 
00007 namespace SIGEL_MasterGUI
00008 {
00009 
00010 /* 
00011  *  Constructs a SIG_Robot which is a child of 'parent', with the 
00012  *  name 'name' and widget flags set to 'f' 
00013  */
00014 SIG_RobotView::SIG_RobotView( QWidget* parent,  const char* name, WFlags fl, SIGEL_GP::SIG_GPExperiment &theExperiment )
00015   : SIG_RobotBase( parent, name, fl ), theExperiment( theExperiment )
00016 {
00017 };
00018 
00019 /*  
00020  *  Destroys the object and frees any allocated resources
00021  */
00022 SIG_RobotView::~SIG_RobotView()
00023 {
00024     // no need to delete child widgets, Qt does it all for us
00025 };
00026 
00027 void SIG_RobotView::putIntoExperiment()
00028 {
00029 
00030 };
00031 
00032 void SIG_RobotView::getOutOfExperiment()
00033 {
00034   // first clear the listboxes...
00035   listboxBodies->clear();
00036   listboxMaterials->clear();
00037   listboxLinks->clear();
00038   listboxJoints->clear();
00039   listboxDrives->clear();
00040   listboxSensors->clear();
00041 
00042   // now fill the listboxes...  
00043   QDictIterator<SIGEL_Robot::SIG_Body> bodyIt = theExperiment.robot.getBodyIter();
00044   textlabelBodies->setText( "Bodies: " + QString::number( bodyIt.count() ) );
00045   for( ; bodyIt.current(); ++bodyIt )
00046     {
00047       listboxBodies->insertItem( bodyIt.current()->getName() );
00048     }
00049 
00050   QDictIterator<SIGEL_Robot::SIG_Material> materialIt = theExperiment.robot.getMaterialIter();
00051   textlabelMaterials->setText( "Materials: " + QString::number( materialIt.count() ) );
00052   for( ; materialIt.current(); ++materialIt )
00053     {
00054       listboxMaterials->insertItem( materialIt.current()->getName() );
00055     }
00056 
00057   QDictIterator<SIGEL_Robot::SIG_Link> linkIt = theExperiment.robot.getLinkIter();
00058   textlabelLinks->setText( "Links: " + QString::number( linkIt.count() ) );
00059   for( ; linkIt.current(); ++linkIt )
00060     {
00061       listboxLinks->insertItem( linkIt.current()->getName() );
00062     }
00063   
00064   QDictIterator<SIGEL_Robot::SIG_Joint> jointIt = theExperiment.robot.getJointIter();
00065   textlabelJoints->setText( "Joints: " + QString::number( jointIt.count() ) );
00066   for( ; jointIt.current(); ++jointIt )
00067     {
00068       listboxJoints->insertItem( jointIt.current()->getName() );
00069     }
00070 
00071   QDictIterator<SIGEL_Robot::SIG_Drive> driveIt = theExperiment.robot.getDriveIter();
00072   textlabelDrives->setText( "Drives: " + QString::number( driveIt.count() ) );
00073   for( ; driveIt.current(); ++driveIt )
00074     {
00075       listboxDrives->insertItem( driveIt.current()->getName() );
00076     }
00077 
00078   QDictIterator<SIGEL_Robot::SIG_Sensor> sensorIt = theExperiment.robot.getSensorIter();
00079   textlabelSensors->setText( "Sensors: " + QString::number( sensorIt.count() ) );
00080   for( ; sensorIt.current(); ++sensorIt )
00081     {
00082       listboxSensors->insertItem( sensorIt.current()->getName() );
00083     }
00084 };
00085 
00086 }

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