Changeset 3321

Show
Ignore:
Timestamp:
05/11/08 12:09:09 (2 months ago)
Author:
travis
Message:

(travis) adding indicator group + adding new indicator group

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/eugene/configs/eugene_gridcell.xml

    r3166 r3321  
    300300        </population_density> 
    301301      </model.gridcell> 
    302       <eugene.frank.indicators type="indicator_library"> 
    303         <global_population_density type="indicator"> 
    304           <package type="string">urbansim</package> 
    305           <valid_datasets type="string">alldata</valid_datasets> 
    306           <documentation_link type="string" /> 
    307           <expression type="string">alldata.aggregate_all(urbansim.gridcell.population_density, function=sum)</expression> 
    308         </global_population_density> 
    309       </eugene.frank.indicators> 
    310302      <my_indicators append_to="True" type="indicator_library"> 
    311303        <residential_units type="indicator"> 
     
    317309      </my_indicators> 
    318310    </Indicator_libraries> 
     311    <Indicator_groups setexpanded="True" type="group"/> 
    319312    <Simulation_runs setexpanded="True" type="all_source_data" /> 
    320313    <Results setexpanded="True" type="selectable_list" /> 
  • trunk/opus_gui/config/resultsmanager/opusxmlaction_results.py

    r3320 r3321  
    4242        QObject.connect(self.actAddNewIndicator, SIGNAL("triggered()"), self.addNewIndicator) 
    4343 
     44        #create new result template... 
     45        self.actAddNewIndicatorGroup = QAction(self.acceptIcon,  
     46                                          "Add new indicator group...", 
     47                                          self.xmlTreeObject.parent) 
     48        QObject.connect(self.actAddNewIndicatorGroup, SIGNAL("triggered()"), self.addNewIndicatorGroup)           
     49 
    4450        #generate results will enter a dialogue to pair indicators with  
    4551        #result templates and datasets and then run them to produce results 
     
    146152        model.emit(SIGNAL("layoutChanged()")) 
    147153 
     154 
     155    def addNewIndicatorGroup(self): 
     156        print "addNewIndicatorGroup pressed with column = %s and item = %s" % \ 
     157              (self.currentColumn, self.currentIndex.internalPointer().node().toElement().tagName()) 
     158               
     159        model = self.currentIndex.model() 
     160        document = model.domDocument 
     161        name = 'untitled indicator group' 
     162 
     163        newNode = model.create_node(document = document,  
     164                                    name = name,  
     165                                    type = 'indicator_group',  
     166                                    value = '') 
     167 
     168        model.insertRow(0, 
     169                self.currentIndex, 
     170                newNode) 
     171 
     172        self.currentIndex.model().markAsDirty() 
     173        model.emit(SIGNAL("layoutChanged()")) 
     174 
     175             
    148176    def generateResults(self): 
    149177        print "generateResults pressed with column = %s and item = %s" % \ 
     
    263291                elif domElement.attribute(QString("type")) == QString("source_data"): 
    264292                    self.menu.addAction(self.actGenerateResults) 
     293                elif domElement.tagName() == QString("Indicator_groups"): 
     294                    self.menu.addAction(self.actAddNewIndicatorGroup) 
    265295                elif domElement.attribute(QString("type")) == QString("indicator"): 
    266296                    self.menu.addAction(self.actViewDocumentation) 
  • trunk/opus_gui/config/xmlmodelview/opusdatamodel.py

    r3147 r3321  
    133133                   "script_batch":self.pythonBatchIcon, 
    134134                   "indicator_library":self.folderIcon, 
     135                   "indicator_group":self.folderIcon, 
    135136                   "group":self.folderIcon, 
    136137                   "indicator":self.tableIcon,