Skip to content

Commit a69d705

Browse files
author
Daniel
committed
2 parents 2d554d5 + 030c3a2 commit a69d705

File tree

7 files changed

+38
-8
lines changed

7 files changed

+38
-8
lines changed

geovita_processing_plugin/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
__date__ = '2024-01-17'
2727
__copyright__ = '(C) 2024 by DPE'
2828

29-
__version__ = "3.1.0"
29+
__version__ = "3.1.1"
3030

3131
import sys
3232
from pathlib import Path

geovita_processing_plugin/algorithms/BegrensSkadeExcavation.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,17 @@ def __init__(self):
108108
"BegrensSkadeII_QGIS_EXCAVATION.log",
109109
"EXCAVATION_LOGGER",
110110
).get_logger()
111-
self.logger.info("__INIT__ - Finished initialize BegrensSkadeExcavation ")
111+
112+
# Retrieve version number from BaseAlgorithm class "GvBaseProcessingAlgorithms"
113+
self.version = self.getVersion()
114+
self.logger.info(f"__INIT__ - VERSION: {self.version} ")
112115

113116
# instanciate variables used in postprocessing to add layers to GUI
114117
self.feature_name = None # Default value
115118
self.layers_info = {}
116119
self.styles_dir_path = Path()
117120
self.add_layers_task = AddLayersTask()
121+
self.logger.info("__INIT__ - Finished initialize BegrensSkadeExcavation ")
118122

119123
def tr(self, string):
120124
return QCoreApplication.translate("Processing", string)
@@ -482,6 +486,9 @@ def processAlgorithm(self, parameters, context, feedback):
482486
Here is where the processing itself takes place.
483487
"""
484488
self.logger.info("PROCESS - Starting the processing")
489+
feedback.pushInfo(
490+
f"PROCESS - Version: {self.version}"
491+
)
485492
# Retrieve the feature source and sink. The 'dest_id' variable is used
486493
# to uniquely identify the feature sink, and must be included in the
487494
# dictionary returned by the processAlgorithm function.
@@ -849,7 +856,7 @@ def processAlgorithm(self, parameters, context, feedback):
849856
"shape_path": output_shapefiles[0],
850857
"style_name": "BUILDING-TOTAL-RISK-SELLMENT_risk_tots.qml",
851858
},
852-
"BUILDING-TOTAL-ANGLE": {
859+
"BUILDING-RISK-ANGLE": {
853860
"shape_path": output_shapefiles[0],
854861
"style_name": "BUILDING-TOTAL-RISK-ANGLE_risk_angle.qml",
855862
},

geovita_processing_plugin/algorithms/BegrensSkadeImpactMap.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,17 @@ def __init__(self):
107107
self.logger = CustomLogger(
108108
log_dir_path, "BegrensSkadeII_QGIS_IMPACTMAP.log", "IMPACTMAP_LOGGER"
109109
).get_logger()
110-
self.logger.info("__INIT__ - Finished initialize BegrensSkadeImpactMap ")
110+
111+
# Retrieve version number from BaseAlgorithm class "GvBaseProcessingAlgorithms"
112+
self.version = self.getVersion()
113+
self.logger.info(f"__INIT__ - VERSION: {self.version} ")
111114

112115
# instanciate variables used in postprocessing to add layers to GUI
113116
self.feature_name = None # Default value
114117
self.layers_info = {}
115118
self.styles_dir_path = Path()
116119
self.add_layers_task = AddLayersTask()
120+
self.logger.info("__INIT__ - Finished initialize BegrensSkadeImpactMap ")
117121

118122
def name(self):
119123
"""
@@ -397,6 +401,9 @@ def processAlgorithm(self, parameters, context, feedback):
397401
"""
398402
Here is where the processing itself takes place.
399403
"""
404+
feedback.pushInfo(
405+
f"PROCESS - Version: {self.version}"
406+
)
400407
bShortterm = self.parameterAsBoolean(
401408
parameters, self.SHORT_TERM_SETTLEMENT[0], context
402409
)

geovita_processing_plugin/algorithms/BegrensSkadeTunnel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,17 @@ def __init__(self):
108108
self.logger = CustomLogger(
109109
log_dir_path, "BegrensSkadeII_QGIS_TUNNEL.log", "TUNNEL_LOGGER"
110110
).get_logger()
111-
self.logger.info("__INIT__ - Finished initialize BegrensSkadeTunnel ")
111+
112+
# Retrieve version number from BaseAlgorithm class "GvBaseProcessingAlgorithms"
113+
self.version = self.getVersion()
114+
self.logger.info(f"__INIT__ - VERSION: {self.version} ")
112115

113116
# instanciate variables used in postprocessing to add layers to GUI
114117
self.feature_name = None # Default value
115118
self.layers_info = {}
116119
self.styles_dir_path = Path()
117120
self.add_layers_task = AddLayersTask()
121+
self.logger.info("__INIT__ - Finished initialize BegrensSkadeTunnel ")
118122

119123
def name(self):
120124
"""
@@ -501,6 +505,9 @@ def processAlgorithm(self, parameters, context, feedback):
501505
"""
502506
Here is where the processing itself takes place.
503507
"""
508+
feedback.pushInfo(
509+
f"PROCESS - Version: {self.version}"
510+
)
504511
bShortterm = self.parameterAsBoolean(
505512
parameters, self.SHORT_TERM_SETTLEMENT[0], context
506513
)

geovita_processing_plugin/algorithms/base_algorithm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@
3232

3333
from qgis.core import (QgsProcessingAlgorithm)
3434

35+
from geovita_processing_plugin import __version__ # Import version from package's __init__.py
36+
3537

3638
class GvBaseProcessingAlgorithms(QgsProcessingAlgorithm):
3739
"""
3840
Base class for Geovita algorithms.
39-
"""
41+
"""
42+
def getVersion(self):
43+
return __version__

geovita_processing_plugin/metadata.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name=Geovita GIS Processing provider
77
qgisMinimumVersion=3.28
88
qgisMaximumVersion=3.99
99
description=This plugin adds different Geovita custom processing algorithms to QGIS
10-
version=3.1.0
10+
version=3.1.1
1111
author=DPE
1212
1313

@@ -28,7 +28,12 @@ repository=https://github.com/danpejobo/geovita_processing_plugin
2828

2929
hasProcessingProvider=yes
3030
# Uncomment the following line and add your changelog:
31-
changelog=v.3.1.0 (14.02.2024)
31+
changelog=v.3.1.1 (04.03.2024)
32+
- Add version logging and feedback.
33+
- Fix for two layers having the same name in the excavation algorithm (thus only one showing in TOC)
34+
- Fix "label" attributes for the styles to the excavation and tunnel algorithms
35+
36+
v.3.1.0 (14.02.2024)
3237
- Minor fix in vulnerability analysis for excavation and tunnel. Fields can be omitted (i.e corresponding analysis are dropped). Any combination of the three vulnerability fields can be assessed.
3338

3439
v.3.0.0 (09.02.2024)
-11 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)