From da1a64aecdd578b8a889d67b6478904aa74e5e4d Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Tue, 30 Jul 2019 19:02:48 +0300 Subject: [PATCH 1/6] Update main.py --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 50e4932..a8d12a8 100644 --- a/main.py +++ b/main.py @@ -163,7 +163,7 @@ def runexp(self): if not ch: try: - group_ok = root.findGroup(root.children()[0].name()) + group_ok = root.findGroup(root.children()[0]) except: msg = QMessageBox() msg.setIcon(QMessageBox.Warning) @@ -199,7 +199,7 @@ def cancel(self): self.layer_list = [] self.layer_list = ['NONE'] for sect in self.sections: - exec ('self.dlg.sect_' + sect + '.clear()') + exec('self.dlg.sect_' + sect + '.clear()') self.dlg.close() def toolButtonOut(self): From b5c2141e973de1abf14c64ac0dd0f48f4807aa57 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Tue, 30 Jul 2019 19:02:50 +0300 Subject: [PATCH 2/6] Update metadata.txt --- metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.txt b/metadata.txt index dce54e7..55c3205 100644 --- a/metadata.txt +++ b/metadata.txt @@ -11,7 +11,7 @@ name=ImportEpanetInpFiles qgisMinimumVersion=2.99 qgisMaximumVersion=3.99 description=IMPORT/EXPORT EPANET INP Files -version=1.5 +version=1.6 author=Marios S. Kyriakou, KIOS Research and Innovation Center of Excellence (KIOS CoE) email=mkiria01@ucy.ac.cy about=This tool can be used to IMPORT EPANET INP File to shapefiles and adds them in the QGIS canvas. Also, the shapefiles stored into the _shapefiles_ folder. Can be used to EXPORT EPANET INP File. From a638222f89d06a9d84c6b565994b31f5a50b1431 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Tue, 6 Aug 2019 17:39:34 +0300 Subject: [PATCH 3/6] Update main.py --- main.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index a8d12a8..9c52911 100644 --- a/main.py +++ b/main.py @@ -174,9 +174,19 @@ def runexp(self): return self.layers = [] - for lyr in group_ok.findLayers(): - if lyr.itemVisibilityChecked(): - self.layers.append(lyr.layer()) + try: + for lyr in group_ok.findLayers(): + if lyr.itemVisibilityChecked(): + self.layers.append(lyr.layer()) + except: + msg = QMessageBox() + msg.setIcon(QMessageBox.Warning) + msg.setWindowTitle('Export INP File') + msg.setText("Please check a group.") + msg.setStandardButtons(QMessageBox.Ok) + msg.exec_() + return + #self.layers = [lyr.layer() for lyr in group_ok.findLayers()] #[layer for layer in QgsProject.instance().mapLayers().values()]#self.canvas.layers() self.layer_list = [] self.layer_list = ['NONE'] From 2b35d4ab650d0bac32f457db09ee1412ca8548b2 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Tue, 6 Aug 2019 17:42:09 +0300 Subject: [PATCH 4/6] minor fix --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 9c52911..97eb4c2 100644 --- a/main.py +++ b/main.py @@ -163,7 +163,7 @@ def runexp(self): if not ch: try: - group_ok = root.findGroup(root.children()[0]) + group_ok = root.findGroup(root.children()[0].name()) except: msg = QMessageBox() msg.setIcon(QMessageBox.Warning) From 227f06901625b96912a7722d8c43a3ef6f6f33c6 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Wed, 7 Aug 2019 21:51:01 +0300 Subject: [PATCH 5/6] initialize descriptions --- metadata.txt | 4 +++- readEpanetFile.py | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/metadata.txt b/metadata.txt index 55c3205..7343cb4 100644 --- a/metadata.txt +++ b/metadata.txt @@ -21,7 +21,9 @@ about=This tool can be used to IMPORT EPANET INP File to shapefiles and adds the # Optional items: # Uncomment the following line and add your changelog: -changelog=2019-06-16 ImportEpanetInpFiles 1.5: +changelog=2019-08-07 ImportEpanetInpFiles 1.6: + Fix bug in descriptions field + 2019-06-16 ImportEpanetInpFiles 1.5: Fixed issue with curve types, fixed issue when export inp, support more demand categories (Thanks to Paulos Paulou @ppavlo02) Add selector for coordinate system when Import or Export EPANET files. 2018-06-14 ImportEpanetInpFiles 1.4: diff --git a/readEpanetFile.py b/readEpanetFile.py index 8438d6d..2056ff1 100644 --- a/readEpanetFile.py +++ b/readEpanetFile.py @@ -453,7 +453,7 @@ def getBinInfo(): nodeJunctionNameID = [] nodeJunctionElevations = [] - nodeJunctionDescription = [] + nodeJunctionDescription = [''] nodeJunctionBaseDemands = [] nodeJunctionsDemSection = [] @@ -463,7 +463,7 @@ def getBinInfo(): nodePatternNameID = [] nodeReservoirNameID = [] nodeReservoirElevations = [] - nodeReservoirDescription = [] + nodeReservoirDescription = [''] BinNodeTankNameID = [] BinNodeTankElevation = [] @@ -473,7 +473,7 @@ def getBinInfo(): BinNodeTankDiameter = [] BinNodeTankMinVol = [] BinNodeTankVolumeCurveID = [] - BinNodeTankDescription = [] + BinNodeTankDescription = [''] BinLinkPipeNameID = [] BinLinkFromNode = [] @@ -482,7 +482,7 @@ def getBinInfo(): BinLinkPipeDiameters = [] BinLinkPipeRoughness = [] BinLinkPipeMinorLoss = [] - BinLinkPipeDescription = [] + BinLinkPipeDescription = [''] BinLinkPumpPatterns = [] BinLinkPumpCurveNameID = [] @@ -491,7 +491,7 @@ def getBinInfo(): BinLinkPumpNameID = [] BinLinkPumpSpeed = [] BinLinkPumpPatternsPumpID = [] - BinLinkPumpDescription = [] + BinLinkPumpDescription = [''] BinLinkValveNameID = [] @@ -499,7 +499,7 @@ def getBinInfo(): BinLinkValveType = [] BinLinkValveSetting = [] BinLinkValveMinorLoss = [] - BinLinkValveDescription = [] + BinLinkValveDescription = [''] BinLinkInitialStatus = [] BinLinkInitialStatusNameID = [] From bff8245f0a4799afc9f19320eae023af8804c916 Mon Sep 17 00:00:00 2001 From: mariosmsk Date: Tue, 29 Oct 2019 14:27:44 +0200 Subject: [PATCH 6/6] fix ignore first decription --- readEpanetFile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readEpanetFile.py b/readEpanetFile.py index 2056ff1..8438d6d 100644 --- a/readEpanetFile.py +++ b/readEpanetFile.py @@ -453,7 +453,7 @@ def getBinInfo(): nodeJunctionNameID = [] nodeJunctionElevations = [] - nodeJunctionDescription = [''] + nodeJunctionDescription = [] nodeJunctionBaseDemands = [] nodeJunctionsDemSection = [] @@ -463,7 +463,7 @@ def getBinInfo(): nodePatternNameID = [] nodeReservoirNameID = [] nodeReservoirElevations = [] - nodeReservoirDescription = [''] + nodeReservoirDescription = [] BinNodeTankNameID = [] BinNodeTankElevation = [] @@ -473,7 +473,7 @@ def getBinInfo(): BinNodeTankDiameter = [] BinNodeTankMinVol = [] BinNodeTankVolumeCurveID = [] - BinNodeTankDescription = [''] + BinNodeTankDescription = [] BinLinkPipeNameID = [] BinLinkFromNode = [] @@ -482,7 +482,7 @@ def getBinInfo(): BinLinkPipeDiameters = [] BinLinkPipeRoughness = [] BinLinkPipeMinorLoss = [] - BinLinkPipeDescription = [''] + BinLinkPipeDescription = [] BinLinkPumpPatterns = [] BinLinkPumpCurveNameID = [] @@ -491,7 +491,7 @@ def getBinInfo(): BinLinkPumpNameID = [] BinLinkPumpSpeed = [] BinLinkPumpPatternsPumpID = [] - BinLinkPumpDescription = [''] + BinLinkPumpDescription = [] BinLinkValveNameID = [] @@ -499,7 +499,7 @@ def getBinInfo(): BinLinkValveType = [] BinLinkValveSetting = [] BinLinkValveMinorLoss = [] - BinLinkValveDescription = [''] + BinLinkValveDescription = [] BinLinkInitialStatus = [] BinLinkInitialStatusNameID = []