InaSAFE Disaster risk assessment tool by AusAid GUI InaSAFE Wizard Dialog.
Contact : ole.moller.nielsen@gmail.com
Note
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Bases: PyQt4.QtGui.QSortFilterProxyModel
Proxy model for hiding unsupported branches in the layer browser.
The filter method
Note
Enabled root items: QgsDirectoryItem, QgsFavouritesItem, QgsPGRootItem.
Disabled root items: QgsMssqlRootItem, QgsSLRootItem, QgsOWSRootItem, QgsWCSRootItem, QgsWFSRootItem, QgsWMSRootItem.
Disabled leaf items: QgsLayerItem and QgsOgrLayerItem with path ending with ‘.xml’
Parameters: |
|
---|---|
Returns: | Item validation result |
Return type: | bool |
Bases: PyQt4.QtGui.QDialog, Ui_WizardDialogBase
Dialog implementation class for the InaSAFE wizard.
Return a list of valid additional keywords for the current layer.
Returns: | A list where each value represents a valid additional kw. |
---|---|
Return type: | list |
Return true if the sum of age ratios is good, otherwise False.
Good means their sum does not exceed 1.
Returns: | Tuple of boolean and float. Boolean represent good or not good, while float represent the summation of age ratio. If some ratio do not use global default, the summation is set to 0. |
---|---|
Return type: | tuple |
Ensure all all additional keyword are set by user
Returns: | True if all additional keyword widgets are set |
---|---|
Return type: | boolean |
Select item in the list in list_widget if it’s the only item.
Parameters: | list_widget (QListWidget) – The list widget that want to be checked. |
---|
Return a list of valid classifications for a layer.
Returns: | A list where each value represents a valid classification. |
---|---|
Return type: | list |
Determine the next step to be switched to.
Parameters: | current_step (int) – The present step number. |
---|---|
Returns: | The next step number or None if finished. |
Return type: | int |
Determine the previous step to be switched to (by the Back button).
Parameters: | current_step (int) – The present step number. |
---|---|
Returns: | The previous step number. |
Return type: | int |
Parameters: | widget (dict) – Metadata of the widget where the event happened. |
---|
Return the proper keyword for field for the current layer. Expected values are: ‘field’, ‘structure_class_field’, road_class_field
Returns: | the field keyword |
---|---|
Return type: | string |
Obtain the value of aggregation attributes set by user.
Returns: | The key and value of aggregation attributes. |
---|---|
Return type: | dict |
Collect compatible layers from map canvas.
Note
Returns layers with keywords and layermode matching the category and compatible with the selected impact function. Also returns layers without keywords with layermode compatible with the selected impact function.
Parameters: | category (string) – The category to filter for. |
---|---|
Returns: | Metadata of found layers. |
Return type: | list of dicts |
Return current step of the wizard.
Returns: | Current step of the wizard. |
---|---|
Return type: | int |
Obtain an existing keyword’s value.
Parameters: | keyword (str) – A keyword from keywords. |
---|---|
Returns: | The value of the keyword. |
Return type: | str |
Obtain the state of the dialog as a keywords dict.
Returns: | Keywords reflecting the state of the dialog. |
---|---|
Return type: | dict |
Obtain the description of the browser layer selected by user.
Parameters: | category (string) – The category of the layer to get the description. |
---|---|
Returns: | Tuple of boolean and string. Boolean is true if layer is validated as compatible for current role (impact function and category) and false otherwise. String contains a description of the selected layer or an error message. |
Return type: | tuple |
Obtain the description of a canvas layer selected by user.
Parameters: |
|
---|---|
Returns: | description of the selected layer. |
Return type: | string |
Obtain layer mode of a given layer.
If no layer specified, the current layer is used
:param layer : layer to examine :type layer: QgsMapLayer or None
Returns: | The layer mode. |
---|---|
Return type: | str |
Parameters: | step (int) – The step number to be moved to. |
---|
Return a list of valid hazard categories for a layer.
Returns: | A list where each value represents a valid hazard category. |
---|---|
Return type: | list |
Parameters: |
|
---|---|
Returns: | True if layer is appropriate for the selected role |
Return type: | boolean |
Parameters: | step (int) – The present step number. |
---|---|
Returns: | True if new step may be enabled. |
Return type: | bool |
Parameters: |
|
---|---|
Returns: | The html description in tabular format, ready to use in a label or tool tip. |
Return type: | str |
Return a list of valid layer modes for a layer.
Returns: | A list where each value represents a valid layer mode. |
---|---|
Return type: | list |
Check if extents of two layers intersect.
Parameters: |
|
---|---|
Returns: | true if the layers intersect, false if they are disjoint |
Return type: | boolean |
Fill given list widget with compatible layers.
Note
Uses get_compatible_layers_from_canvas() to filter layers
Parameters: |
|
---|---|
Returns: | Metadata of found layers. |
Return type: | list of dicts |
Automatic slot executed when the adult ratio attribute is changed.
When the user changes the adult ratio attribute (cboAdultRatioAttribute), it will change the enabled value of dsbAdultRatioDefault. If value is ‘Use default’, enable dsbAdultRatioDefault. Otherwise, disabled it.
Automatic slot executed when the adult ratio attribute is changed.
When the user changes the elderly ratio attribute (cboElderlyRatioAttribute), it will change the enabled value of dsbElderlyRatioDefault. If value is ‘Use default’, enable dsbElderlyRatioDefault. Otherwise, disabled it.
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Parameters: | indx (int or str) – The new index. |
---|
Automatic slot executed when the female ratio attribute is changed.
When the user changes the female ratio attribute (cboFemaleRatioAttribute), it will change the enabled value of dsbFemaleRatioDefault. If value is ‘Use default’, enable dsbFemaleRatioDefault. Otherwise, disabled it.
Automatic slot executed when the youth ratio attribute is changed.
When the user changes the youth ratio attribute (cboYouthRatioAttribute), it will change the enabled value of dsbYouthRatioDefault. If value is ‘Use default’, enable dsbYouthRatioDefault. Otherwise, disabled it.
Unlock the Next button
Note
This is an automatic Qt slot executed when the title value changes.
Update layer description label
Note
This is an automatic Qt slot executed when the category selection changes.
Update layer description label
Note
This is an automatic Qt slot executed when the category selection changes.
Update layer description label
Note
This is an automatic Qt slot executed when the category selection changes.
Update purpose description label.
Note
This is an automatic Qt slot executed when the category selection changes.
Update classification description label and unlock the Next button.
Note
This is an automatic Qt slot executed when the field selection changes.
Update field description label and unlock the Next button.
Note
This is an automatic Qt slot executed when the field selection changes.
Update function description label
Note
This is an automatic Qt slot executed when the category selection changes.
Update hazard category description label.
Note
This is an automatic Qt slot executed when the category selection changes.
Update layer mode description label and unit widgets.
Note
This is an automatic Qt slot executed when the subcategory selection changes.
Update subcategory description label.
Note
This is an automatic Qt slot executed when the subcategory selection changes.
Update unit description label and field widgets.
Note
This is an automatic Qt slot executed when the unit selection changes.
Handle the Back button release.
Note
This is an automatic Qt slot executed when the Back button is released.
Handle the Next button release.
Note
This is an automatic Qt slot executed when the Next button is released.
Handle the Open Report in Web Broseer button release.
Note
This is an automatic Qt slot executed when the Next button is released.
Handle the Generate PDF button release.
Note
This is an automatic Qt slot executed when the Next button is released.
Handle the Open Report in Web Browser button release.
Note
This is an automatic Qt slot executed when the Next button is released.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Unlock the Next button
Note
This is an automatic Qt slot executed when the radiobutton is activated.
Choose selected hazard x exposure combination and go ahead.
Note
This is an automatic Qt slot executed when the category selection changes.
Choose selected hazard x exposure combination.
Note
This is an automatic Qt slot executed when the category selection changes.
Click handler for selecting hazard and exposure constraints.
Parameters: |
|
---|
Note
This is an automatic Qt slot executed when the category selection changes.
Choose selected hazard x exposure constraints combination.
Note
This is an automatic Qt slot executed when the category selection changes.
Convert layer path from QgsBrowserModel to full QgsDataSourceURI
Parameters: | path (string) – The layer path from QgsBrowserModel |
---|---|
Returns: | layer uri |
Return type: | QgsDataSourceURI |
Populate the combo box cbo_ratio_attribute for ratio_attribute_key.
Parameters: |
|
---|
Populate lstUniqueValues and treeClasses.from the parameters.
Parameters: |
|
---|
Parameters: |
|
---|
Return a list of valid purposes for the current layer.
Returns: | A list where each value represents a valid purpose. |
---|---|
Return type: | list |
Trigger MessageViewer size update on window resize
Note
This is an automatic Qt slot executed when the window size changes.
Save keywords to the layer.
It will write out the keywords for the current layer. This method is based on the KeywordsDialog class.
Obtain the allow_resampling state selected by user.
Note
Returns none if not set or not relevant
Returns: | Value of the allow_resampling or None for not-set. |
---|---|
Return type: | boolean or None |
Obtain the canvas aggregation layer selected by user.
Returns: | The currently selected map layer in the list. |
---|---|
Return type: | QgsMapLayer |
Obtain the canvas exposure layer selected by user.
Returns: | The currently selected map layer in the list. |
---|---|
Return type: | QgsMapLayer |
Obtain the canvas layer selected by user.
Returns: | The currently selected map layer in the list. |
---|---|
Return type: | QgsMapLayer |
Obtain the layer purpose selected by user.
Returns: | Metadata of the selected layer purpose. |
---|---|
Return type: | dict, None |
Obtain the classification selected by user.
Returns: | Metadata of the selected classification. |
---|---|
Return type: | dict, None |
Obtain the extra keywords selected by user.
Returns: | Metadata of the extra keywords. |
---|---|
Return type: | dict, None |
Obtain the field selected by user.
Returns: | Keyword of the selected field. |
---|---|
Return type: | string, None |
Obtain the impact function selected by user.
Returns: | metadata of the selected function. |
---|---|
Return type: | dict, None |
Obtain functions available for hazard an exposure selected by user.
Returns: | List of the available functions metadata. |
---|---|
Return type: | list, None |
Obtain functions available for hazard and exposure selected by user.
Returns: | List of the available functions metadata. |
---|---|
Return type: | list, None |
Obtain the hazard category selected by user.
Returns: | Metadata of the selected hazard category. |
---|---|
Return type: | dict, None |
Obtain impact function constraints selected by user.
Returns: | Tuple of metadata of hazard, exposure, hazard layer constraints and exposure layer constraints |
---|---|
Return type: | tuple |
Obtain the layer mode selected by user. :returns: selected layer mode. :rtype: string, None
Obtain the value-to-class mapping set by user.
Returns: | The complete mapping as a dict of lists. |
---|---|
Return type: | dict |
Obtain the subcategory selected by user.
Returns: | Metadata of the selected subcategory. |
---|---|
Return type: | dict, None |
Obtain the unit selected by user.
Returns: | Metadata of the selected unit. |
---|---|
Return type: | dict, None |
Set the Wizard to the Keywords Creation mode :param layer: Layer to set the keywords for :type layer: QgsMapLayer
Set the mode label to the Keywords Creation/Update mode
Set widgets on the Aggregation Layer From Browser tab
Set widgets on the Aggregation Layer from Canvas tab
Set widgets on the Exposure Layer From Browser tab
Set widgets on the Exposure Layer From Canvas tab
Set widgets on the Hazard Layer From Browser tab
Returns: | A list where each value represents a valid subcategory. |
---|---|
Return type: | list |
Parameters: |
|
---|---|
Returns: | The html description in tabular format, ready to use in a label or tool tip. |
Return type: | str |
Update maximumHeight size of the MessageViewer to fit its parent tab
This is a workaround for a bug that makes MessageViewer flooding up to maximumHeight on Windows.
Fix the drop flag after the item is dropped.
Check if it looks like an item dragged from QListWidget to QTreeWidget and disable the drop flag. For some reasons the flag is set when dragging.
Parameters: |
|
---|
Note
This is a slot executed when the item change.