parameters: (self)
docstring: Fill the combo box with single phase fluid property classes
docstring_summary: Fill the combo box with single phase fluid property classes
docstring_tokens: Fill the combo box with single phase fluid property classes
function: def fillFluidProperties(self):
          """
          Fill the combo box with single phase fluid property classes
          """
  
          fp_classes = [
              {
                  'name': 'Single phase',
                  'classes': [],
                  'data': self.SINGLE_PHASE
              },
              {
                  'name': 'Two phase',
                  'classes': [],
                  'data': self.TWO_PHASE
              }
          ]
  
          json_fps = self.exe_info.json_data.json_data["blocks"]['Modules']['subblocks']['FluidProperties']['star']['subblock_types']
  
          for class_name, vals in json_fps.items():
              params = vals['parameters']
              if 'fp_type' in params:
                  fp_type = params['fp_type']['default']
                  if fp_type == 'single-phase-fp':
                      fp_classes[0]['classes'].append(class_name)
                  elif fp_type == 'two-phase-fp':
                      fp_classes[1]['classes'].append(class_name)
  
          for fpc in fp_classes:
              fpc['classes'].sort()
  
          sep_indices = []
          model = QStandardItemModel()
          for fpc in fp_classes:
              parent = QStandardItem(fpc['name'])
              parent.setEnabled(False)
              model.appendRow(parent)
              for c in fpc['classes']:
                  item = QStandardItem(c)
                  item.setData(fpc['data'])
                  model.appendRow(item)
              sep_indices.append(model.rowCount())
  
          self.ctlFPType.setModel(model)
          for idx in sep_indices[:-1]:
              self.ctlFPType.insertSeparator(idx)
function_tokens: def fillFluidProperties ( self ) : fp_classes = [ { 'name' : 'Single phase' , 'classes' : [ ] , 'data' : self . SINGLE_PHASE } , { 'name' : 'Two phase' , 'classes' : [ ] , 'data' : self . TWO_PHASE } ] json_fps = self . exe_info . json_data . json_data [ "blocks" ] [ 'Modules' ] [ 'subblocks' ] [ 'FluidProperties' ] [ 'star' ] [ 'subblock_types' ] for class_name , vals in json_fps . items ( ) : params = vals [ 'parameters' ] if 'fp_type' in params : fp_type = params [ 'fp_type' ] [ 'default' ] if fp_type == 'single-phase-fp' : fp_classes [ 0 ] [ 'classes' ] . append ( class_name ) elif fp_type == 'two-phase-fp' : fp_classes [ 1 ] [ 'classes' ] . append ( class_name ) for fpc in fp_classes : fpc [ 'classes' ] . sort ( ) sep_indices = [ ] model = QStandardItemModel ( ) for fpc in fp_classes : parent = QStandardItem ( fpc [ 'name' ] ) parent . setEnabled ( False ) model . appendRow ( parent ) for c in fpc [ 'classes' ] : item = QStandardItem ( c ) item . setData ( fpc [ 'data' ] ) model . appendRow ( item ) sep_indices . append ( model . rowCount ( ) ) self . ctlFPType . setModel ( model ) for idx in sep_indices [ : - 1 ] : self . ctlFPType . insertSeparator ( idx )