コード例 #1
0
ファイル: step_fc70_extent.py プロジェクト: myarjunar/inasafe
    def validate_extent(self):
        """Check if the selected extent intersects source data.

        :returns: true if extent intersects both layers, false if is disjoint
        :rtype: boolean
        """
        _analysis_handler = AnalysisHandler(self.parent)
        _analysis_handler.setup_analysis()
        try:
            impact_function = _analysis_handler.impact_function
            clip_parameters = impact_function.clip_parameters
            # pylint: disable=unused-variable
            adjusted_geo_extent = clip_parameters['adjusted_geo_extent']
            # pylint: enable=unused-variable
        except (AttributeError, InsufficientOverlapError):
            _analysis_handler = None
            return False

        _analysis_handler = None
        return True
コード例 #2
0
    def validate_extent(self):
        """Check if the selected extent intersects source data.

        :returns: true if extent intersects both layers, false if is disjoint
        :rtype: boolean
        """
        _analysis_handler = AnalysisHandler(self.parent)
        _analysis_handler.setup_analysis()
        try:
            impact_function = _analysis_handler.impact_function
            clip_parameters = impact_function.clip_parameters
            # pylint: disable=unused-variable
            adjusted_geo_extent = clip_parameters['adjusted_geo_extent']
            # pylint: enable=unused-variable
        except (AttributeError, InsufficientOverlapError):
            _analysis_handler = None
            return False

        _analysis_handler = None
        return True
コード例 #3
0
ファイル: step_fc90_analysis.py プロジェクト: easmetz/inasafe
 def setup_and_run_analysis(self):
     """Execute analysis after the tab is displayed"""
     # noinspection PyTypeChecker
     self.analysis_handler = AnalysisHandler(self.parent)
     self.analysis_handler.setup_and_run_analysis()
コード例 #4
0
ファイル: step_fc90_analysis.py プロジェクト: easmetz/inasafe
class StepFcAnalysis(WizardStep, FORM_CLASS):
    """Function Centric Wizard Step: Analysis"""

    def is_ready_to_next_step(self):
        """Check if the step is complete. If so, there is
            no reason to block the Next button.

        :returns: True if new step may be enabled.
        :rtype: bool
        """
        return True

    def get_previous_step(self):
        """Find the proper step when user clicks the Previous button.

        :returns: The step to be switched to
        :rtype: WizardStep instance or None
        """
        new_step = self.parent.step_fc_summary
        return new_step

    def get_next_step(self):
        """Find the proper step when user clicks the Next button.

        :returns: The step to be switched to
        :rtype: WizardStep instance or None
        """
        return None

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportWeb_released(self):
        """Handle the Open Report in Web Browser button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.wvResults.open_current_in_browser()

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportPDF_released(self):
        """Handle the Generate PDF button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.analysis_handler.print_map('pdf')

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportComposer_released(self):
        """Handle the Open Report in Web Broseer button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.analysis_handler.print_map('composer')

    def setup_and_run_analysis(self):
        """Execute analysis after the tab is displayed"""
        # noinspection PyTypeChecker
        self.analysis_handler = AnalysisHandler(self.parent)
        self.analysis_handler.setup_and_run_analysis()

    def set_widgets(self):
        """Set widgets on the Progress tab"""
        self.pbProgress.setValue(0)
        self.wvResults.setHtml('')
        self.pbnReportWeb.hide()
        self.pbnReportPDF.hide()
        self.pbnReportComposer.hide()
        self.lblAnalysisStatus.setText(self.tr('Running analysis...'))
コード例 #5
0
ファイル: step_fc90_analysis.py プロジェクト: sopac/inasafe
 def setup_and_run_analysis(self):
     """Execute analysis after the tab is displayed"""
     # noinspection PyTypeChecker
     self.analysis_handler = AnalysisHandler(self.parent)
     self.analysis_handler.setup_and_run_analysis()
コード例 #6
0
ファイル: step_fc90_analysis.py プロジェクト: sopac/inasafe
class StepFcAnalysis(WizardStep, FORM_CLASS):
    """Function Centric Wizard Step: Analysis"""

    def is_ready_to_next_step(self):
        """Check if the step is complete. If so, there is
            no reason to block the Next button.

        :returns: True if new step may be enabled.
        :rtype: bool
        """
        return True

    def get_previous_step(self):
        """Find the proper step when user clicks the Previous button.

        :returns: The step to be switched to
        :rtype: WizardStep instance or None
        """
        new_step = self.parent.step_fc_summary
        return new_step

    def get_next_step(self):
        """Find the proper step when user clicks the Next button.

        :returns: The step to be switched to
        :rtype: WizardStep instance or None
        """
        return None

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportWeb_released(self):
        """Handle the Open Report in Web Browser button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.wvResults.open_current_in_browser()

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportPDF_released(self):
        """Handle the Generate PDF button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.analysis_handler.print_map('pdf')

    # prevents actions being handled twice
    # noinspection PyPep8Naming
    @pyqtSignature('')
    def on_pbnReportComposer_released(self):
        """Handle the Open Report in Web Broseer button release.

        .. note:: This is an automatic Qt slot
           executed when the Next button is released.
        """
        self.analysis_handler.print_map('composer')

    def setup_and_run_analysis(self):
        """Execute analysis after the tab is displayed"""
        # noinspection PyTypeChecker
        self.analysis_handler = AnalysisHandler(self.parent)
        self.analysis_handler.setup_and_run_analysis()

    def set_widgets(self):
        """Set widgets on the Progress tab"""
        self.pbProgress.setValue(0)
        self.wvResults.setHtml('')
        self.pbnReportWeb.hide()
        self.pbnReportPDF.hide()
        self.pbnReportComposer.hide()
        self.lblAnalysisStatus.setText(self.tr('Running analysis...'))