示例#1
0
    def __selectInletBoundary(self, boundary):
        """
        Shows widgets for inlet.
        """
        self.hydraulicheadWidget.hideWidget()
        if self.coalWidget.getCoalNumber() == 0:
            if GroundwaterModel(self.__case).getGroundwaterModel() == "off":
                self.velocityWidget.showWidget(boundary)
            else:
                self.velocityWidget.hideWidget()
                self.hydraulicheadWidget.showWidget(boundary)
            self.coalWidget.hideWidget()
        else:
            self.velocityWidget.hideWidget()
            self.coalWidget.showWidget(boundary)

        self.turbulenceWidget.showWidget(boundary)
        self.meteoWidget.showWidget(boundary)
        self.scalarsWidget.showWidget(boundary)
        self.mobileMeshWidget.showWidget(boundary)
        self.electricalWidget.showWidget(boundary)
        self.externalHeadLossesWidget.hideWidget()
        self.pressureWidget.hideWidget()
        self.convectiveInletWidget.showWidget(boundary)
        self.mappedInletWidget.showWidget(boundary)
示例#2
0
 def __selectOutletBoundary(self, boundary):
     """
     Shows widgets for wall.
     """
     self.scalarsWidget.showWidget(boundary)
     self.mobileMeshWidget.showWidget(boundary)
     self.meteoWidget.showWidget(boundary)
     if self.compressibleOutletWidget.getCompressibleModel() != "off":
         self.compressibleOutletWidget.showWidget(boundary)
     else:
         self.compressibleOutletWidget.hideWidget()
     self.electricalWidget.showWidget(boundary)
     self.externalHeadLossesWidget.hideWidget()
     if GroundwaterModel(self.__case).getGroundwaterModel() == "off":
         self.hydraulicheadWidget.hideWidget()
     else:
         self.hydraulicheadWidget.showWidget(boundary)
示例#3
0
    def __init__(self, parent, case):
        """
        Constructor
        """
        QWidget.__init__(self, parent)

        Ui_BoundaryConditionsForm.__init__(self)
        self.setupUi(self)
        self.__case = case

        self.__case.undoStopGlobal()

        # Model and QTreeView for Boundaries

        self.__modelBoundaries = StandardItemModelBoundaries()
        self.treeViewBoundaries.setModel(self.__modelBoundaries)
        self.treeViewBoundaries.setColumnWidth(2, 110)

        # Fill the model with the boundary zone

        if MobileMeshModel(self.__case).getMethod() == "off":
            if GroundwaterModel(self.__case).getGroundwaterModel() == "off":
                lst = ('wall', 'inlet', 'outlet', 'free_inlet_outlet',
                       'imposed_p_outlet')
            else:
                lst = ('groundwater')
        else:
            lst = ('wall', 'inlet', 'outlet', 'symmetry', 'free_inlet_outlet',
                   'imposed_p_outlet')

        d = LocalizationModel('BoundaryZone', self.__case)
        for zone in d.getZones():
            label = zone.getLabel()
            nature = zone.getNature()
            codeNumber = zone.getCodeNumber()
            local = zone.getLocalization()
            if nature in lst:
                self.__modelBoundaries.insertItem(label, codeNumber, nature,
                                                  local)

        self.treeViewBoundaries.clicked[QModelIndex].connect(
            self.__slotSelectBoundary)

        # Set the case for custom widgets
        self.roughWidget.setup(self.__case)
        self.slidingWidget.setup(self.__case)
        self.convectiveInletWidget.setup(self.__case)
        self.mappedInletWidget.setup(self.__case)
        self.velocityWidget.setup(self.__case)
        self.turbulenceWidget.setup(self.__case)
        self.compressibleOutletWidget.setup(self.__case)
        self.coalWidget.setup(self.__case)
        self.scalarsWidget.setup(self.__case)
        self.meteoWidget.setup(self.__case, self.velocityWidget,
                               self.turbulenceWidget, self.scalarsWidget)
        self.mobileMeshWidget.setup(self.__case)
        self.radiativeWidget.setup(self.__case)
        self.electricalWidget.setup(self.__case)
        self.hydraulicheadWidget.setup(self.__case)
        self.pressureWidget.setup(self.__case)
        self.externalHeadLossesWidget.setup(self.__case)

        self.__hideAllWidgets()

        self.__case.undoStartGlobal()