Changeset 2044


Ignore:
Timestamp:
Sep 29, 2011, 5:03:01 PM (5 years ago)
Author:
robert@…
Message:

Removed println statements and improved type determination of module data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/visualization/VisualizeController.groovy

    r2042 r2044  
    162162        // TODO: handle the case of multiple fields on an axis
    163163        // Determine data types
    164         println "Determining rowType: "+inputData.rowIds[0]
     164        log.trace "Determining rowType: "+inputData.rowIds[0]
    165165        def rowType = determineFieldType(inputData.studyIds[0], inputData.rowIds[0])
    166         println "Determining columnType: "+inputData.columnIds[0]
     166       
     167                log.trace "Determining columnType: "+inputData.columnIds[0]
    167168        def columnType = determineFieldType(inputData.studyIds[0], inputData.columnIds[0])
    168169
     
    170171        def types = determineVisualizationTypes(rowType, columnType)
    171172
    172         println "types: "+types+", determined this based on "+rowType+" and "+columnType
     173        log.trace "types: "+types+", determined this based on "+rowType+" and "+columnType
    173174        return sendResults(['types':types,'rowIds':inputData.rowIds[0],'columnIds':inputData.columnIds[0]])
    174175        }
     
    523524                // Make sure the null category is last
    524525                groups = groups.findAll { it != null } + groups.findAll { it == null }
    525                
    526                 println "TEST";
    527                 groups.each { println "" + it + " - " + it?.class?.toString() }
    528526               
    529527                // Generate the output object
     
    10531051     */
    10541052    protected int determineCategoryFromClass(classObject){
    1055         println "classObject: "+classObject+", of class: "+classObject.class
     1053        log.trace "Determine category from class: "+classObject+", of class: "+classObject?.class
    10561054        if(classObject==java.lang.String){
    10571055            return CATEGORICALDATA
     
    10751073            }
    10761074        } else {
    1077             if(inputObject.toString().isDouble()){
    1078                 results << NUMERICALDATA
    1079             } else {
    1080                 results << CATEGORICALDATA
    1081             }
     1075                        if( inputObject != null ) {
     1076                    if(inputObject.toString().isDouble()){
     1077                        results << NUMERICALDATA
     1078                    } else {
     1079                        results << CATEGORICALDATA
     1080                    }
     1081                        }
    10821082        }
    10831083
    10841084        results.unique()
    10851085
    1086         if(results.size()>1){
     1086        if(results.size() != 1){
    10871087            // If we cannot figure out what kind of a datatype a piece of data is, we treat it as categorical data
    10881088            results[0] = CATEGORICALDATA
     
    11091109    protected int determineCategoryFromTemplateField(tf){
    11101110        if(tf.type==TemplateFieldType.DOUBLE || tf.type==TemplateFieldType.LONG){
    1111             println "GSCF templatefield: NUMERICALDATA ("+NUMERICALDATA+") (based on "+tf.type+")"
     1111            log.trace "GSCF templatefield: NUMERICALDATA ("+NUMERICALDATA+") (based on "+tf.type+")"
    11121112            return NUMERICALDATA
    11131113        }
    11141114        if(tf.type==TemplateFieldType.DATE){
    1115             println "GSCF templatefield: DATE ("+DATE+") (based on "+tf.type+")"
     1115            log.trace "GSCF templatefield: DATE ("+DATE+") (based on "+tf.type+")"
    11161116            return DATE
    11171117        }
    11181118        if(tf.type==TemplateFieldType.RELTIME){
    1119             println "GSCF templatefield: RELTIME ("+RELTIME+") (based on "+tf.type+")"
     1119            log.trace "GSCF templatefield: RELTIME ("+RELTIME+") (based on "+tf.type+")"
    11201120            return RELTIME
    11211121        }
    1122         println "GSCF templatefield: CATEGORICALDATA ("+CATEGORICALDATA+") (based on "+tf.type+")"
     1122        log.trace "GSCF templatefield: CATEGORICALDATA ("+CATEGORICALDATA+") (based on "+tf.type+")"
    11231123        return CATEGORICALDATA
    11241124    }
     
    11561156    protected void setInfoMessage(message){
    11571157        infoMessage.add(message)
    1158         println "setInfoMessage: "+infoMessage
     1158        log.trace "setInfoMessage: "+infoMessage
    11591159    }
    11601160
Note: See TracChangeset for help on using the changeset viewer.