Esempio n. 1
0
 def __init__(self):
     materialsABMUI.__init__(self)
     
     for key in emptys.keys():
         if key != 'name':
             self.__getattribute__(key).setValidator(QtGui.QDoubleValidator())
     
     filename = '%s/caseDicts/materialProperties.incompressible'%os.path.dirname(os.path.realpath(__file__)) #Path de python
     from os.path import expanduser
     self.home = expanduser('~')
     filename2 = '%s/.config/petroSym/materialProperties.incompressible'%self.home #Path en home
     
     if not os.path.isfile(filename2) or (os.path.isfile(filename2) and os.path.getsize(filename2) == 0): #Si no existe, o existe y esta vacio
         command = 'mkdir -p %s/.config/petroSym/'%self.home #-p por si ya existe el directorio
         os.system(command)
         command = 'cp %s %s/.config/petroSym/'%(filename,self.home) #copio el archivo
         os.system(command)
     
     parsedData = ParsedParameterFile(filename2,createZipped=False)
         
     self.defaults = parsedData['defaults']
     self.userLibrary = parsedData['userLibrary']
     
     for key in self.defaults.keys():
         self.list_default.addItem(key)
         
     for key in self.userLibrary.keys():
         self.list_user.addItem(key)
     
     self.list_default.item(0).setSelected(True)
     self.changeSelectionDefault()
Esempio n. 2
0
 def __init__(self):
     materialsABMUI.__init__(self)
     
     for key in emptys.keys():
         if key != 'name':
             self.__getattribute__(key).setValidator(QtGui.QDoubleValidator())
             
     filename = 'caseDicts/materialProperties.incompressible'
     parsedData = ParsedParameterFile(filename,createZipped=False)
         
     self.defaults = parsedData['defaults']
     self.userLibrary = parsedData['userLibrary']
     
     for key in self.defaults.keys():
         self.list_default.addItem(key)
         
     for key in self.userLibrary.keys():
         self.list_user.addItem(key)
     
     self.list_default.item(0).setSelected(True)
     self.changeSelectionDefault()
Esempio n. 3
0
    def __init__(self):
        materialsABMUI.__init__(self)

        for key in emptys.keys():
            if key != 'name':
                self.__getattribute__(key).setValidator(
                    QtGui.QDoubleValidator())

        filename = 'caseDicts/materialProperties.incompressible'
        parsedData = ParsedParameterFile(filename, createZipped=False)

        self.defaults = parsedData['defaults']
        self.userLibrary = parsedData['userLibrary']

        for key in self.defaults.keys():
            self.list_default.addItem(key)

        for key in self.userLibrary.keys():
            self.list_user.addItem(key)

        self.list_default.item(0).setSelected(True)
        self.changeSelectionDefault()