예제 #1
0
class activatedelinblocksGUI(QtGui.QDialog):
    def __init__(self, m, parent=None):
        self.module = Module
        self.module = m
        QtGui.QDialog.__init__(self, parent)
        self.ui = Ui_DelinBlocksDialog()
        self.ui.setupUi(self)
        
        #Set all default parameters contained in the module file into the GUI's fields
        
        #----------------------------------------------------------------------#
        #-------- GENERAL SIMULATION INPUTS------------------------------------#
        #----------------------------------------------------------------------#
        self.ui.blocksize_in.setText(self.module.getParameterAsString("BlockSize"))
        if self.module.getParameterAsString("input_from_urbansim") == "1":
            self.ui.urbansim_in_check.setChecked(1)
            self.ui.soc_par1_check.setEnabled(0)
            self.ui.soc_par2_check.setEnabled(0)
            self.ui.soc_par1_box.setEnabled(0)
            self.ui.soc_par2_box.setEnabled(0)
        else:
            self.ui.urbansim_in_check.setChecked(0)
            self.ui.soc_par1_check.setEnabled(1)
            self.ui.soc_par2_check.setEnabled(1)
            self.ui.soc_par1_box.setEnabled(1)
            self.ui.soc_par2_box.setEnabled(1)
        
        #----------------------------------------------------------------------#
        #-------- ADDITIONAL INPUTS--------------------------------------------#
        #----------------------------------------------------------------------#
        #additional parameters
        if self.module.getParameterAsString("include_plan_map") == "1":
            self.ui.planmap_check.setChecked(1)
        else:
            self.ui.planmap_check.setChecked(0)
        if self.module.getParameterAsString("include_local_map") == "1":
            self.ui.localmap_check.setChecked(1)
        else:
            self.ui.localmap_check.setChecked(0)
        if self.module.getParameterAsString("include_road_net") == "1":                ####ROAD NETWORK MAP NOT OPERATIONAL YET!!!!
            self.ui.roadnet_check.setChecked(1)
        else:
            self.ui.roadnet_check.setChecked(0)
        
        #conditions for what user inputs from main module are
        if self.module.getParameterAsString("include_soc_par1") == "1":
            self.ui.soc_par1_check.setChecked(1)
            self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
        else:
            self.ui.soc_par1_check.setChecked(0)
            self.ui.soc_par1_box.setEnabled(0)
            self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
            
        if self.module.getParameterAsString("include_soc_par2") == "1":
            self.ui.soc_par2_check.setChecked(1)
            self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
        else:
            self.ui.soc_par2_check.setChecked(0)
            self.ui.soc_par2_box.setEnabled(0)
            self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
        
        #----------------------------------------------------------------------#
        #-------- MAP CONNECTIVITY INPUTS -------------------------------------#
        #----------------------------------------------------------------------#
        if self.module.getParameterAsString("Neighbourhood") == "N":
            self.ui.radioVNeum.setChecked(True)
        if self.module.getParameterAsString("Neighbourhood") == "M":
            self.ui.radioMoore.setChecked(True)
            self.ui.neighb_vnfp_check.setEnabled(0)
            self.ui.neighb_vnpd_check.setEnabled(0)
        
        if self.module.getParameterAsString("vn4FlowPaths") == "1":
            self.ui.neighb_vnfp_check.setChecked(1)
        else:
            self.ui.neighb_vnfp_check.setChecked(0)
        
        if self.module.getParameterAsString("vn4Patches") == "1":
            self.ui.neighb_vnpd_check.setChecked(1)
        else:
            self.ui.neighb_vnpd_check.setChecked(0)
            
        #Flowpath COMBO BOX
        if self.module.getParameterAsString("flow_method") == "DI":
            self.ui.flowpath_combo.setCurrentIndex(0)
        elif self.module.getParameterAsString("flow_method") == "D8":
            self.ui.flowpath_combo.setCurrentIndex(1)
        
        if self.module.getParameterAsString("demsmooth_choose") == "1":
            self.ui.demsmooth_check.setChecked(1)
        else:
            self.ui.demsmooth_check.setChecked(0)
            self.ui.demsmooth_spin.setEnabled(0)
            
        self.ui.demsmooth_spin.setValue(int(self.module.getParameterAsString("demsmooth_passes")))
        
        if self.module.getParameterAsString("basinlimit") == "1":
            self.ui.delinbasin_check.setChecked(1)
        else:
            self.ui.delinbasin_check.setChecked(0)
            self.ui.delinbasin_box.setEnabled(0)
        
        self.ui.delinbasin_box.setText(self.module.getParameterAsString("basinAmax"))
            
        
        #QTCORE CONNECTS, REAL TIME GUI CHANGE COMMANDS
        QtCore.QObject.connect(self.ui.urbansim_in_check, QtCore.SIGNAL("clicked()"), self.social_parameters_urbansim)
        QtCore.QObject.connect(self.ui.soc_par1_check, QtCore.SIGNAL("clicked()"), self.social_par1_modify)
        QtCore.QObject.connect(self.ui.soc_par2_check, QtCore.SIGNAL("clicked()"), self.social_par2_modify)
        QtCore.QObject.connect(self.ui.radioVNeum, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
        QtCore.QObject.connect(self.ui.radioMoore, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
        QtCore.QObject.connect(self.ui.delinbasin_check, QtCore.SIGNAL("clicked()"), self.delinbasin_modify)
        QtCore.QObject.connect(self.ui.demsmooth_check, QtCore.SIGNAL("clicked()"), self.demsmooth_modify)
        QtCore.QObject.connect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"), self.save_values)
        

    #Enable-Disable functions for social parameters based on QtCore.QObject.connect() lines
    def social_parameters_urbansim(self):
        if self.ui.urbansim_in_check.isChecked() == 1:
            self.ui.soc_par1_check.setEnabled(0)
            self.ui.soc_par2_check.setEnabled(0)
            self.ui.soc_par1_box.setEnabled(0)
            self.ui.soc_par2_box.setEnabled(0)
        else:
            self.ui.soc_par1_check.setEnabled(1)
            self.ui.soc_par2_check.setEnabled(1)
            self.social_par1_modify()
            self.social_par2_modify()
    
    def social_par1_modify(self):
        if self.ui.soc_par1_check.isChecked() == 1:
            self.ui.soc_par1_box.setEnabled(1)
        else:
            self.ui.soc_par1_box.setEnabled(0)
    
    def social_par2_modify(self):
        if self.ui.soc_par2_check.isChecked() == 1:
            self.ui.soc_par2_box.setEnabled(1)
        else:
            self.ui.soc_par2_box.setEnabled(0)
    
    def demsmooth_modify(self):
        if self.ui.demsmooth_check.isChecked() == 1:
            self.ui.demsmooth_spin.setEnabled(1)
        else:
            self.ui.demsmooth_spin.setEnabled(0)
    
    def vnOptions_modify(self):
        if self.ui.radioVNeum.isChecked() == 1:
            self.ui.neighb_vnfp_check.setEnabled(1)
            self.ui.neighb_vnpd_check.setEnabled(1)
        else:
            self.ui.neighb_vnfp_check.setEnabled(0)
            self.ui.neighb_vnpd_check.setEnabled(0)
    
    def delinbasin_modify(self):
        if self.ui.delinbasin_check.isChecked() == 1:
            self.ui.delinbasin_box.setEnabled(1)
        else:
            self.ui.delinbasin_box.setEnabled(0)
    
    
    #Save values function
    def save_values(self):
        #----------------------------------------------------------------------#
        #-------- GENERAL SIMULATION INPUTS------------------------------------#
        #----------------------------------------------------------------------#
        blocksize = str(self.ui.blocksize_in.text())
        self.module.setParameterValue("BlockSize", blocksize)
        
        if self.ui.urbansim_in_check.isChecked() == 1:
            input_from_urbansim = 1
        else:
            input_from_urbansim = 0
        self.module.setParameterValue("input_from_urbansim", str(input_from_urbansim))
        
        #----------------------------------------------------------------------#
        #-------- ADDITIONAL INPUTS--------------------------------------------#
        #----------------------------------------------------------------------#
        #additional urban planning inputs
        if self.ui.planmap_check.isChecked() == 1:
            include_plan_map = 1
        else:
            include_plan_map = 0
        self.module.setParameterValue("include_plan_map", str(include_plan_map))
        
        if self.ui.localmap_check.isChecked() == 1:
            include_local_map = 1
        else:
            include_local_map = 0
        self.module.setParameterValue("include_local_map", str(include_local_map))
        
        if self.ui.roadnet_check.isChecked() == 1:
            include_road_net = 1
        else:
            include_road_net = 0
        self.module.setParameterValue("include_road_net", str(include_road_net))
        
        #additional social parameter inputs        
        if self.ui.soc_par1_check.isChecked() == 1:
            include_soc_par1 = 1
            social_par1_name = str(self.ui.soc_par1_box.text())
            self.module.setParameterValue("social_par1_name", social_par1_name)
        else:
            include_soc_par1 = 0
        self.module.setParameterValue("include_soc_par1", str(include_soc_par1))
        
        if self.ui.soc_par2_check.isChecked() == 1:
            include_soc_par2 = 1
            social_par2_name = str(self.ui.soc_par2_box.text())
            self.module.setParameterValue("social_par2_name", social_par2_name)
        else:
            include_soc_par2 = 0
        self.module.setParameterValue("include_soc_par2", str(include_soc_par2))
        
        #----------------------------------------------------------------------#
        #-------- MAP CONNECTIVITY PARAMETERS----------------------------------#
        #----------------------------------------------------------------------#
        if self.ui.radioMoore.isChecked() == True:
            neighbourhood = "M"
        if self.ui.radioVNeum.isChecked() == True:
            neighbourhood = "N"
        self.module.setParameterValue("Neighbourhood", neighbourhood)
        
        if self.ui.neighb_vnfp_check.isChecked() == 1:
            vn4FlowPaths = 1
        else:
            vn4FlowPaths = 0
        self.module.setParameterValue("vn4FlowPaths", str(vn4FlowPaths))
        
        if self.ui.neighb_vnpd_check.isChecked() == 1:
            vn4Patches = 1
        else:
            vn4Patches = 0
        self.module.setParameterValue("vn4Patches", str(vn4Patches))
        
        #Combo Box
        flow_path_matrix = ["DI", "D8"]
        flow_pathindex = self.ui.flowpath_combo.currentIndex()
        flow_method = flow_path_matrix[flow_pathindex]
        self.module.setParameterValue("flow_method", flow_method)
        
        if self.ui.demsmooth_check.isChecked() == 1:
            demsmooth_choose = 1
        else:
            demsmooth_choose = 0
        self.module.setParameterValue("demsmooth_choose", str(demsmooth_choose))
        
        demsmooth_passes = str(self.ui.demsmooth_spin.value())
        self.module.setParameterValue("demsmooth_passes", demsmooth_passes)
        
        if self.ui.delinbasin_check.isChecked() == 1:
            basinlimit = 1
        else:
            basinlimit = 0
        self.module.setParameterValue("basinlimit", str(basinlimit))
        
        basinAmax = str(self.ui.delinbasin_box.text())
        self.module.setParameterValue("basinAmax", basinAmax)
        
        #CONCEPTUAL NETWORKS Checkboxes
        
        
예제 #2
0
 def __init__(self, m, parent=None):
     self.module = Module
     self.module = m
     QtGui.QDialog.__init__(self, parent)
     self.ui = Ui_DelinBlocksDialog()
     self.ui.setupUi(self)
     
     #Set all default parameters contained in the module file into the GUI's fields
     
     #----------------------------------------------------------------------#
     #-------- GENERAL SIMULATION INPUTS------------------------------------#
     #----------------------------------------------------------------------#
     self.ui.blocksize_in.setText(self.module.getParameterAsString("BlockSize"))
     if self.module.getParameterAsString("input_from_urbansim") == "1":
         self.ui.urbansim_in_check.setChecked(1)
         self.ui.soc_par1_check.setEnabled(0)
         self.ui.soc_par2_check.setEnabled(0)
         self.ui.soc_par1_box.setEnabled(0)
         self.ui.soc_par2_box.setEnabled(0)
     else:
         self.ui.urbansim_in_check.setChecked(0)
         self.ui.soc_par1_check.setEnabled(1)
         self.ui.soc_par2_check.setEnabled(1)
         self.ui.soc_par1_box.setEnabled(1)
         self.ui.soc_par2_box.setEnabled(1)
     
     #----------------------------------------------------------------------#
     #-------- ADDITIONAL INPUTS--------------------------------------------#
     #----------------------------------------------------------------------#
     #additional parameters
     if self.module.getParameterAsString("include_plan_map") == "1":
         self.ui.planmap_check.setChecked(1)
     else:
         self.ui.planmap_check.setChecked(0)
     if self.module.getParameterAsString("include_local_map") == "1":
         self.ui.localmap_check.setChecked(1)
     else:
         self.ui.localmap_check.setChecked(0)
     if self.module.getParameterAsString("include_road_net") == "1":                ####ROAD NETWORK MAP NOT OPERATIONAL YET!!!!
         self.ui.roadnet_check.setChecked(1)
     else:
         self.ui.roadnet_check.setChecked(0)
     
     #conditions for what user inputs from main module are
     if self.module.getParameterAsString("include_soc_par1") == "1":
         self.ui.soc_par1_check.setChecked(1)
         self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
     else:
         self.ui.soc_par1_check.setChecked(0)
         self.ui.soc_par1_box.setEnabled(0)
         self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
         
     if self.module.getParameterAsString("include_soc_par2") == "1":
         self.ui.soc_par2_check.setChecked(1)
         self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
     else:
         self.ui.soc_par2_check.setChecked(0)
         self.ui.soc_par2_box.setEnabled(0)
         self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
     
     #----------------------------------------------------------------------#
     #-------- MAP CONNECTIVITY INPUTS -------------------------------------#
     #----------------------------------------------------------------------#
     if self.module.getParameterAsString("Neighbourhood") == "N":
         self.ui.radioVNeum.setChecked(True)
     if self.module.getParameterAsString("Neighbourhood") == "M":
         self.ui.radioMoore.setChecked(True)
         self.ui.neighb_vnfp_check.setEnabled(0)
         self.ui.neighb_vnpd_check.setEnabled(0)
     
     if self.module.getParameterAsString("vn4FlowPaths") == "1":
         self.ui.neighb_vnfp_check.setChecked(1)
     else:
         self.ui.neighb_vnfp_check.setChecked(0)
     
     if self.module.getParameterAsString("vn4Patches") == "1":
         self.ui.neighb_vnpd_check.setChecked(1)
     else:
         self.ui.neighb_vnpd_check.setChecked(0)
         
     #Flowpath COMBO BOX
     if self.module.getParameterAsString("flow_method") == "DI":
         self.ui.flowpath_combo.setCurrentIndex(0)
     elif self.module.getParameterAsString("flow_method") == "D8":
         self.ui.flowpath_combo.setCurrentIndex(1)
     
     if self.module.getParameterAsString("demsmooth_choose") == "1":
         self.ui.demsmooth_check.setChecked(1)
     else:
         self.ui.demsmooth_check.setChecked(0)
         self.ui.demsmooth_spin.setEnabled(0)
         
     self.ui.demsmooth_spin.setValue(int(self.module.getParameterAsString("demsmooth_passes")))
     
     if self.module.getParameterAsString("basinlimit") == "1":
         self.ui.delinbasin_check.setChecked(1)
     else:
         self.ui.delinbasin_check.setChecked(0)
         self.ui.delinbasin_box.setEnabled(0)
     
     self.ui.delinbasin_box.setText(self.module.getParameterAsString("basinAmax"))
         
     
     #QTCORE CONNECTS, REAL TIME GUI CHANGE COMMANDS
     QtCore.QObject.connect(self.ui.urbansim_in_check, QtCore.SIGNAL("clicked()"), self.social_parameters_urbansim)
     QtCore.QObject.connect(self.ui.soc_par1_check, QtCore.SIGNAL("clicked()"), self.social_par1_modify)
     QtCore.QObject.connect(self.ui.soc_par2_check, QtCore.SIGNAL("clicked()"), self.social_par2_modify)
     QtCore.QObject.connect(self.ui.radioVNeum, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
     QtCore.QObject.connect(self.ui.radioMoore, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
     QtCore.QObject.connect(self.ui.delinbasin_check, QtCore.SIGNAL("clicked()"), self.delinbasin_modify)
     QtCore.QObject.connect(self.ui.demsmooth_check, QtCore.SIGNAL("clicked()"), self.demsmooth_modify)
     QtCore.QObject.connect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"), self.save_values)
 def __init__(self, m, parent=None):
     self.module = Module
     self.module = m
     QtGui.QDialog.__init__(self, parent)
     self.ui = Ui_DelinBlocksDialog()
     self.ui.setupUi(self)
     
     self.cities = ["Adelaide", "Brisbane", "Cairns", "Canberra", "Copenhagen", "Innsbruck", "Kuala Lumpur", "London", "Melbourne", "Munich", "Perth", "Singapore", "Sydney", "Vienna"]
     
     #Set all default parameters contained in the module file into the GUI's fields
     
     #----------------------------------------------------------------------#
     #-------- GENERAL SIMULATION INPUTS------------------------------------#
     #----------------------------------------------------------------------#
     self.ui.blocksize_in.setValue(int(self.module.getParameterAsString("BlockSize")))
     
     if self.module.getParameterAsString("blocksize_auto") == "1":
         self.ui.blocksize_auto.setChecked(1)
         self.ui.blocksize_in.setEnabled(0)
     else:
         self.ui.blocksize_auto.setChecked(0)
         self.ui.blocksize_in.setEnabled(1)
     
     QtCore.QObject.connect(self.ui.blocksize_auto, QtCore.SIGNAL("clicked()"), self.block_auto_size)
     
     #UrbanSim Option - Old Legacy Code, used in DAnCE4Water Integration of UrbanBEATS Code
     #if self.module.getParameterAsString("input_from_urbansim") == "1":
     #    self.ui.urbansim_in_check.setChecked(1)
     #    self.ui.soc_par1_check.setEnabled(0)
     #    self.ui.soc_par2_check.setEnabled(0)
     #    self.ui.soc_par1_box.setEnabled(0)
     #    self.ui.soc_par2_box.setEnabled(0)
     #else:
     #    self.ui.urbansim_in_check.setChecked(0)
     #    self.ui.soc_par1_check.setEnabled(1)
     #    self.ui.soc_par2_check.setEnabled(1)
     #    self.ui.soc_par1_box.setEnabled(1)
     #    self.ui.soc_par2_box.setEnabled(1)
     #QtCore.QObject.connect(self.ui.urbansim_in_check, QtCore.SIGNAL("clicked()"), self.social_parameters_urbansim)
     
     #----------------------------------------------------------------------#
     #-------- PROCESSING INPUT DATA ---------------------------------------#
     #----------------------------------------------------------------------#
     if self.module.getParameterAsString("popdatatype") == "C":
         self.ui.popdata_totradio.setChecked(True)
     elif self.module.getParameterAsString("popdatatype") == "D":
         self.ui.popdata_densradio.setChecked(True)
     
     if self.module.getParameterAsString("soildatatype") == "C":
         self.ui.soildata_classify.setChecked(True)
         self.ui.soildata_unitscombo.setEnabled(False)
     elif self.module.getParameterAsString("soildatatype") == "I":
         self.ui.soildata_infil.setChecked(True)
         self.ui.soildata_unitscombo.setEnabled(True)
     
     if self.module.getParameterAsString("soildataunits") == "hrs":
         self.ui.soildata_unitscombo.setCurrentIndex(0)
     elif self.module.getParameterAsString("soildataunits") == "sec":
         self.ui.soildata_unitscombo.setCurrentIndex(1)
     
     QtCore.QObject.connect(self.ui.soildata_classify, QtCore.SIGNAL("clicked()"), self.soildata_modify)
     QtCore.QObject.connect(self.ui.soildata_infil, QtCore.SIGNAL("clicked()"), self.soildata_modify)
     
     if self.module.getParameterAsString("elevdatadatum") == "S":
         self.ui.elev_sealevel.setChecked(True)
         self.ui.elev_referencebox.setEnabled(False)
     elif self.module.getParameterAsString("elevdatadatum") == "C":
         self.ui.elev_custom.setChecked(True)
         self.ui.elev_referencebox.setEnabled(True)
         
     QtCore.QObject.connect(self.ui.elev_sealevel, QtCore.SIGNAL("clicked()"), self.elevCustomDatum_modify)
     QtCore.QObject.connect(self.ui.elev_custom, QtCore.SIGNAL("clicked()"), self.elevCustomDatum_modify)
     
     self.ui.elev_referencebox.setText(self.module.getParameterAsString("elevdatacustomref"))
     
     self.ui.planmap_check.setChecked(int(self.module.getParameterAsString("include_plan_map")))
     self.ui.localmap_check.setChecked(int(self.module.getParameterAsString("include_local_map")))
     
     if self.module.getParameterAsString("include_employment") == "1":
         self.ui.employment_check.setChecked(True)
         self.ui.jobdata_totradio.setEnabled(True)
         self.ui.jobdata_densradio.setEnabled(True)
     else:
         self.ui.employment_check.setChecked(False)
         self.ui.jobdata_totradio.setEnabled(False)
         self.ui.jobdata_densradio.setEnabled(False)        
     
     if self.module.getParameterAsString("jobdatatype") == "C":
         self.ui.jobdata_totradio.setChecked(True)
     elif self.module.getParameterAsString("jobdatatype") == "D":
         self.ui.jobdata_densradio.setChecked(True)
     
     QtCore.QObject.connect(self.ui.employment_check, QtCore.SIGNAL("clicked()"), self.employment_modify)
     
     self.ui.rivers_check.setChecked(int(self.module.getParameterAsString("include_rivers")))
     self.ui.lakes_check.setChecked(int(self.module.getParameterAsString("include_lakes")))
     
     if self.module.getParameterAsString("include_groundwater") == "1":
         self.ui.groundwater_check.setChecked(True)
         self.ui.groundwater_datumcombo.setEnabled(True)
     else:
         self.ui.groundwater_check.setChecked(False)
         self.ui.groundwater_datumcombo.setEnabled(False)
     
     if self.module.getParameterAsString("groundwater_datum") == "Sea":
         self.ui.groundwater_datumcombo.setCurrentIndex(0)
     elif self.module.getParameterAsString("groundwater_datum") == "Surf":
         self.ui.groundwater_datumcombo.setCurrentIndex(1)
     
     QtCore.QObject.connect(self.ui.groundwater_check, QtCore.SIGNAL("clicked()"), self.groundwaterDatum_modify)
     
     self.ui.roadnet_check.setChecked(int(self.module.getParameterAsString("include_road_net")))     #Future version
     self.ui.sewermains_check.setChecked(int(self.module.getParameterAsString("include_sewer_net")))
     self.ui.supplymains_check.setChecked(int(self.module.getParameterAsString("include_supply_net")))
     
     #conditions for what user inputs from main module are
     if self.module.getParameterAsString("include_soc_par1") == "1":
         self.ui.soc_par1_check.setChecked(1)
         self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
         self.ui.socpar1binary_radio.setEnabled(1)
         self.ui.socpar1prop_radio.setEnabled(1)
     else:
         self.ui.soc_par1_check.setChecked(0)
         self.ui.soc_par1_box.setEnabled(0)
         self.ui.soc_par1_box.setText(self.module.getParameterAsString("social_par1_name"))
         self.ui.socpar1binary_radio.setEnabled(0)
         self.ui.socpar1prop_radio.setEnabled(0)
     
     if self.module.getParameterAsString("socpar1_type") == "B":
         self.ui.socpar1binary_radio.setChecked(True)
     elif self.module.getParameterAsString("socpar1_type") == "P":
         self.ui.socpar1prop_radio.setChecked(True)
         
     if self.module.getParameterAsString("include_soc_par2") == "1":
         self.ui.soc_par2_check.setChecked(1)
         self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
         self.ui.socpar2binary_radio.setEnabled(1)
         self.ui.socpar2prop_radio.setEnabled(1)
     else:
         self.ui.soc_par2_check.setChecked(0)
         self.ui.soc_par2_box.setEnabled(0)
         self.ui.soc_par2_box.setText(self.module.getParameterAsString("social_par2_name"))
         self.ui.socpar2binary_radio.setEnabled(0)
         self.ui.socpar2prop_radio.setEnabled(0)
     
     if self.module.getParameterAsString("socpar2_type") == "B":
         self.ui.socpar2binary_radio.setChecked(True)
     elif self.module.getParameterAsString("socpar2_type") == "P":
         self.ui.socpar2prop_radio.setChecked(True)
     
     self.ui.spatialpatches_check.setChecked(int(self.module.getParameterAsString("patchdelin")))
     self.ui.spatialstats_check.setChecked(int(self.module.getParameterAsString("spatialmetrics")))
     
     QtCore.QObject.connect(self.ui.soc_par1_check, QtCore.SIGNAL("clicked()"), self.social_par1_modify)
     QtCore.QObject.connect(self.ui.soc_par2_check, QtCore.SIGNAL("clicked()"), self.social_par2_modify)
     
     #----------------------------------------------------------------------#
     #-------- MAP CONNECTIVITY INPUTS -------------------------------------#
     #----------------------------------------------------------------------#
     if self.module.getParameterAsString("Neighbourhood") == "N":
         self.ui.radioVNeum.setChecked(True)
     if self.module.getParameterAsString("Neighbourhood") == "M":
         self.ui.radioMoore.setChecked(True)
         self.ui.neighb_vnfp_check.setEnabled(0)
         self.ui.neighb_vnpd_check.setEnabled(0)
     
     self.ui.neighb_vnfp_check.setChecked(int(self.module.getParameterAsString("vn4FlowPaths")))
     self.ui.neighb_vnpd_check.setChecked(int(self.module.getParameterAsString("vn4Patches")))
     
     QtCore.QObject.connect(self.ui.radioVNeum, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
     QtCore.QObject.connect(self.ui.radioMoore, QtCore.SIGNAL("clicked()"), self.vnOptions_modify)
     
     #Flowpath COMBO BOX
     if self.module.getParameterAsString("flow_method") == "DI":
         self.ui.flowpath_combo.setCurrentIndex(0)
     elif self.module.getParameterAsString("flow_method") == "D8":
         self.ui.flowpath_combo.setCurrentIndex(1)
     
     if self.module.getParameterAsString("demsmooth_choose") == "1":
         self.ui.demsmooth_check.setChecked(1)
     else:
         self.ui.demsmooth_check.setChecked(0)
         self.ui.demsmooth_spin.setEnabled(0)
         
     self.ui.demsmooth_spin.setValue(int(self.module.getParameterAsString("demsmooth_passes")))
     
     QtCore.QObject.connect(self.ui.demsmooth_check, QtCore.SIGNAL("clicked()"), self.demsmooth_modify)
     
     #----------------------------------------------------------------------#
     #-------- REGIONAL GEOGRAPHY INPUTS -----------------------------------#
     #----------------------------------------------------------------------#    
     
     if self.module.getParameterAsString("locationOption") == "S":
         self.ui.cbdknown_radio.setChecked(True)
         self.ui.cbd_combo.setEnabled(1)
         self.ui.cbdlong_box.setEnabled(0)
         self.ui.cbdlat_box.setEnabled(0)
     if self.module.getParameterAsString("locationOption") == "C":
         self.ui.cbdmanual_radio.setChecked(True)
         self.ui.cbd_combo.setEnabled(0)
         self.ui.cbdlong_box.setEnabled(1)
         self.ui.cbdlat_box.setEnabled(1)
     
     if self.module.getParameterAsString("considerCBD") == "1":
         self.ui.considergeo_check.setChecked(1)
         self.ui.cbdknown_radio.setEnabled(1)
         self.ui.cbdmanual_radio.setEnabled(1)
         self.ui.cbdmark_check.setEnabled(1)
         self.cbdupdate()
     else:
         self.ui.considergeo_check.setChecked(0)
         self.ui.cbdknown_radio.setEnabled(0)
         self.ui.cbdmanual_radio.setEnabled(0)
         self.ui.cbdmark_check.setEnabled(0)
         self.ui.cbd_combo.setEnabled(0)
         self.ui.cbdlong_box.setEnabled(0)
         self.ui.cbdlat_box.setEnabled(0)
     
     try:
         citiesindex = self.cities.index(self.module.getParameterAsString("locationCity"))
     except:
         citiesindex = 0
     self.ui.cbd_combo.setCurrentIndex(citiesindex)
     
     self.ui.cbdlong_box.setText(self.module.getParameterAsString("locationLong"))
     self.ui.cbdlat_box.setText(self.module.getParameterAsString("locationLat"))
     self.ui.cbdmark_check.setChecked(int(self.module.getParameterAsString("marklocation")))
     
     QtCore.QObject.connect(self.ui.considergeo_check, QtCore.SIGNAL("clicked()"), self.geoupdate)
     QtCore.QObject.connect(self.ui.cbdknown_radio, QtCore.SIGNAL("clicked()"), self.cbdupdate)
     QtCore.QObject.connect(self.ui.cbdmanual_radio, QtCore.SIGNAL("clicked()"), self.cbdupdate)
     
     #QTCORE CONNECTS, REAL TIME GUI CHANGE COMMANDS
     QtCore.QObject.connect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"), self.save_values)