geodatafarm package¶
Module contents¶
- /***********************************************************************
GeoDataFarm
A QGIS plugin This is a plugin that aims to determine the yield impact of different parameters
begin : 2016-10-24 copyright : (C) 2016 by Axel Horteborn email : geodatafarm@gmail.com git sha : https://github.com/axelande/geodatafarm3 ***********************************************************************/
- /***********************************************************************
- 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. *
***********************************************************************/
This script initializes the plugin, making it known to QGIS.
-
geodatafarm.
classFactory
(iface)¶ Load GeoDataFarm class from file GeoDataFarm.
Parameters: iface (QgsInterface) – A QGIS interface instance.
Submodules¶
geodatafarm.geodatafarm module¶
- /***********************************************************************
- GeoDataFarm
- A QGIS plugin
- This is a plugin that aims to determine the yield impact of different parameters
begin : 2016-05-13 git sha : $Format:%H$ copyright : (C) 2016 by Axel Horteborn email : geodatafarm@gmail.com
***********************************************************************/
- /***********************************************************************
- 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. *
***********************************************************************/
-
class
geodatafarm.GeoDataFarm.
GeoDataFarm
(iface)¶ Bases:
object
QGIS Plugin Implementation.
-
add_action
(icon_path, text, callback, enabled_flag=True, add_to_menu=True, add_to_toolbar=True, status_tip=None, whats_this=None, parent=None)¶ Add a toolbar icon to the toolbar.
Parameters: - icon_path (str) – Path to the icon for this action. Can be a resource path (e.g. ‘:/plugins/foo/bar.png’) or a normal file system path.
- text (str) – Text that should be shown in menu items for this action.
- callback (function) – Function to be called when the action is triggered.
- enabled_flag (bool) – A flag indicating if the action should be enabled by default. Defaults to True.
- add_to_menu (bool) – Flag indicating whether the action should also be added to the menu. Defaults to True.
- add_to_toolbar (bool) – Flag indicating whether the action should also be added to the toolbar. Defaults to True.
- status_tip (str) – Optional text to show in a popup when mouse pointer hovers over the action.
- parent (QWidget) – Parent widget for the new action. Defaults None.
- whats_this (str) – Optional text to show in the status bar when the mouse pointer hovers over the action.
Returns: The action that was created. Note that the action is also added to self.actions list.
Return type: QAction
-
add_crop
()¶ Adds a crop to the database
-
add_selected_tables
()¶ Adds a layer for each “parameter” of all selected tables
-
clicked_create_farm
()¶ Connects the docked widget with the CreateFarm script and starts the create_farm widget
-
connect_to_farm
()¶ Connects the docked widget with the CreateFarm script and starts the connect to farm widget
-
create_guide
()¶ Opens the create guide file widget
-
get_database_connection
()¶ Connects to the database and create the db object
-
import_irrigation
()¶ Opens the irrigation handler widget
-
initGui
()¶ Create the menu entries and toolbar icons inside the QGIS GUI.
-
multi_edit
()¶ Opens the multi edit widget
-
onClosePlugin
()¶ Cleanup necessary items here when plugin dock_widget is closed
-
reload_layer
()¶ Reloads a layer be create a CreateLayer object and call the function repaint_layer
-
reload_range
()¶ Reload the range of the lowest and highest value of the layer
-
run
()¶ Run method that loads and starts the plugin
-
run_analyse
()¶ Gathers the parameters and start the analyse dialog
Since most functions are dependent on that a database connections exist the buttons are set when a connection is set.
-
tbl_mgmt
()¶ Open the table manager widget
-
tr
(message)¶ Get the translation for a string using Qt translation API. We implement this ourselves since we do not inherit QObject.
Parameters: message (str, String for translation.) – Returns: Translated version of message. Return type: QString
-
unload
()¶ Removes the plugin menu item and icon from QGIS GUI.
-