-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathidragratools_provider.py
149 lines (131 loc) · 5.46 KB
/
idragratools_provider.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# -*- coding: utf-8 -*-
"""
/***************************************************************************
IdrAgraTools
A QGIS plugin to manage water demand simulation with IdrAgra model
The plugin shares user interfaces and tools to manage water in irrigation districts
-------------------
begin : 2020-12-01
copyright : (C) 2020 by Enrico A. Chiaradia
email : enrico.chiaradia@unimi.it
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
"""
__author__ = 'Enrico A. Chiaradia'
__date__ = '2020-12-01'
__copyright__ = '(C) 2020 by Enrico A. Chiaradia'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
import os
from qgis.core import QgsProcessingProvider
from PyQt5.QtGui import QIcon
from .algs.idragra_import_from_existing_db import IdragraImportFromExistingDB
from .algs.idragra_groupstats_by_raster import IdragraGroupStatsByRaster
from .algs.idragra_import_irrunits_results import IdragraImportIrrUnitsResults
from .algs.idragra_raster_quality import IdragraRasterQuality
from .algs.idragra_annual_stats import IdragraAnnualStats
from .algs.idragra_raster_groupstats import IdragraRasterGroupStats
from .algs.idragra_import_crop_par import IdragraImportCropPar
from .algs.idragra_bulk_import_timeserie import IdragraBulkImportTimeserie
from .algs.idragra_statserie import IdragraStatserie
from .algs.idragra_export_control_points import IdragraExportControlPoints
from .algs.idragra_calc_waterdepth import IdragraCalcWaterDepth
from .algs.idragra_rasterize_time_map import IdragraRasterizeTimeMap
from .algs.idragra_rasterize_map import IdragraRasterizeMap
from .algs.idragra_saveascii import IdragraSaveAscii
from .algs.idragra_create_hsg_map import IdragraCreateHSGMap
from .algs.idragra_create_pre_hsg_table import IdragraCreatePreHSGTable
from .algs.idragra_create_caprise_table import IdragraCreateCapriseTable
from .algs.idragra_create_soilparams import IdragraSoilParams
from .algs.idragra_import_vector_map import IdragraImportVectorMap
from .algs.idragra_create_db import IdragraCreateDB
from .algs.idragra_groupstats import IdragraGroupStats
from .algs.idragra_make_slope import IdragraMakeSlope
from .algs.idragra_export_spatialdata import IdragraExportSpatialdataAlgorithm
from .algs.idragra_import_simoutput import IdragraImportSimoutput
from .algs.idragra_import_timeserie import IdragraImportTimeserie
from .algs.idragra_rasterize_maptable import IdragraRasterizeMaptable
from .algs.idragra_export_meteodata import IdragraExportMeteodata
from .algs.idragra_rasterize_domain import IdragraRasterizeDomain
from .algs.idragra_export_weights import IdragraExportWeights
from .algs.idragra_get_from_dtm import IdragraGetFromDtm
class IdrAgraToolsProvider(QgsProcessingProvider):
def __init__(self):
QgsProcessingProvider.__init__(self)
# Load algorithms
self.alglist = [IdragraExportSpatialdataAlgorithm(),
IdragraImportSimoutput(),
IdragraImportTimeserie(),
IdragraRasterizeMaptable(),
IdragraExportMeteodata(),
IdragraRasterizeDomain(),
IdragraExportWeights(),
IdragraGetFromDtm(),
IdragraMakeSlope(),
IdragraGroupStats(),
IdragraCreateDB(),
IdragraImportVectorMap(),
IdragraSoilParams(),
IdragraCreateCapriseTable(),
IdragraCreatePreHSGTable(),
IdragraCreateHSGMap(),
IdragraSaveAscii(),
IdragraRasterizeMap(),
IdragraRasterizeTimeMap(),
IdragraCalcWaterDepth(),
IdragraExportControlPoints(),
IdragraStatserie(),
IdragraBulkImportTimeserie(),
IdragraImportCropPar(),
IdragraRasterGroupStats(),
IdragraAnnualStats(),
IdragraRasterQuality(),
IdragraGroupStatsByRaster(),
IdragraImportIrrUnitsResults(),
IdragraImportFromExistingDB()
]
def unload(self):
"""
Unloads the provider. Any tear-down steps required by the provider
should be implemented here.
"""
pass
def loadAlgorithms(self):
"""
Loads all algorithms belonging to this provider.
"""
for alg in self.alglist:
self.addAlgorithm( alg )
def id(self):
"""
Returns the unique provider id, used for identifying the provider. This
string should be a unique, short, character only string, eg "qgis" or
"gdal". This string should not be localised.
"""
return 'idragratools'
def name(self):
"""
Returns the provider name, which is used to describe the provider
within the GUI.
This string should be short (e.g. "Lastools") and localised.
"""
return self.tr('IdrAgra Tools')
def longName(self):
"""
Returns the a longer version of the provider name, which can include
extra details such as version numbers. E.g. "Lastools LIDAR tools
(version 2.2.1)". This string should be localised. The default
implementation returns the same string as name().
"""
return self.tr('A set of tools to manage water in irrigation districts')
def icon(self):
self.plugin_dir = os.path.dirname(__file__)
icon = QIcon(os.path.join(self.plugin_dir, 'idragratools_provider.png'))
return icon