SpikeStream Application Library  0.2
NeuronParametersDialog.cpp
Go to the documentation of this file.
00001 //SpikeStream includes
00002 #include "Globals.h"
00003 #include "NeuronParametersDialog.h"
00004 #include "NeuronParametersModel.h"
00005 #include "NeuronParametersView.h"
00006 using namespace spikestream;
00007 
00008 //Qt includes
00009 #include <QTabWidget>
00010 
00011 
00013 NeuronParametersDialog::NeuronParametersDialog(QWidget *parent) : QDialog(parent) {
00014         //Set title
00015         this->setWindowTitle("Neuron Parameters");
00016 
00017         //Get a list of the neuron groups in the network
00018         QList<NeuronGroupInfo> infoList = Globals::getNetwork()->getNeuronGroupsInfo();
00019 
00020         //Create a tab for each neuron type in the network
00021         QTabWidget* tabWidget = new QTabWidget(this);
00022         QHash<unsigned int, bool> neurTypeMap;
00023         foreach(NeuronGroupInfo neurGrpInfo, infoList){
00024                 unsigned int tmpNeurTypeID = neurGrpInfo.getNeuronTypeID();
00025                 if(!neurTypeMap.contains(tmpNeurTypeID)){
00026                         NeuronParametersModel* neuronParametersModel = new NeuronParametersModel(tmpNeurTypeID);
00027                         QTableView* neuronParametersView = new NeuronParametersView(tabWidget, neuronParametersModel);
00028                         NeuronType neurType = Globals::getNetworkDao()->getNeuronType(tmpNeurTypeID);
00029                         tabWidget->addTab(neuronParametersView, neurType.getDescription());
00030                         neurTypeMap[tmpNeurTypeID] = true;
00031                 }
00032         }
00033 
00034         tabWidget->setMinimumSize(600, 400);
00035 }
00036 
00037 
00039 NeuronParametersDialog::~NeuronParametersDialog(){
00040 }
 All Classes Files Functions Variables Typedefs Friends Defines