00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CONNECTIONPROPERTIESDIALOG_H
00024 #define CONNECTIONPROPERTIESDIALOG_H
00025
00026
00027 #include "DBInterface.h"
00028 #include "ConnectionType.h"
00029 #include "ConnectionManager.h"
00030 #include "ConnectionParameterTable.h"
00031
00032
00033 #include <qdialog.h>
00034 #include <qcombobox.h>
00035 #include <qlabel.h>
00036 #include <qtable.h>
00037 #include <qstring.h>
00038 #include <qlineedit.h>
00039 #include <qvalidator.h>
00040 #include <qradiobutton.h>
00041
00042
00043 #include <map>
00044
00045
00046 #define DEFAULT_MIN_DELAY 0
00047 #define DEFAULT_MAX_DELAY 250
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 class ConnectionPropertiesDialog : public QDialog{
00058 Q_OBJECT
00059
00060 public:
00061 ConnectionPropertiesDialog(QWidget *, const char*, DBInterface*);
00062 ConnectionPropertiesDialog(QWidget *, const char*, DBInterface* netDBInter, unsigned int fromNeurGrpID, unsigned int toNeurGrpID, unsigned short connType);
00063 ~ConnectionPropertiesDialog();
00064 ConnectionHolder getConnectionHolder();
00065 map<string, double> getConnectionParameters();
00066
00067
00068 private slots:
00069 void layerRadioStateChanged();
00070 void okButtonPressed();
00071 void paramSelectionChanged();
00072 void paramValueChanged(int, int);
00073
00074
00075 private:
00076
00077
00078 DBInterface *dbInterface;
00079
00080
00081 QIntValidator *delayValidator;
00082
00083
00084 QDoubleValidator * paramValidator;
00085
00086
00087 map<int, unsigned short> synapseTypePositionMap;
00088
00089
00090
00091 bool editMode;
00092
00093
00094
00095 int connectionType;
00096
00097
00098 int fromNeurGrpID;
00099
00100
00101 int toNeurGrpID;
00102
00103
00104 QLabel *intraLayerLabel;
00105 QLabel *fromLayerLabel;
00106 QLabel *toLayerLabel;
00107 QComboBox *intraLayerCombo;
00108 QComboBox *fromLayerCombo;
00109 QComboBox *toLayerCombo;
00110 QComboBox *synapseTypeCombo;
00111 QComboBox *connectionTypeCombo;
00112 QRadioButton *interRadioButt;
00113 QRadioButton *intraRadioButt;
00114 ConnectionParameterTable *connParamTable;
00115 QLineEdit *minDelayText;
00116 QLineEdit *maxDelayText;
00117
00118
00119
00120 bool parameterError;
00121
00122
00123 bool loadError;
00124
00125
00126
00127
00128 ConnectionPropertiesDialog(const ConnectionPropertiesDialog&);
00129
00130
00131 ConnectionPropertiesDialog operator = (const ConnectionPropertiesDialog&);
00132
00133 bool checkConnection_INTER(unsigned int, unsigned int, unsigned short);
00134 bool checkConnection_INTRA(unsigned short);
00135 void constructDialog();
00136 void fillConnectionTypeCombo_INTER();
00137 void fillConnectionTypeCombo_INTRA();
00138 double getParameterValue(QString);
00139 void loadLayerNames();
00140 void loadParameterTable(unsigned short);
00141 void setParameterValue(QString, double);
00142
00143 };
00144
00145
00146 #endif//CONNECTIONPROPERTIESDIALOG_H
00147
00148