diff --git a/config/giswater.config b/config/giswater.config
index ab7816de1..709823a03 100644
--- a/config/giswater.config
+++ b/config/giswater.config
@@ -23,7 +23,7 @@ edit = 01, 02, 16, 17, 28, 44, 20, 68, 69, 39, 34, 66, 33, 67
cad = 71, 72
epa = 218, 23, 25, 29, 215
plan = 45, 46, 50
-utilities = 206, 99, 83, 58, 214, 59
+utilities = 99, 206, 214, 58, 83, 59
toc = 306
[project_exclusive]
diff --git a/config/user_params.config b/config/user_params.config
index 5c7377644..16433b7a6 100644
--- a/config/user_params.config
+++ b/config/user_params.config
@@ -681,7 +681,7 @@ _gw_fct_create_empty_dscenario_rbt_previous = None
_gw_fct_create_empty_dscenario_name = None
_gw_fct_create_empty_dscenario_descript = None
_gw_fct_create_empty_dscenario_type = None
-_gw_fct_create_empty_dscenario_active = None
+_gw_fct_create_empty_dscenario_active = True
_gw_fct_create_empty_dscenario_expl = None
_gw_fct_create_empty_dscenario_parent = None
_gw_fct_admin_manage_migra_cmb_feature_type = None
@@ -704,7 +704,7 @@ _gw_fct_duplicate_dscenario_name = None
_gw_fct_duplicate_dscenario_descript = None
_gw_fct_duplicate_dscenario_parent = None
_gw_fct_duplicate_dscenario_type = None
-_gw_fct_duplicate_dscenario_active = None
+_gw_fct_duplicate_dscenario_active = True
_gw_fct_duplicate_dscenario_expl = None
_gw_fct_duplicate_dscenario_copyfrom = None
_gw_fct_create_dscenario_from_mincut_cmb_feature_type = None
diff --git a/core/admin/admin_btn.py b/core/admin/admin_btn.py
index 88618c153..95ae962d5 100644
--- a/core/admin/admin_btn.py
+++ b/core/admin/admin_btn.py
@@ -2022,13 +2022,14 @@ def _execute_import_inp(self, accepted, project_name, project_type):
if complet_result['status'] == 'Failed':
msg = f'The importation process has failed!'
- if 'replace' in complet_result['body']['data']:
+ replace = complet_result['body']['data'].get('replace')
+ if replace is not None:
msg += f'
This can be fixed in the next dialog.'
msg += f'
See Info log for more details.'
self._set_log_text(self.dlg_import_inp, complet_result['body']['data'])
tools_qt.show_info_box(msg, "Info")
- if 'replace' in complet_result['body']['data']:
- retry = self._build_replace_dlg(complet_result['body']['data']['replace'])
+ if replace is not None:
+ retry = self._build_replace_dlg(replace)
if retry:
sql = "DELETE FROM temp_csv WHERE fid = 239;"
tools_db.execute_sql(sql, commit=False)
@@ -2155,7 +2156,7 @@ def _dlg_replace_accept(self):
self.dlg_replace.findChild(QLineEdit, f'{old}').setToolTip('Another object has this name')
valid, all_valid = False, False
except Exception as e:
- print(f"{type(e).__name__}: {e}")
+ tools_log.log_info(f"{type(e).__name__} --> {e}")
if valid:
news.append(new)
tools_qt.set_stylesheet(self.dlg_replace.findChild(QLineEdit, f'{old}'), style="")
@@ -2968,14 +2969,16 @@ def _manage_result_message(self, status, msg_ok=None, msg_error=None, parameter=
def _manage_json_message(self, json_result, parameter=None, title=None):
""" Manage message depending result @status """
- if 'message' in json_result:
+ message = json_result.get('message')
+ if message:
- level = 1
- if 'level' in json_result['message']:
- level = int(json_result['message']['level'])
- if 'text' in json_result['message']:
- msg = json_result['message']['text']
+ level = message.get('level')
+ if level is not None:
+ level = int(level)
else:
+ level = 1
+ msg = message.get('text')
+ if msg is None:
msg = "Key on returned json from ddbb is missed"
tools_qgis.show_message(msg, level, parameter=parameter, title=title)
diff --git a/core/load_project.py b/core/load_project.py
index c71dfa043..5a884b258 100644
--- a/core/load_project.py
+++ b/core/load_project.py
@@ -82,10 +82,8 @@ def project_read(self, show_warning=True):
# Removes all deprecated variables defined at giswater.config
tools_gw.remove_deprecated_config_vars()
-
- # Manage variables not configured
- if 'project_role' not in global_vars.project_vars or ('project_role' in global_vars.project_vars and global_vars.project_vars['project_role'] in (None, '')):
- global_vars.project_vars['project_role'] = tools_gw.get_role_permissions(None)
+ project_role = global_vars.project_vars.get('project_role')
+ global_vars.project_vars['project_role'] = tools_gw.get_role_permissions(project_role)
# Check if user has config files 'init' and 'session' and its parameters
tools_gw.user_params_to_userconfig()
@@ -124,8 +122,15 @@ def project_read(self, show_warning=True):
# Create menu
tools_gw.create_giswater_menu(True)
+ # Get 'utils_use_gw_snapping' parameter
+ use_gw_snapping = tools_gw.get_config_value('utils_use_gw_snapping', table='config_param_system')
+ if use_gw_snapping:
+ use_gw_snapping = tools_os.set_boolean(use_gw_snapping[0])
+ global_vars.use_gw_snapping = use_gw_snapping
+
# Manage snapping layers
- self._manage_snapping_layers()
+ if global_vars.use_gw_snapping is True:
+ self._manage_snapping_layers()
# Manage actions of the different plugin_toolbars
self._manage_toolbars()
@@ -158,6 +163,23 @@ def project_read(self, show_warning=True):
# Manage versions of Giswater and PostgreSQL
plugin_version = tools_qgis.get_plugin_metadata('version', 0, global_vars.plugin_dir)
project_version = tools_gw.get_project_version(schema_name)
+ # Only get the x.y.zzz, not x.y.zzz.n
+ try:
+ plugin_version_l = str(plugin_version).split('.')
+ if len(plugin_version_l) >= 4:
+ plugin_version = f'{plugin_version_l[0]}'
+ for i in range(1, 3):
+ plugin_version = f"{plugin_version}.{plugin_version_l[i]}"
+ except Exception:
+ pass
+ try:
+ project_version_l = str(project_version).split('.')
+ if len(project_version_l) >= 4:
+ project_version = f'{project_version_l[0]}'
+ for i in range(1, 3):
+ project_version = f"{project_version}.{project_version_l[i]}"
+ except Exception:
+ pass
if project_version == plugin_version:
message = "Project read finished"
tools_log.log_info(message)
@@ -292,17 +314,13 @@ def _check_layers_from_distinct_schema(self):
repeated_layers[layer_source['schema'].replace('"', '')] = 'v_edit_node'
if len(repeated_layers) > 1:
- if global_vars.project_vars['main_schema'] is None or global_vars.project_vars['add_schema'] is None:
- self.dlg_dtext = GwDialogTextUi()
- self.dlg_dtext.btn_accept.hide()
- self.dlg_dtext.btn_close.clicked.connect(lambda: self.dlg_dtext.close())
+ if global_vars.project_vars['main_schema'] in (None, '', 'null', 'NULL') \
+ or global_vars.project_vars['add_schema'] in (None, '', 'null', 'NULL'):
msg = "QGIS project has more than one v_edit_node layer coming from different schemas. " \
"If you are looking to manage two schemas, it is mandatory to define which is the master and " \
"which isn't. To do this, you need to configure the QGIS project setting this project's " \
"variables: gwMainSchema and gwAddSchema."
-
- self.dlg_dtext.txt_infolog.setText(msg)
- self.dlg_dtext.open()
+ tools_qt.show_info_box(msg)
return False
# If there are layers with a different schema, the one that the user has in the project variable
@@ -475,9 +493,11 @@ def _config_layers(self):
status, result = self._manage_layers()
if not status:
return False
- if result and 'variables' in result['body']:
- if 'setQgisLayers' in result['body']['variables']:
- if result['body']['variables']['setQgisLayers'] in (False, 'False', 'false'):
+ if result:
+ variables = result['body'].get('variables')
+ if variables:
+ setQgisLayers = variables.get('setQgisLayers')
+ if setQgisLayers in (False, 'False', 'false'):
return
# Set project layers with gw_fct_getinfofromid: This process takes time for user
@@ -524,12 +544,12 @@ def _manage_layers(self):
# check project
status, result = self.check_project.fill_check_project_table(layers, "true")
try:
- if 'variables' in result['body']:
- if 'useGuideMap' in result['body']['variables']:
- guided_map = result['body']['variables']['useGuideMap']
- if guided_map:
- tools_log.log_info("manage_guided_map")
- self._manage_guided_map()
+ variables = result['body'].get('variables')
+ if variables:
+ guided_map = variables.get('useGuidedMap')
+ if guided_map:
+ tools_log.log_info("manage_guided_map")
+ self._manage_guided_map()
except Exception as e:
tools_log.log_info(str(e))
finally:
diff --git a/core/shared/catalog.py b/core/shared/catalog.py
index a9b57ff81..07809e6d2 100644
--- a/core/shared/catalog.py
+++ b/core/shared/catalog.py
@@ -181,8 +181,7 @@ def _add_combobox(self, field):
widget.setObjectName(field['columnname'])
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred)
self._fill_combo(widget, field)
- if 'selectedId' in field:
- tools_qt.set_combo_value(widget, field['selectedId'], 0)
+ tools_qt.set_combo_value(widget, field.get('selectedId'), 0)
return widget
@@ -199,10 +198,12 @@ def _fill_combo(self, widget, field):
widget.clear()
widget.blockSignals(False)
combolist = []
- if 'comboIds' in field:
- for i in range(0, len(field['comboIds'])):
- if field['comboIds'][i] is not None and field['comboNames'][i] is not None:
- elem = [field['comboIds'][i], field['comboNames'][i]]
+ comboIds = field.get('comboIds')
+ comboNames = field.get('comboNames')
+ if None not in (comboIds, comboNames):
+ for i in range(0, len(comboIds)):
+ if comboIds[i] is not None and comboNames[i] is not None:
+ elem = [comboIds[i], comboNames[i]]
combolist.append(elem)
records_sorted = sorted(combolist, key=operator.itemgetter(1))
# Populate combo
@@ -227,7 +228,7 @@ def _fill_geomcat_id(self, previous_dialog, widget_name):
widget.setFocus()
else:
message = "Widget not found"
- tools_qgis.show_message(message, 2, parameter=str(widget_name))
+ tools_qgis.show_message(message, 2, parameter=str(widget_name), dialog=previous_dialog)
tools_gw.close_dialog(self.dlg_catalog)
diff --git a/core/shared/dimensioning.py b/core/shared/dimensioning.py
index d27df6790..31d9b287f 100644
--- a/core/shared/dimensioning.py
+++ b/core/shared/dimensioning.py
@@ -101,7 +101,7 @@ def open_dimensioning_form(self, qgis_feature=None, layer=None, db_return=None,
layout_list = []
for field in db_return['body']['data']['fields']:
- if 'hidden' in field and field['hidden']:
+ if field.get('hidden'):
continue
label, widget = self._set_widgets(self.dlg_dim, db_return, field)
@@ -461,10 +461,12 @@ def _set_widgets(self, dialog, db_return, field):
label = QLabel()
label.setObjectName('lbl_' + field['widgetname'])
label.setText(field['label'].capitalize())
- if 'stylesheet' in field and field['stylesheet'] is not None and 'label' in field['stylesheet']:
+ stylesheet = field.get('stylesheet')
+ if stylesheet and 'label' in stylesheet:
label = tools_gw.set_stylesheet(field, label)
- if 'tooltip' in field:
- label.setToolTip(field['tooltip'])
+ tooltip = field.get('tooltip')
+ if tooltip:
+ label.setToolTip(tooltip)
else:
label.setToolTip(field['label'].capitalize())
if field['widgettype'] == 'text' or field['widgettype'] == 'typeahead':
diff --git a/core/shared/document.py b/core/shared/document.py
index bfb13cd9b..3f2aa9b99 100644
--- a/core/shared/document.py
+++ b/core/shared/document.py
@@ -255,7 +255,7 @@ def _manage_document_accept(self, table_object, tablename=None, qtable=None, ite
if doc_type in (None, '', -1):
message = "You need to insert doc_type"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_add_doc)
return
# Check if this document already exists
@@ -374,7 +374,7 @@ def _open_selected_object_document(self, dialog, widget, table_object):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
row = selected_list[0].row()
diff --git a/core/shared/element.py b/core/shared/element.py
index fc5e8e7c0..e3283c987 100644
--- a/core/shared/element.py
+++ b/core/shared/element.py
@@ -388,15 +388,15 @@ def _manage_element_accept(self, table_object):
# Check mandatory fields
message = "You need to insert value for field"
if elementcat_id == '':
- tools_qgis.show_warning(message, parameter="elementcat_id")
+ tools_qgis.show_warning(message, parameter="elementcat_id", dialog=self.dlg_add_element)
return
num_elements = tools_qt.get_text(self.dlg_add_element, "num_elements", return_string_null=False)
if num_elements == '':
- tools_qgis.show_warning(message, parameter="num_elements")
+ tools_qgis.show_warning(message, parameter="num_elements", dialog=self.dlg_add_element)
return
state = tools_qt.get_combo_value(self.dlg_add_element, self.dlg_add_element.state)
if state == '':
- tools_qgis.show_warning(message, parameter="state_id")
+ tools_qgis.show_warning(message, parameter="state_id", dialog=self.dlg_add_element)
return
state_type = tools_qt.get_combo_value(self.dlg_add_element, self.dlg_add_element.state_type)
@@ -571,7 +571,7 @@ def _open_selected_object_element(self, dialog, widget, table_object):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
row = selected_list[0].row()
diff --git a/core/shared/info.py b/core/shared/info.py
index 7e4f6eeea..891bb4658 100644
--- a/core/shared/info.py
+++ b/core/shared/info.py
@@ -378,7 +378,7 @@ def _manage_new_feature(self, complet_result, dialog):
else:
if widget is None:
msg = f"Widget {field['columnname']} is not configured or have a bad config"
- tools_qgis.show_message(msg)
+ tools_qgis.show_message(msg, dialog=dialog)
if str(value) not in ('', None, -1, "None", "-1") and widget.property('columnname'):
self.my_json[str(widget.property('columnname'))] = str(value)
@@ -645,11 +645,19 @@ def _manage_dlg_widgets(self, complet_result, result, new_feature):
# Take the QGridLayout with the intention of adding a QSpacerItem later
if layout not in layout_list and layout.objectName() not in ('lyt_top_1', 'lyt_bot_1', 'lyt_bot_2'):
layout_list.append(layout)
- if field['layoutname'] in ('lyt_top_1', 'lyt_bot_1', 'lyt_bot_2'):
+ if field['layoutorder'] is None:
+ message = "The field layoutorder is not configured for"
+ msg = f"formname:{self.tablename}, columnname:{field['columnname']}"
+ tools_qgis.show_message(message, 2, parameter=msg, dialog=self.dlg_cf)
+ elif field['layoutname'] in ('lyt_top_1', 'lyt_bot_1', 'lyt_bot_2'):
layout.addWidget(label, 0, field['layoutorder'])
layout.addWidget(widget, 1, field['layoutorder'])
else:
tools_gw.add_widget(self.dlg_cf, field, label, widget)
+ elif field['layoutname'] != 'lyt_none':
+ message = "The field layoutname is not configured for"
+ msg = f"formname:{self.tablename}, columnname:{field['columnname']}"
+ tools_qgis.show_message(message, 2, parameter=msg, dialog=self.dlg_cf)
# Add a QSpacerItem into each QGridLayout of the list
for layout in layout_list:
vertical_spacer1 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
@@ -734,7 +742,7 @@ def action_open_link(self):
path = widget.text()
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_cf)
except Exception:
pass
@@ -1522,7 +1530,7 @@ def _manage_tableView(self, **kwargs)
if 'widgettype' in field and not field['widgettype']:
message = "The field widgettype is not configured for"
msg = f"formname:{self.tablename}, columnname:{field['columnname']}"
- tools_qgis.show_message(message, 2, parameter=msg)
+ tools_qgis.show_message(message, 2, parameter=msg, dialog=dialog)
return label, widget
try:
@@ -1531,7 +1539,7 @@ def _manage_tableView(self, **kwargs)
except Exception as e:
msg = (f"{type(e).__name__}: {e} WHERE columname='{field['columnname']}' "
f"AND widgetname='{field['widgetname']}' AND widgettype='{field['widgettype']}'")
- tools_qgis.show_message(msg, 2)
+ tools_qgis.show_message(msg, 2, dialog=dialog)
return label, widget
return label, widget
@@ -1833,7 +1841,7 @@ def _accept(self, dialog, complet_result, _json, p_widget=None, clear_json=False
if list_mandatory:
msg = "Some mandatory values are missing. Please check the widgets marked in red."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
tools_qt.set_action_checked("actionEdit", True, dialog)
QgsProject.instance().blockSignals(False)
return False
@@ -1920,7 +1928,7 @@ def _accept(self, dialog, complet_result, _json, p_widget=None, clear_json=False
msg_level = json_result['message']['level']
if msg_level is None:
msg_level = 1
- tools_qgis.show_message(msg_text, message_level=msg_level)
+ tools_qgis.show_message(msg_text, message_level=msg_level, dialog=dialog)
self._reload_fields(dialog, json_result, p_widget)
if thread:
@@ -2261,7 +2269,7 @@ def _run_settopology(self, widget, **kwargs):
if json_response and json_response['status'] != "Failed":
# Refresh canvas & send a message
tools_qgis.refresh_map_canvas()
- tools_qgis.show_info("Node set correctly")
+ tools_qgis.show_info("Node set correctly", dialog=dialog)
# Delete lineedit
widget.deleteLater()
@@ -2275,7 +2283,7 @@ def _run_settopology(self, widget, **kwargs):
if layout is not None:
layout.addWidget(new_widget, int(field['layoutorder']), 2)
return
- tools_qgis.show_warning("Error setting node")
+ tools_qgis.show_warning("Error setting node", dialog=dialog)
def _open_catalog(self, tab_type, feature_type, child_type):
@@ -2335,7 +2343,7 @@ def _check_elev_y(self):
has_y = (row[0], row[1]) != (None, None)
has_elev = (row[2], row[3]) != (None, None)
if has_y and has_elev:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return False
fields2 = 'y2, custom_y2, elev2, custom_elev2'
@@ -2345,7 +2353,7 @@ def _check_elev_y(self):
has_y = (row[0], row[1]) != (None, None)
has_elev = (row[2], row[3]) != (None, None)
if has_y and has_elev:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return False
# NODE
elif self.feature_type == 'node':
@@ -2358,7 +2366,7 @@ def _check_elev_y(self):
has_elev = (row[2], row[3]) != (None, None)
has_top_elev = (row[4], row[5]) != (None, None)
if False not in (has_y, has_elev, has_top_elev):
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return False
return True
@@ -2394,14 +2402,14 @@ def _has_elev_and_y_json(self, _json):
has_elev = self._has_elev(arc_n=k[-1:])
if has_elev:
msg = f"This feature already has ELEV values! Review it and use only one"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return has_elev
# If edited field is ELEV check if feature has Y field
if 'elev' in k:
has_y = self._has_y(arc_n=k[-1:])
if has_y:
msg = f"This feature already has Y values! Review it and use only one"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return has_y
elif self.feature_type == 'node':
# If edited field is Y check if feature has ELEV & TOP_ELEV field
@@ -2410,7 +2418,7 @@ def _has_elev_and_y_json(self, _json):
has_top_elev = self._has_top_elev()
if has_elev and has_top_elev:
msg = f"This feature already has ELEV & TOP_ELEV values! Review it and use at most two"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return has_elev and has_top_elev
# If edited field is TOP_ELEV check if feature has Y & ELEV field
if 'top_elev' in k:
@@ -2418,7 +2426,7 @@ def _has_elev_and_y_json(self, _json):
has_elev = self._has_elev()
if has_y and has_elev:
msg = f"This feature already has Y & ELEV values! Review it and use at most two"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return has_y and has_elev
# If edited field is ELEV check if feature has Y & TOP_ELEV field
elif 'elev' in k:
@@ -2426,7 +2434,7 @@ def _has_elev_and_y_json(self, _json):
has_top_elev = self._has_top_elev()
if has_y and has_top_elev:
msg = f"This feature already has Y & TOP_ELEV values! Review it and use at most two"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return has_y and has_top_elev
return False
@@ -2455,15 +2463,15 @@ def _has_elev_y_json(self, _json, modified):
continue
if 'ymax' in k:
if has_elev and has_top_elev:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
if 'top_elev' in k:
if has_elev and has_ymax:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
elif 'elev' in k:
if has_top_elev and has_ymax:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
return False
@@ -2492,19 +2500,19 @@ def _has_elev_y_json(self, _json, modified):
continue
if 'y1' in k:
if has_elev1:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
if 'elev1' in k:
if has_y1:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
if 'y2' in k:
if has_elev2:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
if 'elev2' in k:
if has_y2:
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return True
return False
@@ -2664,7 +2672,7 @@ def _open_selected_element(self, dialog, widget):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
element_id = ""
@@ -2684,7 +2692,7 @@ def _add_object(self, widget, table_object, view_object):
object_id = tools_qt.get_text(self.dlg_cf, table_object + "_id")
if object_id == 'null':
message = "You need to insert data"
- tools_qgis.show_warning(message, parameter=table_object + "_id")
+ tools_qgis.show_warning(message, parameter=table_object + "_id", dialog=self.dlg_cf)
return
# Check if this object exists
@@ -2693,7 +2701,7 @@ def _add_object(self, widget, table_object, view_object):
" WHERE " + field_object_id + " = '" + object_id + "'")
row = tools_db.get_row(sql)
if not row:
- tools_qgis.show_warning("Object id not found", parameter=object_id)
+ tools_qgis.show_warning("Object id not found", parameter=object_id, dialog=self.dlg_cf)
return
# Check if this object is already associated to current feature
@@ -2708,7 +2716,7 @@ def _add_object(self, widget, table_object, view_object):
# If object already exist show warning message
if row:
message = "Object already associated with this feature"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
# If object not exist perform an INSERT
else:
@@ -2731,7 +2739,7 @@ def _delete_records(self, widget, table_name):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
inf_text = ""
@@ -2827,7 +2835,7 @@ def _open_selected_feature(self, qtable):
selected_list = qtable.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
row = selected_list[0].row()
@@ -2885,7 +2893,7 @@ def _open_selected_hydro(self, qtable=None):
selected_list = qtable.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
index = selected_list[0]
@@ -2909,7 +2917,7 @@ def _check_url(self):
selected_list = self.tbl_hydrometer.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
row = selected_list[0].row()
@@ -2917,7 +2925,7 @@ def _check_url(self):
if url != '':
status, message = tools_os.open_file(url)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=url)
+ tools_qgis.show_warning(message, parameter=url, dialog=self.dlg_cf)
def _fill_tbl_hydrometer(self, qtable, table_name):
@@ -3033,7 +3041,7 @@ def _fill_tbl_visit(self, widget, table_name, filter_, geom_type):
date_to = self.date_visit_to.date().toString('yyyyMMdd 23:59:59')
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
# Fill ComboBox cmb_visit_class
@@ -3080,7 +3088,7 @@ def _open_generic_visit(self, widget, table_name):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
visit_id = ""
@@ -3116,7 +3124,7 @@ def _set_filter_table_visit(self, widget, table_name, visit_class=False, column_
date_to = self.date_visit_to.date().toString('yyyyMMdd 23:59:59')
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
if type(table_name) is dict:
@@ -3217,7 +3225,7 @@ def _open_visit_files(self):
# Open selected document
status, message = tools_os.open_file(path[0])
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path[0])
+ tools_qgis.show_warning(message, parameter=path[0], dialog=self.dlg_cf)
def _open_visit_intervals(self):
@@ -3388,7 +3396,7 @@ def _open_visit_event(self):
widget.setStyleSheet("QWidget { background: rgb(242, 242, 242);"
" color: rgb(100, 100, 100)}")
self.dlg_event_full.btn_close.clicked.connect(partial(tools_gw.close_dialog, self.dlg_event_full))
- self.dlg_event_full.tbl_docs_x_event.doubleClicked.connect(self._open_file)
+ self.dlg_event_full.tbl_docs_x_event.doubleClicked.connect(partial(self._open_file, self.dlg_event_full))
tools_qt.set_tableview_config(self.dlg_event_full.tbl_docs_x_event)
tools_gw.open_dialog(self.dlg_event_full, 'visit_event_full')
@@ -3429,7 +3437,7 @@ def _populate_tbl_docs_x_event(self):
model.appendRow(item)
- def _open_file(self):
+ def _open_file(self, dialog):
# Get row index
index = self.dlg_event_full.tbl_docs_x_event.selectionModel().selectedRows()[0]
@@ -3437,7 +3445,7 @@ def _open_file(self):
path = index.sibling(index.row(), column_index).data()
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=dialog)
def _tbl_event_clicked(self, table_name):
@@ -3482,7 +3490,7 @@ def _set_filter_table_event(self, widget):
date_to = visit_end.toString('yyyyMMdd 23:59:59')
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
# Cascade filter
@@ -3535,7 +3543,7 @@ def _set_filter_table_event2(self, widget):
date_to = visit_end.toString('yyyyMMdd 23:59:59')
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
format_low = 'yyyy-MM-dd 00:00:00.000'
@@ -3582,7 +3590,7 @@ def _new_visit(self):
expl_id = tools_qt.get_combo_value(self.dlg_cf, self.tab_type + '_expl_id', 0)
if expl_id == -1:
msg = "Widget expl_id not found"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_cf)
return
manage_visit = GwVisit()
@@ -3640,11 +3648,11 @@ def _open_visit_doc(self):
if not os.path.exists(path):
message = "File not found"
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_cf)
else:
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_cf)
else:
# If more then one document is attached open dialog with list of documents
@@ -3734,7 +3742,7 @@ def _fill_tbl_document_man(self, dialog, widget, table_name, expr_filter):
# Set model of selected widget
message = tools_qt.fill_table(widget, f"{self.schema_name}.{table_name}", expr_filter)
if message:
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
# Set signals
doc_type.currentIndexChanged.connect(partial(self._set_filter_table_man, widget))
@@ -3769,7 +3777,7 @@ def _set_filter_table_man(self, widget):
date_to = self.date_document_to.date()
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
# Create interval dates
@@ -3798,11 +3806,11 @@ def _open_selected_document(self, widget):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
elif len(selected_list) > 1:
message = "Select just one document"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
# Get document path (can be relative or absolute)
@@ -3810,7 +3818,7 @@ def _open_selected_document(self, widget):
path = widget.model().record(row).value("path")
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_cf)
def _manage_new_document(self, dialog, doc_id=None, feature=None):
@@ -3980,7 +3988,7 @@ def _open_rpt_result(self, qtable, complet_list):
selected_list = qtable.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_cf)
return
index = selected_list[0]
@@ -4022,7 +4030,7 @@ def _fill_tab_plan(self, complet_result):
result = json_result['body']['data']
if 'fields' not in result:
- tools_qgis.show_message("No listValues for: " + json_result['body']['data'], 2)
+ tools_qgis.show_message("No listValues for: " + json_result['body']['data'], 2, dialog=self.dlg_cf)
else:
for field in json_result['body']['data']['fields']:
label = QLabel()
@@ -4105,7 +4113,7 @@ def _set_catalog(self, dialog, form_name, table_name, feature_id, id_name):
tools_qt.set_stylesheet(widget, "border: 2px solid red")
if missing_mandatory:
message = "Mandatory field is missing. Please, set a value"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
# Form handling so that the user cannot change values until the process is finished
@@ -4183,25 +4191,31 @@ def _get_id(self, dialog, action, option, emit_point, child_type, point, event):
self._cancel_snapping_tool(dialog, action)
return
- # Get coordinates
- event_point = self.snapper_manager.get_event_point(point=point)
- # Snapping
- result = self.snapper_manager.snap_to_current_layer(event_point)
- if not result.isValid():
- return
- # Get the point. Leave selection
- snapped_feat = self.snapper_manager.get_snapped_feature(result)
- feat_id = snapped_feat.attribute(f'{options[option][0]}')
- if option in ('arc', 'node'):
- widget = dialog.findChild(QWidget, f"{options[option][1]}")
- widget.setFocus()
- tools_qt.set_widget_text(dialog, widget, str(feat_id))
- elif option == 'set_to_arc':
- # functions called in -> getattr(self, options[option][0])(feat_id, child_type)
- # def _set_to_arc(self, feat_id, child_type)
- getattr(self, options[option][1])(feat_id, child_type)
- self.snapper_manager.recover_snapping_options()
- self._cancel_snapping_tool(dialog, action)
+ try:
+ # Refresh all layers to avoid selecting old deleted features
+ global_vars.canvas.refreshAllLayers()
+ # Get coordinates
+ event_point = self.snapper_manager.get_event_point(point=point)
+ # Snapping
+ result = self.snapper_manager.snap_to_current_layer(event_point)
+ if not result.isValid():
+ return
+ # Get the point. Leave selection
+ snapped_feat = self.snapper_manager.get_snapped_feature(result)
+ feat_id = snapped_feat.attribute(f'{options[option][0]}')
+ if option in ('arc', 'node'):
+ widget = dialog.findChild(QWidget, f"{options[option][1]}")
+ widget.setFocus()
+ tools_qt.set_widget_text(dialog, widget, str(feat_id))
+ elif option == 'set_to_arc':
+ # functions called in -> getattr(self, options[option][0])(feat_id, child_type)
+ # def _set_to_arc(self, feat_id, child_type)
+ getattr(self, options[option][1])(feat_id, child_type)
+ except Exception as e:
+ tools_qgis.show_warning(f"Exception in info (def _get_id)", parameter=e)
+ finally:
+ self.snapper_manager.recover_snapping_options()
+ self._cancel_snapping_tool(dialog, action)
def _set_to_arc(self, feat_id, child_type):
diff --git a/core/shared/mincut.py b/core/shared/mincut.py
index 48e0d5ed2..6f89ee08b 100644
--- a/core/shared/mincut.py
+++ b/core/shared/mincut.py
@@ -184,7 +184,7 @@ def load_mincut(self, result_mincut_id):
self.dlg_mincut.btn_end.setDisabled(True)
# Actions
if self.mincut_class == 1:
- self.action_mincut.setDisabled(True)
+ self.action_mincut.setDisabled(False)
self.action_refresh_mincut.setDisabled(False)
self.action_custom_mincut.setDisabled(False)
self.action_change_valve_status.setDisabled(False)
@@ -1588,7 +1588,7 @@ def _delete_records_connec(self):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_connec)
return
del_id = []
@@ -1641,7 +1641,7 @@ def _delete_records_hydro(self):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_hydro)
return
del_id = []
@@ -1922,9 +1922,10 @@ def _mincut_task_finished(self, snapped_point, elem_type, element_id, signal):
if signal[1]:
complet_result = signal[1]
real_mincut_id = tools_qt.get_text(self.dlg_mincut, self.dlg_mincut.result_mincut_id)
- if 'mincutOverlap' in complet_result and complet_result['mincutOverlap'] != "":
+ mincutOverlap = complet_result.get('mincutOverlap')
+ if mincutOverlap not in (None, ""):
message = "Mincut done, but has conflict and overlaps with"
- tools_qt.show_info_box(message, parameter=complet_result['mincutOverlap'])
+ tools_qt.show_info_box(message, parameter=mincutOverlap)
else:
message = complet_result.get('message')
if not message:
@@ -1966,7 +1967,7 @@ def _mincut_task_finished(self, snapped_point, elem_type, element_id, signal):
# Enable button CustomMincut, ChangeValveStatus and button Start
self.dlg_mincut.btn_start.setDisabled(False)
- self.action_mincut.setDisabled(True)
+ self.action_mincut.setDisabled(False)
self.action_refresh_mincut.setDisabled(False)
self.action_custom_mincut.setDisabled(False)
self.action_change_valve_status.setDisabled(False)
@@ -1989,6 +1990,7 @@ def _mincut_task_finished(self, snapped_point, elem_type, element_id, signal):
self.set_visible_mincut_layers()
self._remove_selection()
self.action_mincut.setChecked(False)
+ self.iface.actionPan().trigger()
# Enabled button accept from mincut form
self.dlg_mincut.btn_accept.setEnabled(True)
@@ -2050,9 +2052,10 @@ def _refresh_mincut_finished(self, signal):
if signal[1]:
complet_result = signal[1]
- if 'mincutOverlap' in complet_result and complet_result['mincutOverlap'] != "":
+ mincutOverlap = complet_result.get('mincutOverlap')
+ if mincutOverlap not in (None, ""):
message = "Mincut done, but has conflict and overlaps with"
- tools_qt.show_info_box(message, parameter=complet_result['mincutOverlap'])
+ tools_qt.show_info_box(message, parameter=mincutOverlap)
else:
message = complet_result.get('message')
if not message:
@@ -2280,7 +2283,7 @@ def _open_composer(self):
# Check if template is selected
if str(self.dlg_comp.cbx_template.currentText()) == "":
message = "You need to select a template"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_comp)
return
# Check if template file exists
@@ -2291,7 +2294,7 @@ def _open_composer(self):
if not os.path.exists(template_path):
message = "File not found"
- tools_qgis.show_warning(message, parameter=template_path)
+ tools_qgis.show_warning(message, parameter=template_path, dialog=self.dlg_comp)
return
# Check if composer exist
diff --git a/core/shared/mincut_tools.py b/core/shared/mincut_tools.py
index bdbd11541..50780d72f 100644
--- a/core/shared/mincut_tools.py
+++ b/core/shared/mincut_tools.py
@@ -100,7 +100,7 @@ def _set_state_cancel_mincut(self):
selected_list = self.tbl_mincut_edit.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_mincut_man)
return
inf_text = ""
list_id = ""
@@ -133,7 +133,7 @@ def _mincut_selector(self, qtable, field_id):
if len(selected_mincuts) == 0:
msg = "There are no visible mincuts in the table. Try a different filter or make one"
- tools_qgis.show_message(msg)
+ tools_qgis.show_message(msg, dialog=self.dlg_mincut_man)
return
selector_values = f"selector_mincut"
aux_params = f'"ids":{selected_mincuts}'
@@ -173,7 +173,7 @@ def _open_mincut(self):
selected_list = self.tbl_mincut_edit.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_mincut_man)
return
row = selected_list[0].row()
@@ -237,7 +237,7 @@ def _filter_by_id(self, qtable):
date_to = visit_end.toString('yyyyMMdd 23:59:59')
if date_from > date_to:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_mincut_man)
return
# Create interval dates
@@ -287,7 +287,7 @@ def _fill_table_mincut_management(self, widget, table_name):
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=self.dlg_mincut_man)
# Attach model to table view
widget.setModel(model)
@@ -300,7 +300,7 @@ def _delete_mincut_management(self, widget, table_name, column_id):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_mincut_man)
return
inf_text = ""
diff --git a/core/shared/nonvisual.py b/core/shared/nonvisual.py
index 749ec607a..0069d1664 100644
--- a/core/shared/nonvisual.py
+++ b/core/shared/nonvisual.py
@@ -49,6 +49,7 @@ def __init__(self):
'v_edit_inp_timeseries': 'id', 'v_edit_inp_timeseries_value': 'timser_id',
'inp_lid': 'lidco_id', 'inp_lid_value': 'lidco_id',
}
+ self.valid = (True, "")
def get_nonvisual(self, object_name):
@@ -126,7 +127,7 @@ def _fill_manager_table(self, widget, table_name, set_edit_triggers=QTableView.N
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=self.manager_dlg)
# Attach model to table view
if expr:
widget.setModel(model)
@@ -180,7 +181,7 @@ def _duplicate_object(self, dialog):
selected_list = table.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
# Get selected workspace id
@@ -208,7 +209,7 @@ def _delete_object(self, dialog):
selected_list = table.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
# Get selected workspace id
@@ -218,10 +219,8 @@ def _delete_object(self, dialog):
message = "Are you sure you want to delete these records?"
answer = tools_qt.show_question(message, "Delete records", index.sibling(index.row(), 0).data())
if answer:
- # Add quotes to id if not numeric
- try:
- value = int(value)
- except ValueError:
+ # Add quotes to id if not inp_controls/inp_rules
+ if tablename not in ('inp_controls', 'inp_rules'):
value = f"'{value}'"
# Delete values
@@ -231,7 +230,7 @@ def _delete_object(self, dialog):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting object values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -241,7 +240,7 @@ def _delete_object(self, dialog):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting object."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -399,6 +398,7 @@ def _manage_curve_value(self, dialog, table, row, column):
# Control data depending on curve type
valid = True
+ self.valid = (True, "")
if column == 0:
# If not first row, check if previous row has a smaller value than current row
if row - 1 >= 0:
@@ -410,6 +410,7 @@ def _manage_curve_value(self, dialog, table, row, column):
prev_value = float(prev_cell.data(0))
if cur_value < prev_value:
valid = False
+ self.valid = (False, "Invalid curve. First column values must be ascending.")
# If first check is valid, check all rows for column for final validation
if valid:
@@ -443,6 +444,7 @@ def _manage_curve_value(self, dialog, table, row, column):
if n > x_values[i-1]:
continue
valid = False
+ self.valid = (False, "Invalid curve. First column values must be ascending.")
break
# If PUMP, check that y_values are descending
curve_type = tools_qt.get_text(dialog, 'cmb_curve_type')
@@ -453,6 +455,7 @@ def _manage_curve_value(self, dialog, table, row, column):
if n < y_values[i - 1]:
continue
valid = False
+ self.valid = (False, "Invalid curve. Second column values must be descending.")
break
if valid:
@@ -460,8 +463,7 @@ def _manage_curve_value(self, dialog, table, row, column):
x_len = len([x for x in x_values if x is not None]) # Length of the x_values list without Nones
y_len = len([y for y in y_values if y is not None]) # Length of the y_values list without Nones
valid = x_len == y_len
-
- self._set_curve_values_valid(dialog, valid)
+ self.valid = (valid, "Invalid curve. Values must go in pairs.")
def _manage_curve_plot(self, dialog, table, plot_widget, row, column):
@@ -528,10 +530,6 @@ def _manage_curve_plot(self, dialog, table, plot_widget, row, column):
plot_widget.draw()
- def _set_curve_values_valid(self, dialog, valid):
- dialog.btn_accept.setEnabled(valid)
-
-
def _accept_curves(self, dialog, is_new, curve_id):
""" Manage accept button (insert & update) """
@@ -550,6 +548,11 @@ def _accept_curves(self, dialog, is_new, curve_id):
if expl_id in (None, ''):
expl_id = "null"
+ valid, msg = self.valid
+ if not valid:
+ tools_qgis.show_warning(msg, dialog=dialog)
+ return
+
if is_new:
# Check that there are no empty fields
if not curve_id or curve_id == 'null':
@@ -563,12 +566,12 @@ def _accept_curves(self, dialog, is_new, curve_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting curve."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
# Insert inp_curve_value
- result = self._insert_curve_values(tbl_curve_value, curve_id)
+ result = self._insert_curve_values(dialog, tbl_curve_value, curve_id)
if not result:
return
@@ -593,12 +596,12 @@ def _accept_curves(self, dialog, is_new, curve_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting old curve values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
# Insert new curve values
- result = self._insert_curve_values(tbl_curve_value, curve_id)
+ result = self._insert_curve_values(dialog, tbl_curve_value, curve_id)
if not result:
return
@@ -611,7 +614,7 @@ def _accept_curves(self, dialog, is_new, curve_id):
tools_gw.close_dialog(dialog)
- def _insert_curve_values(self, tbl_curve_value, curve_id):
+ def _insert_curve_values(self, dialog, tbl_curve_value, curve_id):
""" Insert table values into v_edit_inp_curve_values """
values = self._read_tbl_values(tbl_curve_value)
@@ -624,7 +627,7 @@ def _insert_curve_values(self, tbl_curve_value, curve_id):
if is_empty:
msg = "You need at least one row of values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -640,7 +643,7 @@ def _insert_curve_values(self, tbl_curve_value, curve_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting curve value."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
return True
@@ -801,12 +804,12 @@ def _accept_pattern_ws(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
# Insert inp_pattern_value
- result = self._insert_ws_pattern_values(tbl_pattern_value, pattern_id)
+ result = self._insert_ws_pattern_values(dialog, tbl_pattern_value, pattern_id)
if not result:
return
@@ -830,10 +833,10 @@ def _accept_pattern_ws(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting old curve values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
- result = self._insert_ws_pattern_values(tbl_pattern_value, pattern_id)
+ result = self._insert_ws_pattern_values(dialog, tbl_pattern_value, pattern_id)
if not result:
return
@@ -846,7 +849,7 @@ def _accept_pattern_ws(self, dialog, is_new):
tools_gw.close_dialog(dialog)
- def _insert_ws_pattern_values(self, tbl_pattern_value, pattern_id):
+ def _insert_ws_pattern_values(self, dialog, tbl_pattern_value, pattern_id):
""" Insert table values into v_edit_inp_pattern_values """
# Insert inp_pattern_value
@@ -860,7 +863,7 @@ def _insert_ws_pattern_values(self, tbl_pattern_value, pattern_id):
if is_empty:
msg = "You need at least one row of values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -878,7 +881,7 @@ def _insert_ws_pattern_values(self, tbl_pattern_value, pattern_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern value."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1104,7 +1107,7 @@ def _accept_pattern_ud(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -1133,7 +1136,7 @@ def _accept_pattern_ud(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting old pattern values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
result = self._insert_ud_pattern_values(dialog, pattern_type, pattern_id)
@@ -1164,7 +1167,7 @@ def _insert_ud_pattern_values(self, dialog, pattern_type, pattern_id):
if is_empty:
msg = "You need at least one row of values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1183,7 +1186,7 @@ def _insert_ud_pattern_values(self, dialog, pattern_type, pattern_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern value."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1343,7 +1346,7 @@ def _accept_controls(self, dialog, is_new, control_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting control."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -1473,7 +1476,7 @@ def _accept_rules(self, dialog, is_new, rule_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting control."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -1701,7 +1704,7 @@ def _accept_timeseries(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting timeseries."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -1709,7 +1712,7 @@ def _accept_timeseries(self, dialog, is_new):
sql = "" # No need to insert to inp_timeseries_value?
# Insert inp_timeseries_value
- result = self._insert_timeseries_value(tbl_timeseries_value, times_type, timeseries_id)
+ result = self._insert_timeseries_value(dialog, tbl_timeseries_value, times_type, timeseries_id)
if not result:
return
@@ -1737,10 +1740,10 @@ def _accept_timeseries(self, dialog, is_new):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting old timeseries values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
- result = self._insert_timeseries_value(tbl_timeseries_value, times_type, timeseries_id)
+ result = self._insert_timeseries_value(dialog, tbl_timeseries_value, times_type, timeseries_id)
if not result:
return
@@ -1753,7 +1756,7 @@ def _accept_timeseries(self, dialog, is_new):
tools_gw.close_dialog(dialog)
- def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_id):
+ def _insert_timeseries_value(self, dialog, tbl_timeseries_value, times_type, timeseries_id):
""" Insert table values into v_edit_inp_timeseries_value """
values = list()
@@ -1779,7 +1782,7 @@ def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_
if is_empty:
msg = "You need at least one row of values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1789,7 +1792,7 @@ def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_
continue
if 'null' in (row[0], row[1], row[2]):
msg = "You have to fill in 'date', 'time' and 'value' fields!"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1799,7 +1802,7 @@ def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern value."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
elif times_type == 'RELATIVE':
@@ -1809,7 +1812,7 @@ def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_
continue
if 'null' in (row[1], row[2]):
msg = "You have to fill in 'time' and 'value' fields!"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -1819,7 +1822,7 @@ def _insert_timeseries_value(self, tbl_timeseries_value, times_type, timeseries_
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting pattern value."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -2033,15 +2036,15 @@ def _manage_lids_hide_widgets(self, dialog, lid_id):
""" Hides widgets that are not necessary in specific tabs """
# List of widgets
- widgets_hide = {'BC': {'lbl_surface_6', 'txt_surface_side_slope', 'lbl_drain_5', 'txt_drain_delay'},
- 'RG': {'lbl_surface_6', 'txt_surface_side_slope'},
- 'GR': {'lbl_surface_5', 'txt_surface_slope'},
- 'IT': {'lbl_surface_6', 'txt_surface_side_slope', 'lbl_drain_5', 'txt_drain_delay'},
- 'PP': {'lbl_surface_6', 'txt_surface_side_slope', 'lbl_drain_5', 'txt_drain_delay'},
- 'RB': {'lbl_storage_4', 'txt_seepage_rate', 'lbl_storage_5', 'txt_clogging_factor_storage'},
- 'RD': {'lbl_surface_3', 'txt_vegetation_volume', 'lbl_surface_6', 'txt_surface_side_slope',
- 'lbl_drain_3','lbl_drain_4', 'lbl_drain_5', 'lbl_drain_6',
- 'lbl_drain_7', 'lbl_drain_8', 'lbl_drain_9', 'txt_flow_exponent',
+ widgets_hide = {'BC': {'lbl_surface_side_slope', 'txt_surface_side_slope', 'lbl_drain_delay', 'txt_drain_delay'},
+ 'RG': {'lbl_surface_side_slope', 'txt_surface_side_slope'},
+ 'GR': {'lbl_surface_slope', 'txt_surface_slope'},
+ 'IT': {'lbl_surface_side_slope', 'txt_surface_side_slope', 'lbl_drain_delay', 'txt_drain_delay'},
+ 'PP': {'lbl_surface_side_slope', 'txt_surface_side_slope', 'lbl_drain_delay', 'txt_drain_delay'},
+ 'RB': {'lbl_seepage_rate', 'txt_seepage_rate', 'lbl_clogging_factor_storage', 'txt_clogging_factor_storage'},
+ 'RD': {'lbl_vegetation_volume', 'txt_vegetation_volume', 'lbl_surface_side_slope', 'txt_surface_side_slope',
+ 'lbl_flow_exponent','lbl_offset', 'lbl_drain_delay', 'lbl_open_level',
+ 'lbl_closed_level', 'lbl_control_curve', 'lbl_flow_description', 'txt_flow_exponent',
'txt_offset', 'txt_drain_delay', 'txt_open_level', 'txt_closed_level', 'cmb_control_curve',},
'VS': {''}}
@@ -2103,7 +2106,7 @@ def _accept_lids(self, dialog, is_new, lidco_id):
if not result:
msg = "There was an error inserting lid."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
@@ -2134,7 +2137,7 @@ def _accept_lids(self, dialog, is_new, lidco_id):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error deleting old lid values."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return
@@ -2194,7 +2197,7 @@ def _insert_lids_values(self, dialog, lidco_id, lidco_type):
result = tools_db.execute_sql(sql, commit=False)
if not result:
msg = "There was an error inserting lid."
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
global_vars.dao.rollback()
return False
return True
@@ -2210,7 +2213,7 @@ def _setfields(self, id, table_name, fields):
body = tools_gw.create_body(feature=feature, extras=extras)
json_result = tools_gw.execute_procedure('gw_fct_setfields', body, commit=False)
- if (not json_result) or ('status' in json_result and json_result['status'] == 'Failed'):
+ if (not json_result) or (json_result.get('status') in (None, 'Failed')):
global_vars.dao.rollback()
return False
diff --git a/core/shared/psector.py b/core/shared/psector.py
index a51b77840..734c71077 100644
--- a/core/shared/psector.py
+++ b/core/shared/psector.py
@@ -254,7 +254,7 @@ def get_psector(self, psector_id=None, list_coord=None):
f" ON CONFLICT DO NOTHING;")
tools_db.execute_sql(sql)
msg = "Your exploitation selector has been updated"
- tools_qgis.show_warning(msg, 1)
+ tools_qgis.show_warning(msg, 1, dialog=self.dlg_plan_psector)
workcat_id = row['workcat_id']
tools_qt.set_combo_value(self.workcat_id, workcat_id, 0)
@@ -350,7 +350,7 @@ def get_psector(self, psector_id=None, list_coord=None):
filter_ = "psector_id = '" + str(psector_id) + "'"
message = tools_qt.fill_table(self.tbl_document, f"v_ui_doc_x_psector", filter_)
if message:
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
self.tbl_document.doubleClicked.connect(partial(tools_qt.document_open, self.tbl_document, 'path'))
self._connect_editing_finished()
@@ -513,7 +513,7 @@ def update_total(self, dialog):
table="config_param_system")[0]
for widget in widgets:
if 'widget_total' in widget.objectName():
- total_result = float(total_result) + float(widget.text().replace(symbol, '').strip())
+ total_result = float(total_result) + float(widget.text().replace(symbol, '').strip())
tools_qt.set_widget_text(dialog, 'lbl_total_count', f'{"{:.2f}".format(total_result)} {symbol}')
@@ -608,7 +608,7 @@ def generate_rapports(self):
file_name = tools_qt.get_text(self.dlg_psector_rapport, 'txt_composer_path')
if file_name is None or file_name == 'null':
message = "File name is required"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
if file_name.find('.pdf') is False:
file_name += '.pdf'
path = folder_path + '/' + file_name
@@ -620,7 +620,7 @@ def generate_rapports(self):
viewname = f"v_plan_current_psector_budget_detail"
if file_name is None or file_name == 'null':
message = "Price list csv file name is required"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
if file_name.find('.csv') is False:
file_name += '.csv'
path = folder_path + '/' + file_name
@@ -632,7 +632,7 @@ def generate_rapports(self):
viewname = f"v_plan_current_psector_budget"
if file_name is None or file_name == 'null':
message = "Price list csv file name is required"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
if file_name.find('.csv') is False:
file_name += '.csv'
path = folder_path + '/' + file_name
@@ -666,21 +666,21 @@ def generate_composer(self, path):
exporter.exportToPdf(path, QgsLayoutExporter.PdfExportSettings())
if os.path.exists(path):
message = "Document PDF created in"
- tools_qgis.show_info(message, parameter=path)
+ tools_qgis.show_info(message, parameter=path, dialog=self.dlg_plan_psector)
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_plan_psector)
else:
message = "Cannot create file, check if its open"
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_plan_psector)
except Exception as e:
tools_log.log_warning(str(e))
msg = "Cannot create file, check if selected composer is the correct composer"
- tools_qgis.show_warning(msg, parameter=path)
+ tools_qgis.show_warning(msg, parameter=path, dialog=self.dlg_plan_psector)
finally:
designer_window.close()
else:
- tools_qgis.show_warning("Layout not found", parameter=layout_name)
+ tools_qgis.show_warning("Layout not found", parameter=layout_name, dialog=self.dlg_plan_psector)
def generate_csv(self, path, viewname):
@@ -695,7 +695,7 @@ def generate_csv(self, path, viewname):
if not rows or rows is None or rows == '':
message = "CSV not generated. Check fields from table or view"
- tools_qgis.show_warning(message, parameter=viewname)
+ tools_qgis.show_warning(message, parameter=viewname, dialog=self.dlg_plan_psector)
return
for i in range(0, len(rows)):
column_name = rows[i]
@@ -992,7 +992,7 @@ def insert_or_update_new_psector(self, tablename, close_dlg=False):
psector_name = tools_qt.get_text(self.dlg_plan_psector, "name", return_string_null=False)
if psector_name == "":
message = "Mandatory field is missing. Please, set a value"
- tools_qgis.show_warning(message, parameter='Name')
+ tools_qgis.show_warning(message, parameter='Name', dialog=self.dlg_plan_psector)
return
rotation = tools_qt.get_text(self.dlg_plan_psector, "rotation", return_string_null=False)
@@ -1003,7 +1003,7 @@ def insert_or_update_new_psector(self, tablename, close_dlg=False):
if name_exist and not self.update:
message = "The name is current in use"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
return
else:
self.set_tabs_enabled(True)
@@ -1017,7 +1017,7 @@ def insert_or_update_new_psector(self, tablename, close_dlg=False):
rows = tools_db.get_rows(sql)
if not rows or rows is None or rows == '':
message = "Check fields from table or view"
- tools_qgis.show_warning(message, parameter=viewname)
+ tools_qgis.show_warning(message, parameter=viewname, dialog=self.dlg_plan_psector)
return
columns = []
for row in rows:
@@ -1078,12 +1078,13 @@ def insert_or_update_new_psector(self, tablename, close_dlg=False):
if close_dlg:
json_result = self.set_plan()
- if 'status' in json_result and json_result['status'] == 'Accepted':
+ if json_result.get('status') == 'Accepted':
self.reload_states_selector()
tools_gw.close_dialog(self.dlg_plan_psector)
- # Refresh selectors UI if open
- tools_gw.refresh_selectors()
+ # Refresh selectors UI if it is open and and the form will close
+ if close_dlg:
+ tools_gw.refresh_selectors()
def set_plan(self):
@@ -1129,7 +1130,7 @@ def create_label(self, dialog, tbl_all_rows, id_ori, tableright, id_des):
selected_list = tbl_all_rows.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
expl_id = []
for i in range(0, len(selected_list)):
@@ -1374,7 +1375,7 @@ def fill_table(self, dialog, widget, table_name, hidde=False, set_edit_triggers=
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=dialog)
# Attach model to table view
if expr:
widget.setModel(model)
@@ -1422,7 +1423,7 @@ def manage_update_state(self, model, row, record):
msg = "This value is mandatory for planned feature. If you are looking to unlink feature from this " \
"psector please delete row. If delete is not allowed its because feature is only used on this " \
"psector and needs to be removed from canvas"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_plan_psector)
model.revert()
@@ -1433,11 +1434,11 @@ def document_insert(self):
psector_id = self.psector_id.text()
if not doc_id:
message = "You need to insert doc_id"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
return
if not psector_id:
message = "You need to insert psector_id"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
return
# Check if document already exist
@@ -1447,7 +1448,7 @@ def document_insert(self):
row = tools_db.get_row(sql)
if row:
msg = "Document already exist"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=self.dlg_plan_psector)
return
# Insert into new table
@@ -1456,7 +1457,7 @@ def document_insert(self):
status = tools_db.execute_sql(sql)
if status:
message = "Document inserted successfully"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=self.dlg_plan_psector)
self.dlg_plan_psector.tbl_document.model().select()
@@ -1518,6 +1519,7 @@ def manage_psectors(self):
self.dlg_psector_mng.rejected.connect(partial(tools_gw.close_dialog, self.dlg_psector_mng))
self.dlg_psector_mng.btn_delete.clicked.connect(partial(
self.multi_rows_delete, self.dlg_psector_mng, self.qtbl_psm, table_name, column_id, 'lbl_vdefault_psector', 'psector'))
+ self.dlg_psector_mng.btn_delete.clicked.connect(partial(tools_gw.refresh_selectors))
self.dlg_psector_mng.btn_update_psector.clicked.connect(
partial(self.update_current_psector, self.dlg_psector_mng, self.qtbl_psm))
self.dlg_psector_mng.btn_duplicate.clicked.connect(self.psector_duplicate)
@@ -1539,7 +1541,7 @@ def update_current_psector(self, dialog, qtbl_psm):
selected_list = qtbl_psm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
row = selected_list[0].row()
psector_id = qtbl_psm.model().record(row).value("psector_id")
@@ -1548,7 +1550,7 @@ def update_current_psector(self, dialog, qtbl_psm):
self.upsert_config_param_user(dialog, aux_widget, "plan_psector_vdefault")
message = "Values has been updated"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=dialog)
self.fill_table(dialog, qtbl_psm, "v_ui_plan_psector")
tools_gw.set_tablemodel_config(dialog, qtbl_psm, "v_ui_plan_psector")
@@ -1618,7 +1620,7 @@ def charge_psector(self, qtbl_psm):
selected_list = qtbl_psm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_psector_mng)
return
row = selected_list[0].row()
psector_id = qtbl_psm.model().record(row).value("psector_id")
@@ -1642,7 +1644,7 @@ def multi_rows_delete(self, dialog, widget, table_name, column_id, label, action
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
cur_psector = tools_gw.get_config_value('plan_psector_vdefault')
inf_text = ""
@@ -1726,7 +1728,7 @@ def update_price_vdefault(self):
selected_list = self.dlg_merm.tbl_om_result_cat.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_merm)
return
row = selected_list[0].row()
price_name = self.dlg_merm.tbl_om_result_cat.model().record(row).value("name")
@@ -1738,7 +1740,7 @@ def update_price_vdefault(self):
status = tools_db.execute_sql(sql)
if status:
message = "Values has been updated"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=self.dlg_merm)
# Refresh canvas
self.iface.mapCanvas().refreshAllLayers()
@@ -1763,7 +1765,7 @@ def psector_duplicate(self):
selected_list = self.qtbl_psm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_psector_mng)
return
row = selected_list[0].row()
@@ -1986,14 +1988,14 @@ def _set_arc_id(self, point):
selected_qtbl = self.qtbl_connec
if len(selected_rows) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
return
elif tab_idx == 3:
selected_rows = self.qtbl_gully.selectionModel().selectedRows()
selected_qtbl = self.qtbl_gully
if len(selected_rows) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_plan_psector)
return
# Get the point
diff --git a/core/shared/psector_duplicate.py b/core/shared/psector_duplicate.py
index dc62b35c2..c2cb7ee7b 100644
--- a/core/shared/psector_duplicate.py
+++ b/core/shared/psector_duplicate.py
@@ -64,7 +64,7 @@ def _duplicate_psector(self):
complet_result = tools_gw.execute_procedure('gw_fct_psector_duplicate', body)
if not complet_result or complet_result['status'] == 'Failed':
message = 'Function gw_fct_psector_duplicate executed with no result'
- tools_qgis.show_message(message, 3)
+ tools_qgis.show_message(message, 3, dialog=self.dlg_duplicate_psector)
return
# Populate tab info
diff --git a/core/shared/search.py b/core/shared/search.py
index 0aa466de1..274984ab3 100644
--- a/core/shared/search.py
+++ b/core/shared/search.py
@@ -97,7 +97,8 @@ def open_search(self, dlg_search, dlg_mincut=None):
label.setObjectName('lbl_' + field['label'])
label.setText(field['label'].capitalize())
- if 'tooltip' in field:
+ tooltip = field.get('tooltip')
+ if tooltip:
label.setToolTip(field['tooltip'])
else:
label.setToolTip(field['label'].capitalize())
@@ -180,7 +181,7 @@ def export_to_csv(self, dialog, qtable_1=None, qtable_2=None, path=None):
self._write_to_csv(dialog, folder_path, all_rows)
except Exception:
msg = "File path doesn't exist or you dont have permission or file is opened"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
def refresh_tab(self, tab_name="tab_hydro"):
@@ -488,8 +489,7 @@ def _add_combobox(self, field):
widget.setProperty('columnname', field['columnname'])
list_items = self._get_list_items(widget, field)
tools_qt.fill_combo_values(widget, list_items, 1)
- if 'selectedId' in field:
- tools_qt.set_combo_value(widget, field['selectedId'], 0)
+ tools_qt.set_combo_value(widget, field.get('selectedId'), 0)
# noinspection PyUnresolvedReferences
widget.currentIndexChanged.connect(partial(self._clear_lineedits))
@@ -510,12 +510,15 @@ def _get_list_items(self, widget, field):
widget.clear()
widget.blockSignals(False)
list_items = []
- if 'comboIds' in field:
- for i in range(0, len(field['comboIds'])):
- if 'comboFeature' in field:
- elem = [field['comboIds'][i], field['comboNames'][i], field['comboFeature'][i]]
+ comboIds = field.get('comboIds')
+ comboNames = field.get('comboNames')
+ comboFeature = field.get('comboFeature')
+ if None not in (comboIds, comboNames):
+ for i in range(0, len(comboIds)):
+ if comboFeature:
+ elem = [comboIds[i], comboNames[i], comboFeature[i]]
else:
- elem = [field['comboIds'][i], field['comboNames'][i]]
+ elem = [comboIds[i], comboNames[i]]
list_items.append(elem)
return list_items
@@ -784,7 +787,7 @@ def _write_to_csv(self, dialog, folder_path=None, all_rows=None):
writer.writerows(all_rows)
tools_gw.set_config_parser('btn_search', 'search_csv_path', f"{tools_qt.get_text(dialog, 'txt_path')}")
message = "The csv file has been successfully exported"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=dialog)
def _workcat_filter_by_text(self, dialog, qtable, widget_txt, table_name, workcat_id, field_id):
@@ -823,7 +826,7 @@ def _workcat_fill_table(self, widget, table_name, set_edit_triggers=QTableView.N
widget.setEditTriggers(set_edit_triggers)
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=self.items_dialog)
# Attach model to table view
if expr:
widget.setModel(model)
@@ -904,7 +907,7 @@ def _fill_label_data(self, workcat_id, table_name, extension=None):
length = length + row[0]
else:
message = "Some data is missing. Check gis_length for arc"
- tools_qgis.show_warning(message, parameter=arc_id)
+ tools_qgis.show_warning(message, parameter=arc_id, dialog=self.items_dialog)
return
if extension is not None:
widget = self.items_dialog.findChild(QLabel, f"lbl_length{extension}")
@@ -927,7 +930,7 @@ def _document_insert(self, dialog, tablename, field, field_value):
doc_id = dialog.doc_id.text()
if not doc_id:
message = "You need to insert doc_id"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
# Check if document already exist
@@ -937,7 +940,7 @@ def _document_insert(self, dialog, tablename, field, field_value):
row = tools_db.get_row(sql)
if row:
msg = "Document already exist"
- tools_qgis.show_warning(msg)
+ tools_qgis.show_warning(msg, dialog=dialog)
return
# Insert into new table
@@ -946,7 +949,7 @@ def _document_insert(self, dialog, tablename, field, field_value):
status = tools_db.execute_sql(sql)
if status:
message = "Document inserted successfully"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=dialog)
dialog.tbl_document.model().select()
diff --git a/core/shared/selector.py b/core/shared/selector.py
index 583c9248d..edb27c3a9 100644
--- a/core/shared/selector.py
+++ b/core/shared/selector.py
@@ -107,6 +107,8 @@ def get_selector(self, dialog, selector_type, filter=False, widget=None, text_fi
# Profilactic control of nones
if text_filter is None:
text_filter = ''
+ if '"' in selector_type:
+ selector_type = selector_type.strip('"')
# Built querytext
form = f'"currentTab":"{current_tab}"'
extras = f'"selectorType":"{selector_type}", "filterText":"{text_filter}"'
@@ -121,12 +123,11 @@ def get_selector(self, dialog, selector_type, filter=False, widget=None, text_fi
return False
# Get styles
- stylesheet = json_result['body']['form']['style'] if 'style' in json_result['body']['form'] else None
+ stylesheet = json_result['body']['form'].get('style')
color_rows = False
if stylesheet:
# Color selectors zebra-styled
- if 'rowsColor' in stylesheet and stylesheet['rowsColor'] is not None:
- color_rows = tools_os.set_boolean(stylesheet['rowsColor'], False)
+ color_rows = tools_os.set_boolean(stylesheet.get('rowsColor'), False)
for form_tab in json_result['body']['form']['formTabs']:
@@ -144,8 +145,9 @@ def get_selector(self, dialog, selector_type, filter=False, widget=None, text_fi
main_tab.insertTab(index, tab_widget, form_tab['tabLabel'])
else:
main_tab.addTab(tab_widget, form_tab['tabLabel'])
- if 'typeaheadForced' in form_tab and form_tab['typeaheadForced'] is not None:
- tab_widget.setProperty('typeahead_forced', form_tab['typeaheadForced'])
+ typeaheadForced = form_tab.get('typeaheadForced')
+ if typeaheadForced is not None:
+ tab_widget.setProperty('typeahead_forced', typeaheadForced)
# Create a new QGridLayout and put it into tab
gridlayout = QGridLayout()
@@ -317,6 +319,15 @@ def _set_selector(self, dialog, widget, is_alone, disable_parent):
tools_qgis.set_layer_index('v_edit_plan_psector')
tools_qgis.refresh_map_canvas()
+ # Refresh raster layer
+ layer = tools_qgis.get_layer_by_tablename('v_ext_raster_dem', schema_name='')
+ if layer:
+ layer.dataProvider().reloadData()
+ layer.triggerRepaint()
+ canvas_extent = global_vars.iface.mapCanvas().extent()
+ layer.setExtent(canvas_extent)
+ global_vars.iface.mapCanvas().refresh()
+
# Reload selectors dlg
self.open_selector(selector_type, reload_dlg=dialog)
diff --git a/core/shared/visit.py b/core/shared/visit.py
index b28f47be0..83d978848 100644
--- a/core/shared/visit.py
+++ b/core/shared/visit.py
@@ -431,7 +431,7 @@ def _open_selected_object_visit(self, dialog, widget, table_object):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
row = selected_list[0].row()
@@ -1077,7 +1077,7 @@ def _filter_visit(self, dialog, widget_table, widget_txt, table_object, expr_fil
visit_end = dialog.date_event_to.date()
if visit_start > visit_end:
message = "Selected date interval is not valid"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=dialog)
return
# Create interval dates
@@ -1368,7 +1368,7 @@ def _open_file(self):
path = index.sibling(index.row(), column_index).data()
status, message = tools_os.open_file(path)
if status is False and message is not None:
- tools_qgis.show_warning(message, parameter=path)
+ tools_qgis.show_warning(message, parameter=path, dialog=self.dlg_event)
def _populate_tbl_docs_x_event(self, event_id=0):
@@ -1510,7 +1510,7 @@ def _event_update(self):
elif len(selected_list) > 1:
message = "More then one event selected. Select just one"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_add_visit)
return
# fetch the record
@@ -1691,11 +1691,11 @@ def _event_delete(self):
# do the action
if not event.delete(pks=selected_id):
message = "Error deleting records"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_add_visit)
return
message = "Records deleted"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=self.dlg_add_visit)
# update Table
self.tbl_event.model().select()
@@ -1709,11 +1709,11 @@ def _document_insert(self):
visit_id = self.visit_id.text()
if not doc_id:
message = "You need to insert doc_id"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_add_visit)
return
if not visit_id:
message = "You need to insert visit_id"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_add_visit)
return
# Insert into new table
@@ -1722,7 +1722,7 @@ def _document_insert(self):
status = tools_db.execute_sql(sql)
if status:
message = "Document inserted successfully"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=self.dlg_add_visit)
self.dlg_add_visit.tbl_document.model().select()
@@ -1751,7 +1751,7 @@ def _document_delete(self):
status = tools_db.execute_sql(sql)
if status:
message = "Documents deleted successfully"
- tools_qgis.show_info(message)
+ tools_qgis.show_info(message, dialog=self.dlg_add_visit)
self.tbl_document.model().select()
diff --git a/core/threads/auto_mincut_execute.py b/core/threads/auto_mincut_execute.py
index 824be630c..96ba6f451 100644
--- a/core/threads/auto_mincut_execute.py
+++ b/core/threads/auto_mincut_execute.py
@@ -99,10 +99,10 @@ def finished(self, result):
self.task_finished.emit([False, self.complet_result])
# Task finished but postgres function failed
- elif 'status' in self.complet_result and self.complet_result['status'] == 'Failed':
+ elif self.complet_result.get('status') == 'Failed':
self.task_finished.emit([False, self.complet_result])
tools_gw.manage_json_exception(self.complet_result)
# Task finished with Accepted result
- elif 'mincutOverlap' in self.complet_result or self.complet_result['status'] == 'Accepted':
+ elif 'mincutOverlap' in self.complet_result or self.complet_result.get('status') == 'Accepted':
self.task_finished.emit([True, self.complet_result])
diff --git a/core/threads/epa_file_manager.py b/core/threads/epa_file_manager.py
index 1df17242a..643a82d13 100644
--- a/core/threads/epa_file_manager.py
+++ b/core/threads/epa_file_manager.py
@@ -112,30 +112,28 @@ def finished(self, result):
elif result:
if self.go2epa_export_inp and self.complet_result:
- if 'status' in self.complet_result:
- if self.complet_result['status'] == "Accepted":
- if 'body' in self.complet_result:
- if 'data' in self.complet_result['body']:
- tools_log.log_info(f"Task 'Go2Epa' execute function 'def add_layer_temp' from 'tools_gw.py' "
- f"with parameters: '{self.dlg_go2epa}', '{self.complet_result['body']['data']}', "
- f"'None', 'True', 'True', '1', close=False, call_set_tabs_enabled=False")
- tools_gw.add_layer_temp(self.dlg_go2epa, self.complet_result['body']['data'],
- None, True, True, 1, True, close=False,
- call_set_tabs_enabled=False)
+ if self.complet_result.get('status') == "Accepted":
+ if 'body' in self.complet_result:
+ if 'data' in self.complet_result['body']:
+ tools_log.log_info(f"Task 'Go2Epa' execute function 'def add_layer_temp' from 'tools_gw.py' "
+ f"with parameters: '{self.dlg_go2epa}', '{self.complet_result['body']['data']}', "
+ f"'None', 'True', 'True', '1', close=False, call_set_tabs_enabled=False")
+ tools_gw.add_layer_temp(self.dlg_go2epa, self.complet_result['body']['data'],
+ None, True, True, 1, True, close=False,
+ call_set_tabs_enabled=False)
if self.go2epa_import_result and self.rpt_result:
- if 'status' in self.rpt_result:
- if self.rpt_result['status'] == "Accepted":
- if 'body' in self.rpt_result:
- if 'data' in self.rpt_result['body']:
- tools_log.log_info(f"Task 'Go2Epa' execute function 'def add_layer_temp' from 'tools_gw.py' "
- f"with parameters: '{self.dlg_go2epa}', '{self.rpt_result['body']['data']}', "
- f"'None', 'True', 'True', '1', close=False, call_set_tabs_enabled=False")
-
- tools_gw.add_layer_temp(self.dlg_go2epa, self.rpt_result['body']['data'],
- None, True, True, 1, True, close=False,
- call_set_tabs_enabled=False)
- self.message = self.rpt_result['message']['text']
+ if self.rpt_result.get('status') == "Accepted":
+ if 'body' in self.rpt_result:
+ if 'data' in self.rpt_result['body']:
+ tools_log.log_info(f"Task 'Go2Epa' execute function 'def add_layer_temp' from 'tools_gw.py' "
+ f"with parameters: '{self.dlg_go2epa}', '{self.rpt_result['body']['data']}', "
+ f"'None', 'True', 'True', '1', close=False, call_set_tabs_enabled=False")
+
+ tools_gw.add_layer_temp(self.dlg_go2epa, self.rpt_result['body']['data'],
+ None, True, True, 1, True, close=False,
+ call_set_tabs_enabled=False)
+ self.message = self.rpt_result['message']['text']
sql = f"SELECT {self.function_name}("
if self.body:
sql += f"{self.body}"
@@ -161,13 +159,11 @@ def finished(self, result):
if self.json_result is None or not self.json_result:
tools_log.log_warning("Function failed finished")
if self.complet_result:
- if 'status' in self.complet_result:
- if "Failed" in self.complet_result['status']:
- tools_gw.manage_json_exception(self.complet_result)
+ if self.complet_result.get('status') == "Failed":
+ tools_gw.manage_json_exception(self.complet_result)
if self.rpt_result:
- if 'status' in self.rpt_result:
- if "Failed" in self.rpt_result['status']:
- tools_gw.manage_json_exception(self.rpt_result)
+ if "Failed" in self.rpt_result.get('status'):
+ tools_gw.manage_json_exception(self.rpt_result)
if self.error_msg:
title = f"Task aborted - {self.description()}"
@@ -332,7 +328,7 @@ def _fill_inp_file(self, folder_path=None, all_rows=None):
read = False
elif bool(re.match('\[(.*?)\]', row['text'])):
read = True
- if 'text' in row and row['text'] is not None and read:
+ if row.get('text') is not None and read:
line = row['text'].rstrip() + "\n"
file_inp.write(line)
@@ -359,19 +355,13 @@ def _fill_inp_file(self, folder_path=None, all_rows=None):
elif bool(re.match('\[(.*?)\]', row['text'])):
read = False
- if 'text' in row and row['text'] is not None and read:
+ if row.get('text') is not None and read:
line = row['text'].rstrip() + "\n"
- if not bool(re.match(';;(.*?)', row['text'])) and not bool(re.match('\[(.*?)', row['text'])):
- #TODO:: Manage space on text "To Network" instead of harcoded replace
- line = re.sub(' +', ';', line)
- line = line.replace('To;network', 'To network')
- aditional_file.write(line)
-
- elif not bool(re.match(';;-(.*?)', row['text'])) and not bool(re.match('\[(.*?)', row['text'])):
- line = re.sub(' +', ';', line)
+ if not bool(re.match(';;-(.*?)', row['text'])) and not bool(re.match('\[(.*?)', row['text'])):
line = re.sub(';;', '', line)
+ line = re.sub(' +', ' ', line)
aditional_file.write(line)
self._close_file(aditional_file)
@@ -597,7 +587,7 @@ def _exec_import_function(self):
self.function_failed = True
return False
- if 'status' in self.json_result and self.json_result['status'] == 'Failed':
+ if self.json_result.get('status') == 'Failed':
tools_log.log_warning(self.json_result)
self.function_failed = True
return False
diff --git a/core/threads/project_check.py b/core/threads/project_check.py
index 5930cccb2..a8bfacc22 100644
--- a/core/threads/project_check.py
+++ b/core/threads/project_check.py
@@ -91,7 +91,7 @@ def fill_check_project_table(self, layers, init_project):
if layer_source['schema'] is None:
continue
layer_source['schema'] = layer_source['schema'].replace('"', '')
- if 'schema' not in layer_source or layer_source['schema'] != global_vars.schema_name:
+ if layer_source.get('schema') != global_vars.schema_name:
continue
schema_name = layer_source['schema']
diff --git a/core/threads/project_layers_config.py b/core/threads/project_layers_config.py
index 23683cc0e..cc2cb33ec 100644
--- a/core/threads/project_layers_config.py
+++ b/core/threads/project_layers_config.py
@@ -90,12 +90,11 @@ def _get_layers_to_config(self):
for layer in all_layers_toc:
layer_source = tools_qgis.get_layer_source(layer)
# Filter to take only the layers of the current schema
- if 'schema' in layer_source:
- schema = layer_source['schema']
- if schema and schema.replace('"', '') == self.schema_name:
- table_name = f"{tools_qgis.get_layer_source_table_name(layer)}"
- if table_name not in self.available_layers:
- self.available_layers.append(table_name)
+ schema = layer_source.get('schema')
+ if schema and schema.replace('"', '') == self.schema_name:
+ table_name = f"{tools_qgis.get_layer_source_table_name(layer)}"
+ if table_name not in self.available_layers:
+ self.available_layers.append(table_name)
def _set_form_suppress(self, layers_list):
diff --git a/core/threads/project_schema_utils_create.py b/core/threads/project_schema_utils_create.py
index c33f504c1..0d4d420c5 100644
--- a/core/threads/project_schema_utils_create.py
+++ b/core/threads/project_schema_utils_create.py
@@ -64,7 +64,7 @@ def run(self):
return True
except KeyError as e:
- print(f"{type(e).__name__} --> {e}")
+ tools_log.log_info(f"{type(e).__name__} --> {e}")
self.exception = e
return False
diff --git a/core/toolbars/basic/info_button.py b/core/toolbars/basic/info_button.py
index 9bcc8690c..d05efe785 100644
--- a/core/toolbars/basic/info_button.py
+++ b/core/toolbars/basic/info_button.py
@@ -183,11 +183,12 @@ def _get_layers_from_coordinates(self, point, rb_list, tab_type=None):
main_menu.addSeparator()
# Open/close valve
- if 'valve' in json_result['body']['data']:
- valve_id = json_result['body']['data']['valve']['id']
- valve_text = json_result['body']['data']['valve']['text']
- valve_table = json_result['body']['data']['valve']['tableName']
- valve_value = json_result['body']['data']['valve']['value']
+ valve = json_result['body']['data'].get('valve')
+ if valve:
+ valve_id = valve['id']
+ valve_text = valve['text']
+ valve_table = valve['tableName']
+ valve_value = valve['value']
action_valve = QAction(f"{valve_text}", None)
action_valve.triggered.connect(partial(self._toggle_valve_state, valve_id, valve_table, valve_value))
action_valve.hovered.connect(partial(self._reset_rubber_bands))
diff --git a/core/toolbars/cad/aux_point_add_button.py b/core/toolbars/cad/aux_point_add_button.py
index 74a04e310..301b022e8 100644
--- a/core/toolbars/cad/aux_point_add_button.py
+++ b/core/toolbars/cad/aux_point_add_button.py
@@ -252,7 +252,11 @@ def _add_aux_point(self, event):
self.point_2 = point
if self.point_1 is not None and self.point_2 is not None:
+ # Create form
self._init_create_point_form(self.point_1, self.point_2)
+ # Restart points variables
+ self.point_1 = None
+ self.point_2 = None
elif event.button() == Qt.RightButton:
self.snapper_manager.recover_snapping_options()
diff --git a/core/toolbars/edit/feature_delete_button.py b/core/toolbars/edit/feature_delete_button.py
index d32621b56..b107173ce 100644
--- a/core/toolbars/edit/feature_delete_button.py
+++ b/core/toolbars/edit/feature_delete_button.py
@@ -151,7 +151,7 @@ def _show_feature_relation(self):
extras = '"feature_id":"' + feature_id + '"'
body = tools_gw.create_body(feature=feature, extras=extras)
result = tools_gw.execute_procedure('gw_fct_getfeaturerelation', body)
- if not result or ('status' in result and result['status'] == 'Failed'):
+ if not result or result.get('status') == 'Failed':
return False
# Construct message result
@@ -181,7 +181,7 @@ def _delete_feature_relation(self):
tools_qgis.show_message("Function gw_fct_setfeaturedelete executed with no result ", 3)
return
- if 'status' in complet_result and complet_result['status'] == 'Failed':
+ if complet_result.get('status') == 'Failed':
return False
# Populate tab info
diff --git a/core/toolbars/edit/feature_end_button.py b/core/toolbars/edit/feature_end_button.py
index 2ca6bb8be..c71a83c00 100644
--- a/core/toolbars/edit/feature_end_button.py
+++ b/core/toolbars/edit/feature_end_button.py
@@ -26,7 +26,7 @@ class GwFeatureEndButton(GwAction):
def __init__(self, icon_path, action_name, text, toolbar, action_group, list_tabs=None, feature_type=None):
super().__init__(icon_path, action_name, text, toolbar, action_group)
- self.list_tabs = list_tabs if list_tabs else ["node", "arc", "connec", "gully", "element"]
+ self.list_tabs = list_tabs
self.feature_type = feature_type
@@ -337,7 +337,7 @@ def _open_selected_object(self, widget):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_work)
return
row = selected_list[0].row()
@@ -365,7 +365,7 @@ def _open_arc_form(self, arc_id):
expr = QgsExpression(aux)
if expr.hasParserError():
message = "Expression Error"
- tools_qgis.show_warning(message, parameter=expr.parserErrorString())
+ tools_qgis.show_warning(message, parameter=expr.parserErrorString(), dialog=self.dlg_work)
return
id_list = None
@@ -446,7 +446,7 @@ def _fill_table_relations(self, widget, table_name):
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=self.dlg_work)
# Attach model to table view
widget.setModel(model)
diff --git a/core/toolbars/edit/feature_replace_button.py b/core/toolbars/edit/feature_replace_button.py
index d20e75b4a..cc5bd4638 100644
--- a/core/toolbars/edit/feature_replace_button.py
+++ b/core/toolbars/edit/feature_replace_button.py
@@ -411,12 +411,12 @@ def _replace_feature(self, dialog):
# Check null values
if feature_type_new in (None, 'null'):
message = "Mandatory field is missing. Please, set a value for field"
- tools_qgis.show_warning(message, parameter="'New feature type'")
+ tools_qgis.show_warning(message, parameter="'New feature type'", dialog=dialog)
return
if featurecat_id in (None, 'null'):
message = "Mandatory field is missing. Please, set a value for field"
- tools_qgis.show_warning(message, parameter="'Catalog id'")
+ tools_qgis.show_warning(message, parameter="'Catalog id'", dialog=dialog)
return
# Ask question before executing
diff --git a/core/toolbars/edit/featuretype_change_button.py b/core/toolbars/edit/featuretype_change_button.py
index 38fee1b46..d6f5c5c01 100644
--- a/core/toolbars/edit/featuretype_change_button.py
+++ b/core/toolbars/edit/featuretype_change_button.py
@@ -211,7 +211,7 @@ def _edit_change_elem_type_accept(self):
else:
message = "Field catalog_id required!"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_change)
return
else:
diff --git a/core/toolbars/epa/dscenario_manager_btn.py b/core/toolbars/epa/dscenario_manager_btn.py
index a9bb5e60f..2077e2bef 100644
--- a/core/toolbars/epa/dscenario_manager_btn.py
+++ b/core/toolbars/epa/dscenario_manager_btn.py
@@ -31,7 +31,21 @@ def __init__(self, icon_path, action_name, text, toolbar, action_group):
super().__init__(icon_path, action_name, text, toolbar, action_group)
self.feature_type = 'node'
- self.feature_types = ['node_id', 'arc_id', 'feature_id', 'connec_id', 'nodarc_id']
+ self.feature_types = ['node_id', 'arc_id', 'feature_id', 'connec_id', 'nodarc_id', 'rg_id', 'poll_id', 'sector_id', 'lidco_id']
+ self.filter_dict = {"inp_dscenario_conduit": {"filter_table": "inp_conduit", "feature_type": "arc"},
+ "inp_dscenario_raingage": {"filter_table": "inp_dscenario_raingage", "feature_type": "rg"},
+ "inp_dscenario_junction": {"filter_table": "inp_junction", "feature_type": "node"},
+ "inp_dscenario_lid_usage": {"filter_table": "inp_dscenario_lid_usage","feature_type": "lidco"},
+ "inp_dscenario_controls": {"filter_table": "inp_dscenario_controls","feature_type": "sector"},
+ "inp_dscenario_outfall": {"filter_table": "inp_outfall", "feature_type": "node"},
+ "inp_dscenario_storage": {"filter_table": "inp_storage", "feature_type": "node"},
+ "inp_dscenario_inflows": {"filter_table": "inp_inflows", "feature_type": "node"},
+ "inp_dscenario_treatment": {"filter_table": "inp_treatment", "feature_type": "node"},
+ "inp_dscenario_flwreg_pump": {"filter_table": "inp_pump", "feature_type": "arc"},
+ "inp_dscenario_flwreg_weir": {"filter_table": "inp_weir", "feature_type": "arc"},
+ "inp_dscenario_flwreg_orifice": {"filter_table": "inp_orifice", "feature_type": "arc"},
+ "inp_dscenario_flwreg_outlet": {"filter_table": "inp_outlet", "feature_type": "arc"},
+ "inp_dscenario_inflows_poll": {"filter_table": "inp_pollutant", "feature_type": "poll"}}
self.rubber_band = tools_gw.create_rubberband(global_vars.canvas)
@@ -66,6 +80,7 @@ def _open_dscenario_manager(self):
self.dlg_dscenario_manager.btn_duplicate.clicked.connect(partial(self._duplicate_selected_dscenario))
self.dlg_dscenario_manager.btn_update.clicked.connect(partial(self._open_toolbox_function, 3042))
self.dlg_dscenario_manager.btn_delete.clicked.connect(partial(self._delete_selected_dscenario))
+ self.dlg_dscenario_manager.btn_delete.clicked.connect(partial(tools_gw.refresh_selectors))
self.tbl_dscenario.doubleClicked.connect(self._open_dscenario)
self.dlg_dscenario_manager.btn_cancel.clicked.connect(partial(tools_gw.close_dialog, self.dlg_dscenario_manager))
@@ -106,7 +121,7 @@ def _fill_manager_table(self, filter_name=""):
if complet_list is False:
return False, False
for field in complet_list['body']['data']['fields']:
- if 'hidden' in field and field['hidden']: continue
+ if field.get('hidden'): continue
model = self.tbl_dscenario.model()
if model is None:
model = QStandardItemModel()
@@ -167,7 +182,7 @@ def _duplicate_selected_dscenario(self):
selected_list = self.tbl_dscenario.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_dscenario_manager)
return
# Get selected dscenario id
@@ -188,7 +203,7 @@ def _delete_selected_dscenario(self):
selected_list = self.tbl_dscenario.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_dscenario_manager)
return
# Get selected dscenario id
@@ -256,7 +271,7 @@ def _open_dscenario(self, index):
self.dlg_dscenario.finished.connect(self._selection_end)
self.dlg_dscenario.finished.connect(partial(tools_gw.close_dialog, self.dlg_dscenario, True))
- self._fill_dscenario_table()
+ self._manage_current_changed()
sql = f"SELECT name FROM v_edit_cat_dscenario WHERE dscenario_id = {self.selected_dscenario_id}"
row = tools_db.get_row(sql)
@@ -296,7 +311,7 @@ def _fill_dscenario_table(self, set_edit_triggers=QTableView.DoubleClicked, expr
# Check for errors
if model.lastError().isValid():
- tools_qgis.show_warning(model.lastError().text())
+ tools_qgis.show_warning(model.lastError().text(), dialog=self.dlg_dscenario)
# Attach model to table view
if expr:
widget.setModel(model)
@@ -328,9 +343,20 @@ def _manage_current_changed(self):
# Fill current table
self._fill_dscenario_table()
+ # Refresh txt_feature_id
+ tools_qt.set_widget_text(self.dlg_dscenario, self.dlg_dscenario.txt_feature_id, '')
+ self.dlg_dscenario.txt_feature_id.setStyleSheet(None)
+
# Manage insert typeahead
- viewname = "v_edit_" + self.feature_type
- tools_gw.set_completer_widget(viewname, self.dlg_dscenario.txt_feature_id, str(self.feature_type) + "_id")
+ # Get index of selected tab
+ index_tab = self.dlg_dscenario.main_tab.currentIndex()
+ tab_name = self.dlg_dscenario.main_tab.widget(index_tab).objectName()
+
+ if self.filter_dict[tab_name]:
+ table_name = self.filter_dict[tab_name]['filter_table']
+ self.feature_type = self.filter_dict[tab_name]['feature_type']
+ if table_name != "":
+ tools_gw.set_completer_widget(table_name, self.dlg_dscenario.txt_feature_id, str(self.feature_type) + "_id")
# Deactivate btn_snapping functionality
self._selection_end()
@@ -468,6 +494,12 @@ def _manage_load_all(self, menu, state=None):
def _manage_insert(self):
""" Insert feature to dscenario via the button """
+ if self.dlg_dscenario.txt_feature_id.text() == '':
+ message = "Feature_id is mandatory."
+ self.dlg_dscenario.txt_feature_id.setStyleSheet("border: 1px solid red")
+ tools_qgis.show_warning(message, dialog=self.dlg_dscenario)
+ return
+ self.dlg_dscenario.txt_feature_id.setStyleSheet(None)
tableview = self.dlg_dscenario.main_tab.currentWidget()
view = tableview.objectName()
@@ -492,7 +524,7 @@ def _manage_delete(self):
selected_list = tableview.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_dscenario)
return
# Get selected feature_id
@@ -514,7 +546,7 @@ def _manage_delete(self):
answer = tools_qt.show_question(message, "Delete records", values)
if answer:
for value in values:
- sql = f"DELETE FROM {view} WHERE dscenario_id = {self.selected_dscenario_id} AND {feature_type} = '{value}'"
+ sql = f"DELETE FROM {view} WHERE dscenario_id = {self.selected_dscenario_id} AND {self.feature_type}_id = '{value}'"
tools_db.execute_sql(sql)
# Refresh tableview
diff --git a/core/toolbars/epa/go2epa_manager_button.py b/core/toolbars/epa/go2epa_manager_button.py
index 205a4831f..6a58fe71a 100644
--- a/core/toolbars/epa/go2epa_manager_button.py
+++ b/core/toolbars/epa/go2epa_manager_button.py
@@ -74,7 +74,7 @@ def _fill_manager_table(self, filter_id=None):
if complet_list is False:
return False, False
for field in complet_list['body']['data']['fields']:
- if 'hidden' in field and field['hidden']: continue
+ if field.get('hidden'): continue
model = self.dlg_manager.tbl_rpt_cat_result.model()
if model is None:
model = QStandardItemModel()
@@ -210,7 +210,7 @@ def _multi_rows_delete(self, widget, table_name, column_id):
selected_list = widget.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_manager)
return
inf_text = ""
@@ -230,6 +230,6 @@ def _multi_rows_delete(self, widget, table_name, column_id):
sql = f"DELETE FROM {table_name}"
sql += f" WHERE {column_id} IN ({list_id})"
tools_db.execute_sql(sql)
- widget.model().select()
+ self._fill_manager_table(self.dlg_manager.txt_result_id.currentText())
- # endregion
\ No newline at end of file
+ # endregion
diff --git a/core/toolbars/om/flow_exit_button.py b/core/toolbars/om/flow_exit_button.py
index dd9e8c316..07c1ef090 100644
--- a/core/toolbars/om/flow_exit_button.py
+++ b/core/toolbars/om/flow_exit_button.py
@@ -95,7 +95,7 @@ def _set_flow_exit(self, event):
elem_id = self.snapped_feat.attribute('node_id')
feature_id = f'"id":["{elem_id}"]'
body = tools_gw.create_body(feature=feature_id)
- result = tools_gw.execute_procedure('gw_fct_grafanalytics_downstream', body)
+ result = tools_gw.execute_procedure('gw_fct_graphanalytics_downstream', body)
if not result or result['status'] == 'Failed':
return
diff --git a/core/toolbars/om/flow_trace_button.py b/core/toolbars/om/flow_trace_button.py
index 9d7a9d236..fa174fdbd 100644
--- a/core/toolbars/om/flow_trace_button.py
+++ b/core/toolbars/om/flow_trace_button.py
@@ -91,7 +91,7 @@ def _set_flow_trace(self, event):
elem_id = self.snapped_feat.attribute('node_id')
feature_id = f'"id":["{elem_id}"]'
body = tools_gw.create_body(feature=feature_id)
- result = tools_gw.execute_procedure('gw_fct_grafanalytics_upstream', body)
+ result = tools_gw.execute_procedure('gw_fct_graphanalytics_upstream', body)
if not result or result['status'] == 'Failed':
return
diff --git a/core/toolbars/utilities/config_btn.py b/core/toolbars/utilities/config_btn.py
index c7e4a7449..6824befc0 100644
--- a/core/toolbars/utilities/config_btn.py
+++ b/core/toolbars/utilities/config_btn.py
@@ -159,7 +159,7 @@ def _build_dialog_options(self, row, tab):
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
if field['widgettype'] == 'typeahead':
completer = QCompleter()
- if 'dv_querytext' in field:
+ if field.get('dv_querytext'):
widget.setProperty('typeahead', True)
model = QStringListModel()
widget.textChanged.connect(
@@ -211,7 +211,7 @@ def _build_dialog_options(self, row, tab):
elif field['widgettype'] == 'spinbox':
widget = QDoubleSpinBox()
- if 'value' in field and field['value'] is not None:
+ if field.get('value') is not None:
value = float(str(field['value']))
widget.setValue(value)
widget.valueChanged.connect(partial(self._get_dialog_changed_values, widget, self.tab, self.chk))
@@ -231,7 +231,7 @@ def _build_dialog_options(self, row, tab):
except Exception as e:
msg = f"{type(e).__name__} {e}. widgetname='{field['widgetname']}' AND widgettype='{field['widgettype']}'"
- tools_qgis.show_message(msg, 2)
+ tools_qgis.show_message(msg, 2, dialog=self.dlg_config)
def populate_typeahead(self, completer, model, field, dialog, widget):
@@ -274,19 +274,21 @@ def _fill_combo(self, widget, field):
widget.clear()
widget.blockSignals(False)
combolist = []
- if 'comboIds' in field:
- for i in range(0, len(field['comboIds'])):
- if field['comboIds'][i] is not None and field['comboNames'][i] is not None:
- elem = [field['comboIds'][i], field['comboNames'][i]]
+ comboIds = field.get('comboIds')
+ comboNames = field.get('comboNames')
+ if None not in (comboIds, comboNames):
+ for i in range(0, len(comboIds)):
+ if comboIds[i] is not None and comboNames[i] is not None:
+ elem = [comboIds[i], comboNames[i]]
combolist.append(elem)
records_sorted = sorted(combolist, key=operator.itemgetter(1))
# Populate combo
for record in records_sorted:
widget.addItem(record[1], record)
- if 'value' in field:
- if str(field['value']) != 'None':
- tools_qt.set_combo_value(widget, field['value'], 0)
+ value = field.get('value')
+ if value not in (None, 'None'):
+ tools_qt.set_combo_value(widget, value, 0)
def _get_dialog_changed_values(self, widget, tab, chk):
diff --git a/core/toolbars/utilities/csv_btn.py b/core/toolbars/utilities/csv_btn.py
index 48e4cb1d1..c171c3b64 100644
--- a/core/toolbars/utilities/csv_btn.py
+++ b/core/toolbars/utilities/csv_btn.py
@@ -154,7 +154,7 @@ def _write_csv(self, dialog, temp_tablename):
csvfile.close()
del csvfile
except Exception as e:
- tools_qgis.show_warning("EXCEPTION: " + str(e))
+ tools_qgis.show_warning("EXCEPTION: " + str(e), dialog=dialog)
if insert_status is False:
return
@@ -169,8 +169,9 @@ def _write_csv(self, dialog, temp_tablename):
else:
if result['status'] == "Accepted":
tools_gw.fill_tab_log(dialog, result['body']['data'], close=False)
- if 'message' in result:
- msg = result['message']['text']
+ message = result.get('message')
+ if message:
+ msg = message.get('text')
tools_qt.show_info_box(msg)
@@ -229,7 +230,7 @@ def _preview_csv(self, dialog):
with open(path, "r", encoding=_unicode) as file_input:
self._read_csv_file(model, file_input, delimiter, _unicode, _ignoreheader)
except Exception as e:
- tools_qgis.show_warning(str(e))
+ tools_qgis.show_warning(str(e), dialog=dialog)
def _load_settings_values(self):
@@ -339,7 +340,7 @@ def _insert_into_db(self, dialog, csvfile, delimiter, _unicode):
body = tools_gw.create_body(extras=values)
result = tools_gw.execute_procedure('gw_fct_setcsv', body)
- if result and 'status' in result and result['status'] == 'Accepted':
+ if result and result.get('status') == 'Accepted':
return True
return False
@@ -351,11 +352,11 @@ def _get_path(self, dialog):
path = tools_qt.get_text(dialog, dialog.txt_file_csv)
if path is None or path == 'null' or not os.path.exists(path):
message = "Please choose a valid path"
- tools_qgis.show_message(message, message_level=0)
+ tools_qgis.show_message(message, message_level=0, dialog=dialog)
return None
if path.find('.csv') == -1:
message = "Please choose a csv file"
- tools_qgis.show_message(message, message_level=0)
+ tools_qgis.show_message(message, message_level=0, dialog=dialog)
return None
return path
diff --git a/core/toolbars/utilities/print_btn.py b/core/toolbars/utilities/print_btn.py
index 73adeda71..097285fd1 100644
--- a/core/toolbars/utilities/print_btn.py
+++ b/core/toolbars/utilities/print_btn.py
@@ -313,7 +313,7 @@ def set_print(self, dialog, my_json)
label = QLabel()
label.setObjectName('lbl_' + field['widgetname'])
label.setText(field['label'].capitalize())
- if 'stylesheet' in field and field['stylesheet'] is not None and 'label' in field['stylesheet']:
+ if field.get('stylesheet') is not None and 'label' in field['stylesheet']:
label = tools_gw.set_stylesheet(field, label)
if 'tooltip' in field:
label.setToolTip(field['tooltip'])
@@ -330,7 +330,7 @@ def set_print(self, dialog, my_json)
widget = tools_gw.set_widget_size(widget, field)
widget.currentIndexChanged.connect(partial(tools_gw.get_values, dialog, widget, my_json))
if 'widgetfunction' in field:
- if field['widgetfunction']['functionName'] is not None:
+ if field['widgetfunction'].get('functionName') is not None:
function_name = field['widgetfunction']['functionName']
widget.currentIndexChanged.connect(partial(getattr(self, function_name), dialog, my_json))
diff --git a/core/toolbars/utilities/toolbox_btn.py b/core/toolbars/utilities/toolbox_btn.py
index c951a8ad5..6e12ac533 100644
--- a/core/toolbars/utilities/toolbox_btn.py
+++ b/core/toolbars/utilities/toolbox_btn.py
@@ -224,10 +224,13 @@ def _open_function(self, index):
tools_gw.load_settings(self.dlg_reports)
# Set description & query labels
- sql = f"SELECT alias, query_text FROM config_report WHERE id = {self.function_selected}"
+ sql = f"SELECT alias, query_text, descript FROM config_report WHERE id = {self.function_selected}"
row = tools_db.get_row(sql)
if row:
- tools_qt.set_widget_text(self.dlg_reports, 'lbl_descript', row[0])
+ descript = row[2]
+ if descript in (None, 'null', ''):
+ descript = row[0]
+ tools_qt.set_widget_text(self.dlg_reports, 'lbl_descript', descript)
tools_qt.set_widget_text(self.dlg_reports, 'lbl_query', row[1])
# Set listeners
@@ -311,11 +314,11 @@ def _report_finished(self, status, json_result):
label = None
widget = None
- if 'label' in field and field['label']:
+ if field.get('label'):
label = QLabel()
label.setObjectName('lbl_' + field['widgetname'])
label.setText(field['label'].capitalize())
- if 'stylesheet' in field and field['stylesheet'] is not None and 'label' in field['stylesheet']:
+ if field.get('stylesheet') is not None and 'label' in field['stylesheet']:
label = tools_gw.set_stylesheet(field, label)
if 'tooltip' in field:
label.setToolTip(field['tooltip'])
@@ -417,7 +420,7 @@ def _update_tbl_reports(self):
for field in json_result['body']['data']['fields']:
- if field['widgettype'] == 'list' and 'value' in field and field['value'] is not None:
+ if field['widgettype'] == 'list' and field.get('value') is not None:
numrows = len(field['value'])
numcols = len(field['value'][0])
self.dlg_reports.tbl_reports.setColumnCount(numcols)
@@ -435,7 +438,7 @@ def _update_tbl_reports(self):
column_name = dict_keys[column]
item = f"{field['value'][row][column_name]}"
self.dlg_reports.tbl_reports.setItem(row, column, QTableWidgetItem(item))
- elif field['widgettype'] == 'list' and 'value' in field and field['value'] is None:
+ elif field['widgettype'] == 'list' and field.get('value') is None:
self.dlg_reports.tbl_reports.setRowCount(0)
@@ -598,11 +601,12 @@ def _populate_functions_dlg(self, dialog, result, module=tools_backend_calls):
# it means that the user has configured it to show only one of the two radiobuttons, therefore, we will
# hide the other and mark the one that the user tells us.
# Options: "selectionType":"selected" // "selectionType":"all"
- if 'selectionType' in function[0]['input_params']:
- if 'selected' in function[0]['input_params']['selectionType']:
+ selectionType = function[0]['input_params'].get('selectionType')
+ if selectionType:
+ if 'selected' in selectionType:
dialog.rbt_previous.setChecked(True)
dialog.rbt_layer.setVisible(False)
- elif 'all' in function[0]['input_params']['selectionType']:
+ elif 'all' in selectionType:
dialog.rbt_layer.setChecked(True)
dialog.rbt_previous.setVisible(False)
diff --git a/core/toolbars/utilities/workspace_manager_btn.py b/core/toolbars/utilities/workspace_manager_btn.py
index 826921e5f..e427a8983 100644
--- a/core/toolbars/utilities/workspace_manager_btn.py
+++ b/core/toolbars/utilities/workspace_manager_btn.py
@@ -117,7 +117,7 @@ def _fill_tbl(self, filter_name=""):
if complet_list is False:
return False, False
for field in complet_list['body']['data']['fields']:
- if 'hidden' in field and field['hidden']: continue
+ if field.get('hidden'): continue
model = self.tbl_wrkspcm.model()
if model is None:
model = QStandardItemModel()
@@ -197,7 +197,7 @@ def _set_current_workspace(self):
selected_list = self.tbl_wrkspcm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_workspace_manager)
return
# Get selected workspace id
@@ -224,7 +224,7 @@ def _toggle_privacy_workspace(self):
selected_list = self.tbl_wrkspcm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_workspace_manager)
return
# Get selected workspace id
@@ -236,9 +236,9 @@ def _toggle_privacy_workspace(self):
result = tools_gw.execute_procedure('gw_fct_workspacemanager', body, log_sql=True)
if result and result['status'] == "Accepted":
- if 'message' in result and result['message']:
- message = result['message']
- tools_qgis.show_message(message['text'], message['level'])
+ message = result.get('message')
+ if message:
+ tools_qgis.show_message(message['text'], message['level'], dialog=self.dlg_workspace_manager)
self._fill_tbl(self.filter_name.text())
@@ -251,7 +251,7 @@ def _update_workspace(self):
selected_list = self.tbl_wrkspcm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_workspace_manager)
return
# Get selected workspace id
@@ -266,9 +266,9 @@ def _update_workspace(self):
result = tools_gw.execute_procedure('gw_fct_workspacemanager', body, log_sql=True)
if result and result['status'] == "Accepted":
- if 'message' in result and result['message']:
- message = result['message']
- tools_qgis.show_message(message['text'], message['level'])
+ message = result.get('message')
+ if message:
+ tools_qgis.show_message(message['text'], message['level'], dialog=self.dlg_workspace_manager)
self._fill_tbl(self.filter_name.text())
@@ -281,7 +281,7 @@ def _delete_workspace(self):
selected_list = self.tbl_wrkspcm.selectionModel().selectedRows()
if len(selected_list) == 0:
message = "Any record selected"
- tools_qgis.show_warning(message)
+ tools_qgis.show_warning(message, dialog=self.dlg_workspace_manager)
return
# Get selected workspace id
@@ -302,9 +302,9 @@ def _delete_workspace(self):
result = tools_gw.execute_procedure('gw_fct_workspacemanager', body, log_sql=True)
if result and result['status'] == "Accepted":
- if 'message' in result and result['message']:
- message = result['message']
- tools_qgis.show_message(message['text'], message['level'])
+ message = result.get('message')
+ if message:
+ tools_qgis.show_message(message['text'], message['level'], dialog=self.dlg_workspace_manager)
self._fill_tbl(self.filter_name.text())
self._set_labels_current_workspace(name="", result=result)
@@ -321,8 +321,9 @@ def _check_workspace(self):
if result and result['status'] == "Accepted":
value = "0"
- if 'userValues' in result['body']['data']:
- for user_value in result['body']['data']['userValues']:
+ userValues = result['body']['data'].get('userValues')
+ if userValues:
+ for user_value in userValues:
if user_value['parameter'] == 'utils_workspace_vdefault' and user_value['value']:
value = user_value['value']
self._set_labels_current_workspace(value=value, result=result)
diff --git a/core/ui/admin/admin_dbproject.ui b/core/ui/admin/admin_dbproject.ui
index 13821b6fd..69f288224 100644
--- a/core/ui/admin/admin_dbproject.ui
+++ b/core/ui/admin/admin_dbproject.ui
@@ -210,46 +210,50 @@
cmb_create_project_type
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- Close
-
-
-
- -
-
-
- Accept
-
-
-
- -
-
-
- Cancel task
-
-
-
- -
-
-
-
-
-
+
-
+
+
-
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ Accept
+
+
+
+ -
+
+
+ Cancel task
+
+
+
+ -
+
+
+ Close
+
+
+
+
@@ -277,8 +281,6 @@
rdb_import_data
data_file
btn_push_file
- btn_accept
- btn_close
diff --git a/core/ui/admin/admin_ui.ui b/core/ui/admin/admin_ui.ui
index 234771fdf..b303c6524 100644
--- a/core/ui/admin/admin_ui.ui
+++ b/core/ui/admin/admin_ui.ui
@@ -30,62 +30,6 @@
- -
-
-
-
- 0
- 0
-
-
-
- Close
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
- true
-
-
-
-
-
- ../../../Desktop/Edgar/READ SQL/images/status_ok.png
-
-
- false
-
-
-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
@@ -110,7 +54,7 @@
0
0
340
- 511
+ 509
@@ -516,8 +460,8 @@
0
0
- 340
- 511
+ 216
+ 449
@@ -729,8 +673,8 @@
0
0
- 340
- 511
+ 182
+ 488
@@ -920,12 +864,67 @@
+ -
+
+
-
+
+
+ true
+
+
+
+
+
+ ../../../Desktop/Edgar/READ SQL/images/status_ok.png
+
+
+ false
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Close
+
+
+
+
+
- tab_main
- btn_close
- lbl_status
- lbl_schema_name
- lbl_status_text
@@ -947,7 +946,6 @@
btn_schema_rename
btn_delete
btn_copy
- btn_close
btn_update_schema
chk_schema_funcion
btn_constrains
diff --git a/core/ui/dialog.py b/core/ui/dialog.py
index f1a2685ae..c15edc63d 100644
--- a/core/ui/dialog.py
+++ b/core/ui/dialog.py
@@ -8,9 +8,11 @@
import os
from qgis.PyQt import QtCore
-from qgis.PyQt.QtWidgets import QDialog, QShortcut
+from qgis.PyQt.QtWidgets import QDialog, QShortcut, QGridLayout, QSizePolicy
from qgis.PyQt.QtGui import QKeySequence, QIcon
+from qgis.gui import QgsMessageBar
+
from ... import global_vars
from ..utils import tools_gw
@@ -23,6 +25,23 @@ def __init__(self, subtag=None):
super().__init__()
self.setupUi(self)
+ # Create message bar
+ try:
+ self._messageBar = QgsMessageBar()
+ self.messageBar().setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
+ for idx in range(self.layout().count(), 0, -1):
+ item = self.layout().itemAt(idx - 1)
+ row, column, rowSpan, columnSpan = self.layout().getItemPosition(idx - 1)
+ if item is not None:
+ self.layout().removeItem(item)
+ if item.widget() is not None:
+ self.layout().addWidget(item.widget(), row + 1, column, rowSpan, columnSpan)
+ elif item.layout() is not None:
+ self.layout().addLayout(item.layout(), row + 1, column, rowSpan, columnSpan)
+ self.layout().addWidget(self.messageBar(), 0, 0, 1, -1)
+ except Exception:
+ self._messageBar = global_vars.iface
+
self.subtag = subtag
# Connect the help shortcut
action_help_shortcut = tools_gw.get_config_parser("actions_shortcuts", f"shortcut_help", "user", "init", prefix=False)
@@ -56,4 +75,7 @@ def keyPressEvent(self, event):
return super().keyPressEvent(event)
except RuntimeError:
# Multiples signals are emited when we use key_scape in order to close dialog
- pass
\ No newline at end of file
+ pass
+
+ def messageBar(self):
+ return self._messageBar
diff --git a/core/ui/main_window.py b/core/ui/main_window.py
index 208bc711a..688d65353 100644
--- a/core/ui/main_window.py
+++ b/core/ui/main_window.py
@@ -8,9 +8,11 @@
import os
from qgis.PyQt import QtCore
-from qgis.PyQt.QtWidgets import QMainWindow, QShortcut
+from qgis.PyQt.QtWidgets import QMainWindow, QShortcut, QSizePolicy
from qgis.PyQt.QtGui import QKeySequence, QIcon
+from qgis.gui import QgsMessageBar
+
from ... import global_vars
from ..utils import tools_gw
@@ -25,6 +27,23 @@ def __init__(self, subtag=None):
super().__init__()
self.setupUi(self)
+ # Create message bar
+ try:
+ self._messageBar = QgsMessageBar()
+ self.messageBar().setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
+ for idx in range(self.centralWidget().layout().count(), 0, -1):
+ item = self.centralWidget().layout().itemAt(idx - 1)
+ row, column, rowSpan, columnSpan = self.centralWidget().layout().getItemPosition(idx - 1)
+ if item is not None:
+ self.centralWidget().layout().removeItem(item)
+ if item.widget() is not None:
+ self.centralWidget().layout().addWidget(item.widget(), row + 1, column, rowSpan, columnSpan)
+ elif item.layout() is not None:
+ self.centralWidget().layout().addLayout(item.layout(), row + 1, column, rowSpan, columnSpan)
+ self.centralWidget().layout().addWidget(self.messageBar(), 0, 0, 1, -1)
+ except Exception:
+ self._messageBar = global_vars.iface
+
self.subtag = subtag
# Connect the help shortcut
action_help_shortcut = tools_gw.get_config_parser("actions_shortcuts", f"shortcut_help", "user", "init", prefix=False)
@@ -77,3 +96,6 @@ def keyPressEvent(self, event):
# Multiples signals are emited when we use key_scape in order to close dialog
pass
+
+ def messageBar(self):
+ return self._messageBar
diff --git a/core/ui/shared/info_generic.ui b/core/ui/shared/info_generic.ui
index 82f73dfcd..4769dd7ce 100644
--- a/core/ui/shared/info_generic.ui
+++ b/core/ui/shared/info_generic.ui
@@ -13,8 +13,8 @@
Basic info
-
- -
+
+
-
true
@@ -47,10 +47,10 @@
- -
+
-
- -
+
-
-
diff --git a/core/ui/shared/info_workcat.ui b/core/ui/shared/info_workcat.ui
index 2554353f0..0b8ed6d13 100644
--- a/core/ui/shared/info_workcat.ui
+++ b/core/ui/shared/info_workcat.ui
@@ -13,8 +13,8 @@
New workcat
-
-
-
+
+
-
diff --git a/core/ui/shared/visit.ui b/core/ui/shared/visit.ui
index c82121568..a9a96ab3c 100644
--- a/core/ui/shared/visit.ui
+++ b/core/ui/shared/visit.ui
@@ -13,11 +13,11 @@
Visit
-
-
-
+
+
-
- -
+
-
-
@@ -677,7 +677,7 @@
- -
+
-
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
diff --git a/core/ui/shared/visit_event.ui b/core/ui/shared/visit_event.ui
index 73c4c60ba..ee2a0315b 100644
--- a/core/ui/shared/visit_event.ui
+++ b/core/ui/shared/visit_event.ui
@@ -13,8 +13,8 @@
Standard event
-
-
-
+
+
-
@@ -279,7 +279,7 @@
- -
+
-
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
diff --git a/core/ui/shared/visit_event_rehab.ui b/core/ui/shared/visit_event_rehab.ui
index 5c45d7318..0b0f37407 100644
--- a/core/ui/shared/visit_event_rehab.ui
+++ b/core/ui/shared/visit_event_rehab.ui
@@ -13,8 +13,8 @@
Rehabilitation arc event
-
-
-
+
+
-
@@ -494,7 +494,7 @@
- -
+
-
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
diff --git a/core/ui/shared/visit_manager.ui b/core/ui/shared/visit_manager.ui
index 3a52e8e26..3dbd99d19 100644
--- a/core/ui/shared/visit_manager.ui
+++ b/core/ui/shared/visit_manager.ui
@@ -13,8 +13,8 @@
Visit management
-
-
-
+
+
-
@@ -90,12 +90,6 @@
-
-
- dd/MM/yyyy
-
-
- true
-
2016
@@ -103,6 +97,12 @@
1
+
+ dd/MM/yyyy
+
+
+ true
+
@@ -138,12 +138,6 @@
-
-
- dd/MM/yyyy
-
-
- true
-
2017
@@ -151,6 +145,12 @@
1
+
+ dd/MM/yyyy
+
+
+ true
+
diff --git a/core/ui/toolbars/basic/info_feature.ui b/core/ui/toolbars/basic/info_feature.ui
index ae6aff76b..35a0e0eb9 100644
--- a/core/ui/toolbars/basic/info_feature.ui
+++ b/core/ui/toolbars/basic/info_feature.ui
@@ -14,11 +14,11 @@
Junction
-
- -
+
+
-
- -
+
-
@@ -72,8 +72,8 @@
0
0
- 98
- 28
+ 828
+ 501
@@ -967,13 +967,13 @@
- -
+
-
- -
+
-
- -
+
-
-
diff --git a/core/ui/toolbars/edit/dimensioning.ui b/core/ui/toolbars/edit/dimensioning.ui
index 555aa13c7..33049f0f6 100644
--- a/core/ui/toolbars/edit/dimensioning.ui
+++ b/core/ui/toolbars/edit/dimensioning.ui
@@ -11,8 +11,8 @@
-
- -
+
+
-
-
@@ -55,7 +55,7 @@
- -
+
-
-
diff --git a/core/ui/toolbars/edit/doc.ui b/core/ui/toolbars/edit/doc.ui
index d510c3ddc..f62fa5ad6 100644
--- a/core/ui/toolbars/edit/doc.ui
+++ b/core/ui/toolbars/edit/doc.ui
@@ -25,8 +25,8 @@
Document
-
-
-
+
+
-
-
diff --git a/core/ui/toolbars/edit/element.ui b/core/ui/toolbars/edit/element.ui
index 5ea59841e..272604ba5 100644
--- a/core/ui/toolbars/edit/element.ui
+++ b/core/ui/toolbars/edit/element.ui
@@ -13,8 +13,8 @@
Element
-
-
-
+
+
-
diff --git a/core/ui/toolbars/edit/feature_end.ui b/core/ui/toolbars/edit/feature_end.ui
index 4929439c1..a0bdd7761 100644
--- a/core/ui/toolbars/edit/feature_end.ui
+++ b/core/ui/toolbars/edit/feature_end.ui
@@ -25,8 +25,8 @@
End feature
-
-
-
+
+
-
-
diff --git a/core/ui/toolbars/epa/go2epa_selector.ui b/core/ui/toolbars/epa/go2epa_selector.ui
index a21841f90..c4fa71ae5 100644
--- a/core/ui/toolbars/epa/go2epa_selector.ui
+++ b/core/ui/toolbars/epa/go2epa_selector.ui
@@ -13,8 +13,8 @@
Result compare selector
-
-
-
+
+
-
0
@@ -299,7 +299,7 @@
- -
+
-
-
diff --git a/core/ui/toolbars/epa/nonvisual_lids.ui b/core/ui/toolbars/epa/nonvisual_lids.ui
index 3c2815c35..cfca4703c 100644
--- a/core/ui/toolbars/epa/nonvisual_lids.ui
+++ b/core/ui/toolbars/epa/nonvisual_lids.ui
@@ -75,7 +75,7 @@
-
-
+
0
@@ -88,7 +88,7 @@
-
-
+
0
@@ -142,7 +142,7 @@
-
-
+
Berm Height (in. or mm)
@@ -159,7 +159,7 @@
-
-
+
Vegetation Volume Fraction
@@ -169,7 +169,7 @@
-
-
+
Surface Roughness (Mannings n)
@@ -179,7 +179,7 @@
-
-
+
Surface Slope (percent)
@@ -213,7 +213,7 @@
-
-
+
Surface Side Slope (run / rise)
@@ -283,7 +283,7 @@
-
-
+
Porosity (volume fraction)
@@ -293,7 +293,7 @@
-
-
+
Field Capacity (volume fraction)
@@ -313,7 +313,7 @@
-
-
+
Wilting Point (volume fraction)
@@ -326,7 +326,7 @@
-
-
+
Thickness (in. or mm)
@@ -346,7 +346,7 @@
-
-
+
Conductivity (in/hr or mm/hr)
@@ -356,7 +356,7 @@
-
-
+
Conductivity Slope
@@ -386,7 +386,7 @@
-
-
+
Suction Head (in. or mm)
@@ -423,7 +423,7 @@
-
-
+
Thickness (in. or mm)
@@ -440,7 +440,7 @@
-
-
+
Void Ratio (Void / Solids)
@@ -450,7 +450,7 @@
-
-
+
Imprevious Surface Fraction
@@ -467,7 +467,7 @@
-
-
+
Permeability (in/hr or mm/hr)
@@ -480,7 +480,7 @@
-
-
+
Regeneration Interval (days)
@@ -504,7 +504,7 @@
-
-
+
Regeneration Fraction
@@ -521,7 +521,7 @@
-
-
+
Clogging Factor
@@ -531,7 +531,7 @@
-
-
+
0
@@ -572,7 +572,7 @@
-
-
+
Void Ratio (Voids / Solids)
@@ -596,7 +596,7 @@
-
-
+
Thickness (in. or mm)
@@ -606,7 +606,7 @@
-
-
+
Seepage Rate (in/hr or mm/hr)
@@ -616,7 +616,7 @@
-
-
+
Clogging Factor
@@ -649,7 +649,7 @@
-
-
+
*Flow is in in/hr or mm/hr; use 0 if there is no drain.
@@ -659,7 +659,7 @@
-
-
+
Offset (in or mm)
@@ -669,7 +669,7 @@
-
-
+
Flow Coefficient*
@@ -686,7 +686,7 @@
-
-
+
Flow Exponent
@@ -724,7 +724,7 @@
-
-
+
Open Level (in or mm)
@@ -734,7 +734,7 @@
-
-
+
Control Curve
@@ -758,7 +758,7 @@
-
-
+
Closed Level (in or mm)
@@ -768,7 +768,7 @@
-
-
+
Drain Delay (hrs)
@@ -822,7 +822,7 @@
-
-
+
Void Fraction
@@ -832,7 +832,7 @@
-
-
+
Roughness (Mannings n)
@@ -842,7 +842,7 @@
-
-
+
Thickness (in. or mm)
@@ -879,7 +879,7 @@
-
-
+
Flow Capacity (in/hr or mm/hr)
diff --git a/core/ui/toolbars/plan/psector.ui b/core/ui/toolbars/plan/psector.ui
index 62bc2cb6f..cb8c21085 100644
--- a/core/ui/toolbars/plan/psector.ui
+++ b/core/ui/toolbars/plan/psector.ui
@@ -19,8 +19,8 @@
Plan psector
-
-
-
+
+
-
@@ -884,8 +884,8 @@
0
0
- 916
- 246
+ 98
+ 61
@@ -1635,7 +1635,7 @@
- -
+
-
-
diff --git a/core/ui/toolbars/plan/replace_arc.ui b/core/ui/toolbars/plan/replace_arc.ui
index d1377366e..522171a4b 100644
--- a/core/ui/toolbars/plan/replace_arc.ui
+++ b/core/ui/toolbars/plan/replace_arc.ui
@@ -13,8 +13,8 @@
Plan psector
-
-
-
+
+
-
0
@@ -82,8 +82,8 @@
0
0
- 327
- 113
+ 98
+ 89
@@ -98,7 +98,7 @@
- -
+
-
-
diff --git a/core/ui/toolbars/utilities/toolbox_reports.ui b/core/ui/toolbars/utilities/toolbox_reports.ui
index ca2c7e0ed..6ea047822 100644
--- a/core/ui/toolbars/utilities/toolbox_reports.ui
+++ b/core/ui/toolbars/utilities/toolbox_reports.ui
@@ -13,8 +13,8 @@
Reports
-
-
-
+
+
-
-
@@ -38,21 +38,39 @@
- -
-
-
-
- 0
- 0
-
-
-
-
+
-
+
+
+ true
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Qt::ImhHiddenText
+
+
+
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
+
+
+
+
- -
-
+
-
+
0
@@ -62,12 +80,6 @@
-
- true
-
-
- Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse
-
@@ -77,7 +89,7 @@
- -
+
-
-
@@ -93,14 +105,14 @@
- -
+
-
-
- -
+
-
-
@@ -176,7 +188,7 @@
- -
+
-
-
@@ -202,6 +214,14 @@
+
+
+ QgsCollapsibleGroupBox
+ QGroupBox
+
+ 1
+
+
diff --git a/core/ui/toolbars/utilities/toolbox_tool.ui b/core/ui/toolbars/utilities/toolbox_tool.ui
index 7c18c4e90..32f5e337b 100644
--- a/core/ui/toolbars/utilities/toolbox_tool.ui
+++ b/core/ui/toolbars/utilities/toolbox_tool.ui
@@ -13,8 +13,8 @@
-
- -
+
+
-
0
@@ -155,7 +155,7 @@
- -
+
-
-
diff --git a/core/utils/snap_manager.py b/core/utils/snap_manager.py
index 7d06db07c..0d8702991 100644
--- a/core/utils/snap_manager.py
+++ b/core/utils/snap_manager.py
@@ -64,6 +64,8 @@ def get_snapping_options(self):
def store_snapping_options(self):
""" Store the project user snapping configuration """
+ if global_vars.use_gw_snapping is not True:
+ return
# Get an array containing the snapping options for all the layers
self.snapping_config = self.get_snapping_options()
self.snapping_config.setEnabled(True)
@@ -73,6 +75,8 @@ def store_snapping_options(self):
def set_snapping_status(self, enable=False):
""" Enable/Disable snapping of all layers """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
layers = tools_qgis.get_project_layers()
@@ -93,6 +97,8 @@ def set_snap_mode(self, mode=3):
:param mode: 1 = ActiveLayer, 2=AllLayers, 3=AdvancedConfiguration (int or SnappingMode)
"""
+ if global_vars.use_gw_snapping is not True:
+ return
snapping_options = self.get_snapping_options()
if snapping_options:
QgsProject.instance().blockSignals(True)
@@ -105,6 +111,8 @@ def set_snap_mode(self, mode=3):
def config_snap_to_arc(self):
""" Set snapping to 'arc' """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
self.set_snapping_layers()
segment_flag = tools_gw.get_segment_flag(2)
@@ -122,6 +130,8 @@ def config_snap_to_arc(self):
def config_snap_to_node(self):
""" Set snapping to 'node' """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
vertex_flag = tools_gw.get_vertex_flag(1)
layer_settings = self.config_snap_to_layer(self.layer_node, QgsPointLocator.Vertex, True)
@@ -138,6 +148,8 @@ def config_snap_to_node(self):
def config_snap_to_connec(self):
""" Set snapping to 'connec' """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
snapping_config = self.get_snapping_options()
vertex_flag = tools_gw.get_vertex_flag(1)
@@ -156,6 +168,8 @@ def config_snap_to_connec(self):
def config_snap_to_gully(self):
""" Set snapping to 'gully' """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
snapping_config = self.get_snapping_options()
vertex_flag = tools_gw.get_vertex_flag(1)
@@ -174,6 +188,8 @@ def config_snap_to_gully(self):
def config_snap_to_layer(self, layer, point_locator=QgsPointLocator.All, set_settings=False):
""" Set snapping to @layer """
+ if global_vars.use_gw_snapping is not True:
+ return
if layer is None:
return
@@ -188,6 +204,8 @@ def config_snap_to_layer(self, layer, point_locator=QgsPointLocator.All, set_set
def restore_snap_options(self, snappings_options):
""" Function that applies selected snapping configuration """
+ if global_vars.use_gw_snapping is not True:
+ return
QgsProject.instance().blockSignals(True)
if snappings_options is None and self.snapping_config:
snappings_options = self.snapping_config
@@ -199,6 +217,8 @@ def restore_snap_options(self, snappings_options):
def recover_snapping_options(self):
""" Function to restore the previous snapping configuration """
+ if global_vars.use_gw_snapping is not True:
+ return
self.restore_snap_options(self.previous_snapping)
diff --git a/core/utils/tools_backend_calls.py b/core/utils/tools_backend_calls.py
index 697d27750..e8a53142d 100644
--- a/core/utils/tools_backend_calls.py
+++ b/core/utils/tools_backend_calls.py
@@ -41,9 +41,9 @@ def add_query_layer(**kwargs):
""" Create and add a QueryLayer to ToC """
""" Function called in def get_actions_from_json(...) --> getattr(tools_backend_calls, f"{function_name}")(**params) """
- query = kwargs['query']
- layer_name = kwargs['layerName'] if 'layerName' in kwargs else 'QueryLayer'
- group = kwargs['group'] if 'group' in kwargs else 'GW Layers'
+ query = kwargs.get('query')
+ layer_name = kwargs.get('layerName', default='QueryLayer')
+ group = kwargs.get('group', default='GW Layers')
uri = tools_db.get_uri()
@@ -95,7 +95,7 @@ def refresh_attribute_table(**kwargs):
set_column_visibility(**kwargs)
# Set multiline fields according table config_form_fields.widgetcontrols['setMultiline']
- if field['widgetcontrols'] is not None and 'setMultiline' in field['widgetcontrols'] and field['widgetcontrols']['setMultiline']:
+ if field['widgetcontrols'] is not None and field['widgetcontrols'].get('setMultiline'):
kwargs = {"layer": layer, "field": field, "fieldIndex": field_idx}
set_column_multiline(**kwargs)
# Set alias column
@@ -195,7 +195,7 @@ def set_column_multiline(**kwargs):
return
if field['widgettype'] == 'text':
- if field['widgetcontrols'] and 'setMultiline' in field['widgetcontrols'] and field['widgetcontrols']['setMultiline']:
+ if field['widgetcontrols'] and field['widgetcontrols'].get('setMultiline'):
editor_widget_setup = QgsEditorWidgetSetup(
'TextEdit', {'IsMultiline': field['widgetcontrols']['setMultiline']})
layer.setEditorWidgetSetup(field_index, editor_widget_setup)
@@ -238,7 +238,7 @@ def load_qml(**kwargs):
return False
# Get qml path
- qml_path = kwargs['qmlPath'] if 'qmlPath' in kwargs else None
+ qml_path = kwargs.get('qmlPath')
if not os.path.exists(qml_path):
tools_log.log_warning("File not found", parameter=qml_path)
@@ -286,7 +286,7 @@ def get_selector(**kwargs):
Function connected -> global_vars.signal_manager.refresh_selectors.connect(tools_gw.refresh_selectors)
"""
- tab_name = kwargs['tab'] if 'tab' in kwargs else None
+ tab_name = kwargs.get('tab')
global_vars.signal_manager.refresh_selectors.emit(tab_name)
@@ -301,9 +301,9 @@ def show_message(**kwargs):
Function connected -> global_vars.signal_manager.show_message.connect(tools_qgis.show_message)
"""
- text = kwargs['text'] if 'text' in kwargs else 'No message found'
- level = kwargs['level'] if 'level' in kwargs else 1
- duration = kwargs['duration'] if 'duration' in kwargs else 10
+ text = kwargs.get('text', default='No message found')
+ level = kwargs.get('level', default=1)
+ duration = kwargs.get('duration', default=10)
global_vars.signal_manager.show_message.emit(text, level, duration)
diff --git a/core/utils/tools_gw.py b/core/utils/tools_gw.py
index 548309303..da80a09bf 100644
--- a/core/utils/tools_gw.py
+++ b/core/utils/tools_gw.py
@@ -616,6 +616,7 @@ def add_layer_temp(dialog, data, layer_name, force_tab=True, reset_text=True, ta
text_result = None
temp_layers_added = []
srid = global_vars.data_epsg
+ i = 0
for k, v in list(data.items()):
if str(k) == "info":
text_result, change_tab = fill_tab_log(dialog, data, force_tab, reset_text, tab_idx, call_set_tabs_enabled, close)
@@ -636,13 +637,18 @@ def add_layer_temp(dialog, data, layer_name, force_tab=True, reset_text=True, ta
tools_qgis.remove_layer_from_toc(aux_layer_name, group)
v_layer = QgsVectorLayer(f"{geometry_type}?crs=epsg:{srid}", aux_layer_name, 'memory')
# This function already works with GeoJson
- fill_layer_temp(v_layer, data, k, counter, group)
- if 'qmlPath' in data[k] and data[k]['qmlPath']:
- qml_path = data[k]['qmlPath']
+ fill_layer_temp(v_layer, data, k, counter, group=group, sort_val=i)
+
+ # Increase iterator
+ i = i + 1
+
+ qml_path = data[k].get('qmlPath')
+ category_field = data[k].get('category_field')
+ if qml_path:
tools_qgis.load_qml(v_layer, qml_path)
- elif 'category_field' in data[k] and data[k]['category_field']:
+ elif category_field:
cat_field = data[k]['category_field']
- size = data[k]['size'] if 'size' in data[k] and data[k]['size'] else 2
+ size = data[k].get('size', default=2)
color_values = {'NEW': QColor(0, 255, 0), 'DUPLICATED': QColor(255, 0, 0),
'EXISTS': QColor(240, 150, 0)}
tools_qgis.set_layer_categoryze(v_layer, cat_field, size, color_values)
@@ -684,17 +690,15 @@ def config_layer_attributes(json_result, layer, layer_name, thread=None):
layer.setFieldAlias(field_index, field['label'])
# widgetcontrols
- if 'widgetcontrols' in field:
-
- # Set field constraints
- if field['widgetcontrols'] and 'setQgisConstraints' in field['widgetcontrols']:
- if field['widgetcontrols']['setQgisConstraints'] is True:
- layer.setFieldConstraint(field_index, QgsFieldConstraints.ConstraintNotNull,
- QgsFieldConstraints.ConstraintStrengthSoft)
- layer.setFieldConstraint(field_index, QgsFieldConstraints.ConstraintUnique,
- QgsFieldConstraints.ConstraintStrengthHard)
-
- if 'ismandatory' in field and not field['ismandatory']:
+ widgetcontrols = field.get('widgetcontrols')
+ if widgetcontrols:
+ if widgetcontrols.get('setQgisConstraints') is True:
+ layer.setFieldConstraint(field_index, QgsFieldConstraints.ConstraintNotNull,
+ QgsFieldConstraints.ConstraintStrengthSoft)
+ layer.setFieldConstraint(field_index, QgsFieldConstraints.ConstraintUnique,
+ QgsFieldConstraints.ConstraintStrengthHard)
+
+ if field.get('ismandatory') is False:
layer.setFieldConstraint(field_index, QgsFieldConstraints.ConstraintNotNull,
QgsFieldConstraints.ConstraintStrengthSoft)
@@ -719,7 +723,7 @@ def config_layer_attributes(json_result, layer, layer_name, thread=None):
and 'valueRelation' in field['widgetcontrols'] and field['widgetcontrols']['valueRelation']
if use_vr:
value_relation = field['widgetcontrols']['valueRelation']
- if 'activated' in value_relation and value_relation['activated']:
+ if value_relation.get('activated'):
try:
vr_layer = value_relation['layer']
vr_layer = tools_qgis.get_layer_by_tablename(vr_layer).id() # Get layer id
@@ -864,7 +868,7 @@ def disable_tab_log(dialog):
qtabwidget.setTabEnabled(qtabwidget.count() - 1, False)
-def fill_layer_temp(virtual_layer, data, layer_type, counter, group='GW Temporal Layers'):
+def fill_layer_temp(virtual_layer, data, layer_type, counter, group='GW Temporal Layers', sort_val=None):
"""
:param virtual_layer: Memory QgsVectorLayer (QgsVectorLayer)
:param data: Json
@@ -907,7 +911,7 @@ def fill_layer_temp(virtual_layer, data, layer_type, counter, group='GW Temporal
my_group = root.findGroup(group)
if my_group is None:
my_group = root.insertGroup(0, group)
- my_group.insertLayer(0, virtual_layer)
+ my_group.insertLayer(sort_val, virtual_layer)
def enable_widgets(dialog, result, enable):
@@ -971,7 +975,7 @@ def enable_all(dialog, result):
def set_stylesheet(field, widget, wtype='label'):
- if 'stylesheet' in field and field['stylesheet'] is not None:
+ if field.get('stylesheet') is not None:
if wtype in field['stylesheet']:
widget.setStyleSheet("QWidget{" + field['stylesheet'][wtype] + "}")
return widget
@@ -1067,7 +1071,7 @@ def set_style_mapzones():
R = id['stylesheet']['color'][0]
G = id['stylesheet']['color'][1]
B = id['stylesheet']['color'][2]
- except TypeError:
+ except (TypeError, KeyError):
R = random.randint(0, 255)
G = random.randint(0, 255)
B = random.randint(0, 255)
@@ -1136,7 +1140,7 @@ def build_dialog_info(dialog, result, my_json=None):
grid_layout = dialog.findChild(QGridLayout, 'gridLayout')
for order, field in enumerate(fields["fields"]):
- if 'hidden' in field and field['hidden']:
+ if field.get('hidden'):
continue
label = QLabel()
@@ -1174,7 +1178,7 @@ def build_dialog_info(dialog, result, my_json=None):
if 'ismandatory' in field:
widget.setProperty('ismandatory', field['ismandatory'])
- if 'layoutorder' in field:
+ if 'layoutorder' in field and field['layoutorder'] is not None:
order = field['layoutorder']
grid_layout.addWidget(label, order, 0)
grid_layout.addWidget(widget, order, 1)
@@ -1190,9 +1194,8 @@ def build_dialog_options(dialog, row, pos, _json, temp_layers_added=None, module
field_id = ''
if 'fields' in row[pos]:
field_id = 'fields'
- elif 'return_type' in row[pos]:
- if row[pos]['return_type'] not in ('', None):
- field_id = 'return_type'
+ elif row[pos].get('return_type') not in ('', None):
+ field_id = 'return_type'
if field_id == '':
return
@@ -1220,17 +1223,16 @@ def build_dialog_options(dialog, row, pos, _json, temp_layers_added=None, module
if 'value' in field:
widget.setText(field['value'])
widget.setProperty('value', field['value'])
- if 'widgetcontrols' in field and field['widgetcontrols']:
- if 'regexpControl' in field['widgetcontrols']:
- if field['widgetcontrols']['regexpControl'] is not None:
- pass
+ widgetcontrols = field.get('widgetcontrols')
+ if widgetcontrols and widgetcontrols.get('regexpControl') is not None:
+ pass
widget.editingFinished.connect(partial(get_dialog_changed_values, dialog, None, widget, field, _json))
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
- if 'datatype' in field:
- if field['datatype'] == 'int':
- widget.setValidator(QIntValidator())
- elif field['datatype'] == 'float':
- widget.setValidator(QDoubleValidator())
+ datatype = field.get('datatype')
+ if datatype == 'int':
+ widget.setValidator(QIntValidator())
+ elif datatype == 'float':
+ widget.setValidator(QDoubleValidator())
elif field['widgettype'] == 'combo':
widget = add_combo(field)
widget.currentIndexChanged.connect(partial(get_dialog_changed_values, dialog, None, widget, field, _json))
@@ -1255,19 +1257,22 @@ def build_dialog_options(dialog, row, pos, _json, temp_layers_added=None, module
if global_vars.date_format in ("dd/MM/yyyy", "dd-MM-yyyy", "yyyy/MM/dd", "yyyy-MM-dd"):
widget.setDisplayFormat(global_vars.date_format)
date = QDate.currentDate()
- if 'value' in field and field['value'] not in ('', None, 'null'):
+ if field.get('value') not in ('', None, 'null'):
date = QDate.fromString(field['value'].replace('/', '-'), 'yyyy-MM-dd')
widget.setDate(date)
widget.valueChanged.connect(partial(get_dialog_changed_values, dialog, None, widget, field, _json))
widget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
elif field['widgettype'] == 'spinbox':
widget = QDoubleSpinBox()
- if 'widgetcontrols' in field and field['widgetcontrols']:
- if 'spinboxDecimals' in field['widgetcontrols']:
- widget.setDecimals(field['widgetcontrols']['spinboxDecimals'])
- if 'maximumNumber' in field['widgetcontrols']:
- widget.setMaximum(field['widgetcontrols']['maximumNumber'])
- if 'value' in field and field['value'] not in (None, ""):
+ widgetcontrols = field.get('widgetcontrols')
+ if widgetcontrols:
+ spinboxDecimals = widgetcontrols.get('spinboxDecimals')
+ if spinboxDecimals is not None:
+ widget.setDecimals(spinboxDecimals)
+ maximumNumber = widgetcontrols.get('maximumNumber')
+ if maximumNumber is not None:
+ widget.setMaximum(maximumNumber)
+ if field.get('value') not in (None, ""):
value = float(str(field['value']))
widget.setValue(value)
widget.valueChanged.connect(partial(get_dialog_changed_values, dialog, None, widget, field, _json))
@@ -1280,21 +1285,20 @@ def build_dialog_options(dialog, row, pos, _json, temp_layers_added=None, module
continue
# Set editable/readonly
+ iseditable = field.get('iseditable')
if type(widget) in (QLineEdit, QDoubleSpinBox):
- if 'iseditable' in field:
- if str(field['iseditable']) == "False":
- widget.setReadOnly(True)
- widget.setStyleSheet("QWidget {background: rgb(242, 242, 242);color: rgb(100, 100, 100)}")
+ if iseditable in (False, "False"):
+ widget.setReadOnly(True)
+ widget.setStyleSheet("QWidget {background: rgb(242, 242, 242);color: rgb(100, 100, 100)}")
if type(widget) == QLineEdit:
if 'placeholder' in field:
widget.setPlaceholderText(field['placeholder'])
elif type(widget) in (QComboBox, QCheckBox):
- if 'iseditable' in field:
- if str(field['iseditable']) == "False":
- widget.setEnabled(False)
+ if iseditable in (False, "False"):
+ widget.setEnabled(False)
widget.setObjectName(field['widgetname'])
- if 'iseditable' in field:
- widget.setEnabled(bool(field['iseditable']))
+ if iseditable is not None:
+ widget.setEnabled(bool(iseditable))
add_widget(dialog, field, lbl, widget)
@@ -1309,8 +1313,7 @@ def check_parameters(field):
if 'widgetname' not in field:
msg += "widgetname not found. "
- if 'widgettype' in field and field['widgettype'] not in ('text', 'linetext', 'combo', 'check', 'datetime',
- 'spinbox', 'button'):
+ if field.get('widgettype') not in ('text', 'linetext', 'combo', 'check', 'datetime', 'spinbox', 'button'):
msg += "widgettype is wrongly configured. Needs to be in " \
"('text', 'linetext', 'combo', 'check', 'datetime', 'spinbox', 'button')"
@@ -1398,9 +1401,9 @@ def add_button(dialog, field, temp_layers_added=None, module=sys.modules[__name_
if 'data_' in widget.objectName():
real_name = widget.objectName()[5:len(widget.objectName())]
if 'widgetfunction' in field:
- if 'functionName' in field['widgetfunction']:
- if field['widgetfunction']['functionName']:
- function_name = field['widgetfunction']['functionName']
+ function_name = field['widgetfunction'].get('functionName')
+ if function_name is not None:
+ if function_name:
exist = tools_os.check_python_function(module, function_name)
if not exist:
msg = f"widget {real_name} have associated function {function_name}, but {function_name} not exist"
@@ -1426,7 +1429,7 @@ def add_spinbox(field):
widget = QSpinBox()
elif field['widgettype'] == 'doubleSpinbox':
widget = QDoubleSpinBox()
- if 'widgetcontrols' in field and field['widgetcontrols'] and 'spinboxDecimals' in field['widgetcontrols']:
+ if field.get('widgetcontrols') and 'spinboxDecimals' in field['widgetcontrols']:
widget.setDecimals(field['widgetcontrols']['spinboxDecimals'])
if 'min' in field['widgetcontrols']['maxMinValues']:
@@ -1487,9 +1490,8 @@ def add_checkbox(field):
widget = QCheckBox()
widget.setObjectName(field['widgetname'])
widget.setProperty('columnname', field['columnname'])
- if 'value' in field:
- if field['value'] in ("t", "true", True):
- widget.setChecked(True)
+ if field.get('value') in ("t", "true", True):
+ widget.setChecked(True)
if 'iseditable' in field:
widget.setEnabled(field['iseditable'])
return widget
@@ -1550,9 +1552,9 @@ def add_hyperlink(field):
if 'data_' in widget.objectName():
real_name = widget.objectName()[5:len(widget.objectName())]
if 'widgetfunction' in field:
- if 'functionName' in field['widgetfunction']:
- if field['widgetfunction']['functionName']:
- func_name = field['widgetfunction']['functionName']
+ func_name = field['widgetfunction'].get('functionName')
+ if func_name is not None:
+ if func_name:
exist = tools_os.check_python_function(tools_backend_calls, func_name)
if not exist:
msg = f"widget {real_name} have associated function {func_name}, but {func_name} not exist"
@@ -1583,7 +1585,7 @@ def add_calendar(dialog, field):
widget.setAllowNull(True)
widget.setCalendarPopup(True)
widget.setDisplayFormat('dd/MM/yyyy')
- if 'value' in field and field['value'] not in ('', None, 'null'):
+ if field.get('value') not in ('', None, 'null'):
date = QDate.fromString(field['value'].replace('/', '-'), 'yyyy-MM-dd')
tools_qt.set_calendar(dialog, widget, date)
else:
@@ -1622,7 +1624,7 @@ def fill_typeahead(completer, model, field, dialog, widget):
extras = f'"queryText":"{field["queryText"]}"'
extras += f', "queryTextFilter":"{field["queryTextFilter"]}"'
extras += f', "parentId":"{parent_id}"'
- extras += f', "parentValue":"{tools_qt.get_text(dialog, "data_" + str(field["parentId"]))}"'
+ extras += f', "parentValue":"{tools_qt.get_text(dialog, "data_" + str(parent_id))}"'
extras += f', "textToSearch":"{tools_qt.get_text(dialog, widget)}"'
body = create_body(extras=extras)
complet_list = execute_procedure('gw_fct_gettypeahead', body)
@@ -1643,10 +1645,9 @@ def set_data_type(field, widget):
def set_widget_size(widget, field):
- if 'widgetcontrols' in field and field['widgetcontrols'] and 'widgetdim' in field['widgetcontrols']:
- if field['widgetcontrols']['widgetdim']:
- widget.setMaximumWidth(field['widgetcontrols']['widgetdim'])
- widget.setMinimumWidth(field['widgetcontrols']['widgetdim'])
+ if field.get('widgetcontrols') and field['widgetcontrols'].get('widgetdim'):
+ widget.setMaximumWidth(field['widgetcontrols']['widgetdim'])
+ widget.setMinimumWidth(field['widgetcontrols']['widgetdim'])
return widget
@@ -1686,7 +1687,7 @@ def add_tableview(complet_result, field, module=sys.modules[__name__]):
if 'data_' in widget.objectName():
real_name = widget.objectName()[5:len(widget.objectName())]
if 'widgetfunction' in field:
- if field['widgetfunction']['functionName'] is not None:
+ if field['widgetfunction'].get('functionName') is not None:
function_name = f"_{field['widgetfunction']['functionName']}"
exist = tools_os.check_python_function(sys.modules[__name__], function_name)
if not exist:
@@ -1738,11 +1739,13 @@ def fill_combo(widget, field):
widget.clear()
widget.blockSignals(False)
combolist = []
- if 'comboIds' in field and 'comboNames' in field:
- if 'isNullValue' in field and field['isNullValue']:
+ comboIds = field.get('comboIds')
+ comboNames = field.get('comboNames')
+ if comboIds and comboNames:
+ if field.get('isNullValue'):
combolist.append(['', ''])
for i in range(0, len(field['comboIds'])):
- elem = [field['comboIds'][i], field['comboNames'][i]]
+ elem = [comboIds[i], comboNames[i]]
combolist.append(elem)
else:
msg = f"key 'comboIds' or/and comboNames not found WHERE widgetname='{field['widgetname']}' " \
@@ -1949,7 +1952,7 @@ def execute_procedure(function_name, parameters=None, schema_name=None, commit=T
return False
# If failed, manage exception
- if 'status' in json_result and json_result['status'] == 'Failed':
+ if json_result.get('status') == 'Failed':
manage_json_exception(json_result, sql, is_thread=is_thread)
return json_result
@@ -2060,7 +2063,7 @@ def manage_json_exception(json_result, sql=None, stack_level=2, stack_level_incr
tools_qt.manage_exception("Unhandled Error")
-def manage_json_return(json_result, sql, rubber_band=None):
+def manage_json_return(json_result, sql, rubber_band=None, i=None):
"""
Manage options for layers (active, visible, zoom and indexing)
:param json_result: Json result of a query (Json)
@@ -2077,6 +2080,7 @@ def manage_json_return(json_result, sql, rubber_band=None):
try:
margin = None
opacity = 100
+ i = 0
if 'zoom' in return_manager and 'margin' in return_manager['zoom']:
margin = return_manager['zoom']['margin']
@@ -2102,9 +2106,8 @@ def manage_json_return(json_result, sql, rubber_band=None):
# Remove the layer if it exists
layer_name = f'{key}'
- if 'layerName' in json_result['body']['data'][key]:
- if json_result['body']['data'][key]['layerName']:
- layer_name = json_result['body']['data'][key]['layerName']
+ if json_result['body']['data'][key].get('layerName'):
+ layer_name = json_result['body']['data'][key]['layerName']
tools_qgis.remove_layer_from_toc(layer_name, 'GW Temporal Layers')
if 'features' not in json_result['body']['data'][key]:
@@ -2116,8 +2119,10 @@ def manage_json_return(json_result, sql, rubber_band=None):
counter = len(json_result['body']['data'][key]['features'])
geometry_type = json_result['body']['data'][key]['geometryType']
v_layer = QgsVectorLayer(f"{geometry_type}?crs=epsg:{srid}", layer_name, 'memory')
+ fill_layer_temp(v_layer, json_result['body']['data'], key, counter, sort_val=i)
- fill_layer_temp(v_layer, json_result['body']['data'], key, counter)
+ # Increase iterator
+ i = i+1
# Get values for set layer style
opacity = 100
@@ -2134,11 +2139,11 @@ def manage_json_return(json_result, sql, rubber_band=None):
color = QColor(item['color'][0], item['color'][1], item['color'][2], int(opacity * 255))
color_values[item['id']] = color
cat_field = str(style_type[key]['field'])
- size = style_type[key]['width'] if 'width' in style_type[key] and style_type[key]['width'] else 2
+ size = style_type[key]['width'] if style_type[key].get('width') else 2
tools_qgis.set_layer_categoryze(v_layer, cat_field, size, color_values)
elif style_type[key]['style'] == 'random':
- size = style_type['width'] if 'width' in style_type and style_type['width'] else 2
+ size = style_type['width'] if style_type.get('width') else 2
if geometry_type == 'Point':
v_layer.renderer().symbol().setSize(size)
else:
@@ -2150,7 +2155,7 @@ def manage_json_return(json_result, sql, rubber_band=None):
extras = f'"style_id":"{style_id}"'
body = create_body(extras=extras)
style = execute_procedure('gw_fct_getstyle', body)
- if style is None or style['status'] == 'Failed':
+ if style is None or style.get('status') == 'Failed':
return
if 'styles' in style['body']:
if 'style' in style['body']['styles']:
@@ -2159,7 +2164,7 @@ def manage_json_return(json_result, sql, rubber_band=None):
elif style_type[key]['style'] == 'unique':
color = style_type[key]['values']['color']
- size = style_type['width'] if 'width' in style_type and style_type['width'] else 2
+ size = style_type['width'] if style_type.get('width') else 2
color = QColor(color[0], color[1], color[2])
if key == 'point':
v_layer.renderer().symbol().setSize(size)
diff --git a/dbmodel b/dbmodel
index d19442d81..36e4246bb 160000
--- a/dbmodel
+++ b/dbmodel
@@ -1 +1 @@
-Subproject commit d19442d81992ef0626bdf73055bab680fa863b7d
+Subproject commit 36e4246bbd291d11229da7bb219f31f0872479e9
diff --git a/global_vars.py b/global_vars.py
index 60bec735c..6f6f258f1 100644
--- a/global_vars.py
+++ b/global_vars.py
@@ -49,6 +49,7 @@
project_vars['main_schema'] = None # gwMainSchema
project_vars['project_role'] = None # gwProjectRole
project_vars['project_type'] = None # gwProjectType
+use_gw_snapping = True # Parameter from config_param_system, if false Giswater will not manage snapping configuration
load_project_menu = None
# endregion
diff --git a/lib/tools_db.py b/lib/tools_db.py
index 04169e33b..5241a7841 100644
--- a/lib/tools_db.py
+++ b/lib/tools_db.py
@@ -447,7 +447,7 @@ def connect_to_database_credentials(credentials, conn_info=None, max_attempts=2)
""" Connect to database with selected database @credentials """
# Check if credential parameter 'service' is set
- if 'service' in credentials and credentials['service']:
+ if credentials.get('service'):
logged = connect_to_database_service(credentials['service'], credentials['sslmode'])
return logged, credentials
diff --git a/lib/tools_qgis.py b/lib/tools_qgis.py
index c997c53e9..ec272b1cb 100644
--- a/lib/tools_qgis.py
+++ b/lib/tools_qgis.py
@@ -31,7 +31,8 @@
user_parameters = {'log_sql': None, 'show_message_durations': None, 'aux_context': 'ui_message'}
-def show_message(text, message_level=1, duration=10, context_name=None, parameter=None, title="", logger_file=True):
+def show_message(text, message_level=1, duration=10, context_name=None, parameter=None, title="", logger_file=True,
+ dialog=iface):
"""
Show message to the user with selected message level
:param text: The text to be shown (String)
@@ -46,9 +47,7 @@ def show_message(text, message_level=1, duration=10, context_name=None, paramete
global user_parameters
# Get optional parameter 'show_message_durations'
- dev_duration = None
- if 'show_message_durations' in user_parameters:
- dev_duration = user_parameters['show_message_durations']
+ dev_duration = user_parameters.get('show_message_durations')
# If is set, use this value
if dev_duration not in (None, "None"):
if message_level in (1, 2) and int(dev_duration) < 10:
@@ -62,14 +61,15 @@ def show_message(text, message_level=1, duration=10, context_name=None, paramete
msg += f": {parameter}"
# Show message
- iface.messageBar().pushMessage(title, msg, message_level, duration)
+ dialog.messageBar().pushMessage(title, msg, message_level, duration)
# Check if logger to file
if global_vars.logger and logger_file:
global_vars.logger.info(text)
-def show_message_link(text, url, btn_text="Open", message_level=0, duration=10, context_name=None, logger_file=True):
+def show_message_link(text, url, btn_text="Open", message_level=0, duration=10, context_name=None, logger_file=True,
+ dialog=iface):
"""
Show message to the user with selected message level and a button to open the url
:param text: The text to be shown (String)
@@ -84,9 +84,7 @@ def show_message_link(text, url, btn_text="Open", message_level=0, duration=10,
global user_parameters
# Get optional parameter 'show_message_durations'
- dev_duration = None
- if 'show_message_durations' in user_parameters:
- dev_duration = user_parameters['show_message_durations']
+ dev_duration = user_parameters.get('show_message_durations')
# If is set, use this value
if dev_duration not in (None, "None"):
if message_level in (1, 2) and int(dev_duration) < 10:
@@ -105,14 +103,14 @@ def show_message_link(text, url, btn_text="Open", message_level=0, duration=10,
widget.layout().addWidget(button)
# Show the message
- iface.messageBar().pushWidget(widget, message_level, duration)
+ dialog.messageBar().pushWidget(widget, message_level, duration)
# Check if logger to file
if global_vars.logger and logger_file:
global_vars.logger.info(text)
-def show_info(text, duration=10, context_name=None, parameter=None, logger_file=True, title=""):
+def show_info(text, duration=10, context_name=None, parameter=None, logger_file=True, title="", dialog=iface):
"""
Show information message to the user
:param text: The text to be shown (String)
@@ -122,10 +120,10 @@ def show_info(text, duration=10, context_name=None, parameter=None, logger_file=
:param logger_file: Whether it should log the message in a file or not (bool)
:param title: The title of the message (String) """
- show_message(text, 0, duration, context_name, parameter, title, logger_file)
+ show_message(text, 0, duration, context_name, parameter, title, logger_file, dialog=dialog)
-def show_warning(text, duration=10, context_name=None, parameter=None, logger_file=True, title=""):
+def show_warning(text, duration=10, context_name=None, parameter=None, logger_file=True, title="", dialog=iface):
"""
Show warning message to the user
:param text: The text to be shown (String)
@@ -135,10 +133,10 @@ def show_warning(text, duration=10, context_name=None, parameter=None, logger_fi
:param logger_file: Whether it should log the message in a file or not (bool)
:param title: The title of the message (String) """
- show_message(text, 1, duration, context_name, parameter, title, logger_file)
+ show_message(text, 1, duration, context_name, parameter, title, logger_file, dialog=dialog)
-def show_critical(text, duration=10, context_name=None, parameter=None, logger_file=True, title=""):
+def show_critical(text, duration=10, context_name=None, parameter=None, logger_file=True, title="", dialog=iface):
"""
Show critical message to the user
:param text: The text to be shown (String)
@@ -148,7 +146,7 @@ def show_critical(text, duration=10, context_name=None, parameter=None, logger_f
:param logger_file: Whether it should log the message in a file or not (bool)
:param title: The title of the message (String) """
- show_message(text, 2, duration, context_name, parameter, title, logger_file)
+ show_message(text, 2, duration, context_name, parameter, title, logger_file, dialog=dialog)
def get_visible_layers(as_str_list=False, as_list=False):
@@ -493,19 +491,19 @@ def disconnect_snapping(action_pan=True, emit_point=None, vertex_marker=None):
try:
global_vars.canvas.xyCoordinates.disconnect()
except TypeError as e:
- print(f"{type(e).__name__} --> {e}")
+ tools_log.log_info(f"{type(e).__name__} --> {e}")
if emit_point is not None:
try:
emit_point.canvasClicked.disconnect()
except TypeError as e:
- print(f"{type(e).__name__} --> {e}")
+ tools_log.log_info(f"{type(e).__name__} --> {e}")
if vertex_marker is not None:
try:
vertex_marker.hide()
except AttributeError as e:
- print(f"{type(e).__name__} --> {e}")
+ tools_log.log_info(f"{type(e).__name__} --> {e}")
if action_pan:
iface.actionPan().trigger()
diff --git a/lib/tools_qt.py b/lib/tools_qt.py
index a890df92a..2caf9a3da 100644
--- a/lib/tools_qt.py
+++ b/lib/tools_qt.py
@@ -793,12 +793,10 @@ def set_completer_rows(widget, rows):
:param rows: rows to set into the completer (List)["item1","item2","..."]
"""
- if rows is None:
- return
-
list_values = []
- for row in rows:
- list_values.append(str(row[0]))
+ if rows is not None:
+ for row in rows:
+ list_values.append(str(row[0]))
# Set completer and model: add autocomplete in the widget
completer = QCompleter()
diff --git a/main.py b/main.py
index 95dccabba..4d4c9f46e 100644
--- a/main.py
+++ b/main.py
@@ -64,62 +64,62 @@ def unload(self, hide_gw_button=True):
global_vars.project_vars['project_role'] = None
global_vars.project_vars['project_type'] = None
except Exception as e:
- print(f"Exception in unload when reset values for global_vars.project_vars: {e}")
+ tools_log.log_info(f"Exception in unload when reset values for global_vars.project_vars: {e}")
try:
# Remove Giswater dockers
self._remove_dockers()
except Exception as e:
- print(f"Exception in unload when self._remove_dockers(): {e}")
+ tools_log.log_info(f"Exception in unload when self._remove_dockers(): {e}")
try:
# Close all open dialogs
self._close_open_dialogs()
except Exception as e:
- print(f"Exception in unload when self._close_open_dialogs(): {e}")
+ tools_log.log_info(f"Exception in unload when self._close_open_dialogs(): {e}")
raise e
try:
# Force action pan
self.iface.actionPan().trigger()
except Exception as e:
- print(f"Exception in unload when self.iface.actionPan().trigger(): {e}")
+ tools_log.log_info(f"Exception in unload when self.iface.actionPan().trigger(): {e}")
try:
# Disconnect QgsProject.instance().crsChanged signal
tools_gw.disconnect_signal('load_project', 'project_read_crsChanged_set_epsg')
except Exception as e:
- print(f"Exception in unload when disconnecting QgsProject.instance().crsChanged signal: {e}")
+ tools_log.log_info(f"Exception in unload when disconnecting QgsProject.instance().crsChanged signal: {e}")
try:
tools_gw.disconnect_signal('load_project', 'manage_attribute_table_focusChanged')
except Exception as e:
- print(f"Exception in unload when disconnecting focusChanged signal: {e}")
+ tools_log.log_info(f"Exception in unload when disconnecting focusChanged signal: {e}")
try:
# Remove 'Main Info button'
self._unset_info_button()
except Exception as e:
- print(f"Exception in unload when self._unset_info_button(): {e}")
+ tools_log.log_info(f"Exception in unload when self._unset_info_button(): {e}")
try:
# Remove 'Add child layer button'
self._unset_child_layer_button()
except Exception as e:
- print(f"Exception in unload when self._unset_child_layer_button(): {e}")
+ tools_log.log_info(f"Exception in unload when self._unset_child_layer_button(): {e}")
try:
# Remove file handler when reloading
if hide_gw_button:
global_vars.logger.close_logger()
except Exception as e:
- print(f"Exception in unload when global_vars.logger.close_logger(): {e}")
+ tools_log.log_info(f"Exception in unload when global_vars.logger.close_logger(): {e}")
try:
# Remove 'Giswater menu'
tools_gw.unset_giswater_menu()
except Exception as e:
- print(f"Exception in unload when tools_gw.unset_giswater_menu(): {e}")
+ tools_log.log_info(f"Exception in unload when tools_gw.unset_giswater_menu(): {e}")
try:
# Unlisten notify channel and stop thread
@@ -128,7 +128,7 @@ def unload(self, hide_gw_button=True):
if global_vars.notify:
global_vars.notify.stop_listening(list_channels)
except Exception as e:
- print(f"Exception in unload when global_vars.notify.stop_listening(list_channels): {e}")
+ tools_log.log_info(f"Exception in unload when global_vars.notify.stop_listening(list_channels): {e}")
try:
# Check if project is current loaded and remove giswater action from PluginMenu and Toolbars
@@ -139,7 +139,7 @@ def unload(self, hide_gw_button=True):
self.iface.removePluginMenu(self.plugin_name, button.action)
self.iface.removeToolBarIcon(button.action)
except Exception as e:
- print(f"Exception in unload when self.iface.removePluginMenu(self.plugin_name, button.action): {e}")
+ tools_log.log_info(f"Exception in unload when self.iface.removePluginMenu(self.plugin_name, button.action): {e}")
try:
# Check if project is current loaded and remove giswater toolbars from qgis
@@ -150,7 +150,7 @@ def unload(self, hide_gw_button=True):
plugin_toolbar.toolbar.setVisible(False)
del plugin_toolbar.toolbar
except Exception as e:
- print(f"Exception in unload when del plugin_toolbar.toolbar: {e}")
+ tools_log.log_info(f"Exception in unload when del plugin_toolbar.toolbar: {e}")
try:
# Set 'Main Info button' if project is unload or project don't have layers
@@ -159,7 +159,7 @@ def unload(self, hide_gw_button=True):
self._set_info_button()
tools_gw.create_giswater_menu(False)
except Exception as e:
- print(f"Exception in unload when self._set_info_button(): {e}")
+ tools_log.log_info(f"Exception in unload when self._set_info_button(): {e}")
self.load_project = None
@@ -203,7 +203,12 @@ def _init_plugin(self):
tools_gw.initialize_parsers()
# Check if user has config files 'init' and 'session' and its parameters (only those without prefix)
- tools_gw.check_old_userconfig(global_vars.user_folder_dir)
+ try:
+ tools_gw.check_old_userconfig(global_vars.user_folder_dir)
+ except Exception as e:
+ # This may happen if the user doesn't have permission to move/delete files
+ msg = "Exception while moving/deleting old user config files"
+ tools_log.log_warning(msg, parameter=e)
tools_gw.user_params_to_userconfig()
# Set logger parameters min_log_level and log_limit_characters
@@ -442,6 +447,6 @@ def _close_open_dialogs(self):
try:
tools_gw.close_dialog(window)
except Exception as e:
- print(f"Exception in _close_open_dialogs: {e}")
+ tools_log.log_info(f"Exception in _close_open_dialogs: {e}")
# endregion
diff --git a/metadata.txt b/metadata.txt
index 119472cce..f11c20e12 100644
--- a/metadata.txt
+++ b/metadata.txt
@@ -2,20 +2,19 @@
name=giswater
qgisMinimumVersion=3.10
qgisMaximumVersion=3.99
-description=Plugin to manage water networks (water supply, sewerage and urban drainage) using QGIS and PostGIS-PostgreSQL(from 9.5 to 11.x)
+description=Plugin to manage water networks (water supply, sewerage and urban drainage) using QGIS and PostGIS-PostgreSQL(from 9.5 to 14.x)
about=Disclaimer: This plugin is released using the open source GNU-GPL3 license. Although a reasonable effort has been made to assure that the results obtained are correct, some of the capabilities provided by Giswater are experimental, therefore the development team and the Giswater Association are not responsible and assume no liability whatsoever for any results or any use made of the results obtained from the program, nor for any damages or litigation that result from the use of these programs for any purpose.
-version=3.5.026
-author=David Erill, Luigi Pirelli, Natasa Cica, Nestor Ibañez, Barbara Rzepka, Sergi Muñoz, Josep Lluís Sala, Edgar Fusté, Albert Bofill, Sergi Maspons, Elies Bertran, Abel García Juanes, Xavier Torret
+version=3.5.027
+author=David Erill, Luigi Pirelli, Natasa Cica, Nestor Ibañez, Adrian Valenciano, Barbara Rzepka, Sergi Muñoz, Josep Lluís Sala, Edgar Fusté, Albert Bofill, Sergi Maspons, Elies Bertran, Abel García Juanes, Xavier Torret
-Changelog=Version 3.5.026
- - Improve performance of selecting features from document, element, visit, psector, etc.
- - New button in dscenario to add layers to ToC easily
- - Refactor dscenario manager (dropdown create button, new duplicate button)
- - Allow user to input node_1/2 id in arc custom form (if not connected to node)
- - Add redundancy check for y/elev/topelev values in arcs & nodes
- - Make project_schema_copy as a thread
- - Allow hyperlinks in custom form to be editable
- - Filter tableview acoording database configuration and open basic form with visit data when doubleclick on row
+Changelog=Version 3.5.027
+ - Send messages to dialogs instead of to the canvas
+ - Allow starting a mincut from another point when a planified mincut is active
+ - Add widget to hide querytext in toolbox report
+ - Add new db variable to manage snapping configuration
+ - Show message if curve is invalid (non-visual)
+ - Sort temporary layers by geometry type
+ - Improve management of json keys
tags= giswater, water networks, sewerage, urban drainage, EPANET, SWMM
diff --git a/resources/example/iber/sample.dat b/resources/example/iber/sample.dat
index 63bbb4ff4..11e2fe2a1 100644
--- a/resources/example/iber/sample.dat
+++ b/resources/example/iber/sample.dat
@@ -1,237 +1,234 @@
-gully_id;outlet_type;node_id;xcoord;ycoord;zcoord;width;length;depth;method;weir_cd;orifice_cd;a_param;b_param;efficiency
-NG86;To network;86;419102.594;4576497.270;46.250;0.300;0.640;2.050;W/O;1.600;0.700;0.496;0.712;90
-NG63;To network;63;419052.982;4576653.050;45.000;0.300;0.640;1.850;W/O;1.600;0.700;0.496;0.712;90
-NG18830;To network;18830;418565.142;4577575.731;35.110;0.300;0.640;1.600;W/O;1.600;0.700;0.496;0.712;90
-10063;To network;76;418940.661;4576439.176;51.980;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-10064;To network;76;418919.825;4576437.352;52.980;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-10065;To network;65;418881.033;4576462.317;55.690;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-10116;To network;75;419066.233;4576368.291;43.690;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-10117;To network;75;419071.899;4576365.603;43.310;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-10118;To network;73;418932.959;4576456.101;53.070;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30009;To network;34;418841.185;4576666.670;54.890;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30010;To network;34;418855.852;4576705.077;54.570;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30011;To network;34;418854.988;4576682.225;54.670;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30012;To network;34;418854.172;4576666.237;54.830;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30013;To network;46;418840.249;4576620.388;55.900;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30015;To network;46;418853.740;4576619.236;55.610;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30016;To network;32;418844.810;4576805.993;59.120;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30017;To network;112;418940.733;4576959.672;58.060;0.295;0.565;0.800;W/O;1.600;0.700;0.454;0.659;90
-30019;To network;112;418964.258;4576923.569;57.020;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30020;To network;113;418978.373;4576899.708;56.190;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30021;To network;113;418984.518;4576909.550;56.160;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30022;To network;113;418983.942;4576890.106;55.620;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30023;To network;113;418989.943;4576886.938;55.620;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30024;To network;114;419000.889;4576884.441;54.860;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30025;To network;114;419008.235;4576893.755;54.730;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30026;To network;114;419025.902;4576881.705;53.290;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30027;To network;115;419046.210;4576868.070;52.560;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30028;To network;116;419074.920;4576848.674;50.680;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30029;To network;116;419094.220;4576835.231;49.420;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30030;To network;117;419094.124;4576821.597;49.010;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30031;To network;117;419117.168;4576819.964;47.460;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30032;To network;118;419139.253;4576805.177;45.990;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30033;To network;118;419133.204;4576795.383;46.260;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30034;To network;119;419179.197;4576765.617;43.010;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30035;To network;120;419223.846;4576734.123;39.760;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30036;To network;120;419230.567;4576743.629;39.510;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30037;To network;43;419332.348;4576651.066;31.900;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30038;To network;44;419366.050;4576636.279;29.700;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30039;To network;44;419374.308;4576613.523;29.340;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30040;To network;124;419427.407;4576582.317;26.820;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30041;To network;124;419419.149;4576573.003;27.350;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30042;To network;125;419467.687;4576539.156;24.380;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30043;To network;123;419505.134;4576528.354;22.900;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30044;To network;123;419498.029;4576519.136;23.250;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30045;To network;234;419553.912;4576495.995;20.950;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30046;To network;234;419547.959;4576486.009;21.000;0.295;0.565;0.800;W/O;1.600;0.700;0.454;0.659;90
-30047;To network;20587;419585.070;4576475.303;19.670;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30048;To network;20587;419579.693;4576465.317;19.860;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30049;To network;123;419490.011;4576483.945;23.490;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30050;To network;131;419446.706;4576446.017;25.470;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30051;To network;127;419325.866;4576339.724;31.000;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30052;To network;126;419299.029;4576316.151;32.180;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30053;To network;95;419222.261;4576222.148;35.080;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30054;To network;100;419269.983;4576263.821;32.870;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30055;To network;129;419391.735;4576374.003;28.080;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30056;To network;94;419147.751;4576226.421;37.090;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30057;To network;92;419134.092;4576266.629;38.490;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30058;To network;92;419122.858;4576259.140;38.450;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30059;To network;91;419089.635;4576325.201;40.870;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30060;To network;90;419070.431;4576327.794;41.290;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30061;To network;78;418992.223;4576405.185;47.380;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30062;To network;77;418966.778;4576406.145;48.220;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30066;To network;52;418926.306;4576686.185;51.420;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30067;To network;35;418971.435;4576662.949;49.710;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30068;To network;35;418972.587;4576676.295;49.490;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30069;To network;20607;418989.391;4576659.108;48.400;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30073;To network;64;419083.586;4576654.019;43.730;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30074;To network;64;419080.417;4576640.672;43.540;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30075;To network;37;419114.888;4576633.567;41.960;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30076;To network;37;419126.410;4576627.518;41.220;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30077;To network;41;419253.060;4576615.611;35.320;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30079;To network;43;419336.020;4576624.157;31.150;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30080;To network;40;419234.432;4576646.482;36.210;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30081;To network;40;419216.956;4576643.985;36.900;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30082;To network;40;419211.195;4576595.591;38.360;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30083;To network;101;419201.881;4576507.062;39.970;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30084;To network;101;419224.446;4576508.310;39.330;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30085;To network;88;419205.338;4576478.640;39.690;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30086;To network;88;419200.441;4576491.506;40.010;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30087;To network;87;419120.745;4576510.902;45.360;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30088;To network;86;419089.443;4576503.221;47.200;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30089;To network;82;419059.821;4576502.837;48.610;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30090;To network;82;418999.425;4576533.467;51.410;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30091;To network;68;418958.233;4576560.352;53.300;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30092;To network;67;418949.207;4576566.882;53.350;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30093;To network;67;418951.607;4576572.067;52.420;0.295;0.565;0.800;W/O;1.600;0.700;0.454;0.659;90
-30094;To network;71;418975.612;4576620.268;49.650;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30095;To network;71;418968.699;4576619.308;49.930;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30096;To network;35;418975.540;4576655.675;49.410;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30097;To network;35;418982.165;4576655.291;48.930;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30098;To network;31;418865.193;4576816.215;57.650;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30099;To network;54;418922.703;4576804.383;54.550;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30100;To network;57;418942.248;4576801.013;53.670;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30101;To network;58;418976.021;4576793.824;51.960;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30102;To network;59;419034.979;4576782.038;50.140;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30103;To network;59;419041.412;4576784.342;49.810;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30104;To network;59;419048.182;4576782.182;49.810;0.295;0.565;0.800;W/O;1.600;0.700;0.454;0.659;90
-30105;To network;59;419068.394;4576824.142;50.230;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30106;To network;116;419078.476;4576827.119;50.070;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30107;To network;116;419071.850;4576836.625;50.400;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30108;To network;61;419036.035;4576769.844;49.850;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30109;To network;62;419024.129;4576707.383;47.900;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30111;To network;37;419119.620;4576626.775;41.640;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30112;To network;83;419108.194;4576571.276;44.300;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30113;To network;86;419094.367;4576505.791;46.990;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30114;To network;80;419120.292;4576462.774;44.350;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30115;To network;79;419105.505;4576427.247;44.070;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30120;To network;68;418978.328;4576512.800;53.310;0.295;0.565;0.800;W/O;1.600;0.700;0.454;0.659;90
-30121;To network;68;418983.993;4576532.388;52.150;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30124;To network;98;419201.909;4576395.224;39.900;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30125;To network;97;419199.796;4576352.976;39.210;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30126;To network;96;419216.407;4576315.624;37.270;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30127;To network;98;419219.384;4576393.688;39.530;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30129;To network;110;419226.946;4576433.776;39.140;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30130;To network;107;419355.611;4576511.936;30.950;0.475;0.975;0.800;W/O;1.600;0.700;0.818;0.758;90
-30131;To network;106;419382.689;4576539.541;29.490;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30132;To network;45;419406.166;4576576.461;27.910;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30133;To network;45;419411.639;4576571.948;27.650;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30134;To network;46;418854.319;4576642.066;55.020;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30135;To network;82;419022.257;4576526.171;50.180;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30136;To network;84;419104.641;4576523.194;46.120;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-30913;To network;31;418842.001;4576854.207;60.250;1.000;0.325;0.800;W/O;1.600;0.700;0.595;0.347;90
-30914;To network;125;419457.749;4576557.736;25.290;1.000;0.325;0.800;W/O;1.600;0.700;0.595;0.347;90
-30915;To network;125;419452.612;4576550.966;25.340;1.000;0.195;0.800;W/O;1.600;0.700;0.473;0.244;90
-30917;To network;39;419191.895;4576624.589;37.920;1.000;0.195;0.800;W/O;1.600;0.700;0.473;0.244;90
-30918;To network;59;419033.275;4576779.037;50.050;1.000;0.325;0.800;W/O;1.600;0.700;0.595;0.347;90
-49812;To network;18842;418508.580;4577581.405;36.780;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49813;To network;18842;418518.491;4577582.852;36.910;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49814;To network;18842;418501.779;4577622.282;38.240;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49815;To network;18842;418511.618;4577623.873;38.150;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49816;To network;18843;418601.331;4577602.458;33.940;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49817;To network;18843;418615.222;4577605.208;34.090;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49818;To network;18840;418593.806;4577648.038;37.140;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49819;To network;18840;418607.408;4577650.353;37.030;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49820;To network;18848;418488.177;4577581.043;38.220;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49821;To network;18844;418637.939;4577596.526;32.380;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49822;To network;18844;418640.254;4577580.030;32.370;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49823;To network;20582;418690.609;4577605.497;30.970;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49824;To network;20582;418693.937;4577589.291;30.770;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49825;To network;20575;418699.291;4577623.873;31.580;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49826;To network;18839;418692.056;4577672.347;34.530;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49827;To network;18838;418681.348;4577729.503;37.040;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49828;To network;18858;418672.088;4577787.960;37.570;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49829;To network;18912;418668.326;4577811.980;37.170;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49830;To network;18878;418657.618;4577874.779;34.820;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49831;To network;18881;418651.251;4577901.403;34.030;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49832;To network;18880;418640.833;4577961.887;31.770;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49833;To network;18886;418638.229;4577986.196;30.940;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49834;To network;18885;418629.257;4578044.075;29.450;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49983;To network;18874;418446.495;4577939.649;33.270;1.000;0.475;0.800;W/O;1.600;0.700;0.779;0.323;90
-49984;To network;18870;418341.119;4577922.212;33.970;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49985;To network;18868;418323.900;4577903.836;35.680;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49986;To network;18861;418330.701;4577862.163;38.130;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-49987;To network;18867;418335.766;4577832.355;39.740;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49988;To network;18866;418348.499;4577793.721;42.480;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49989;To network;18866;418366.731;4577760.296;44.610;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49990;To network;18852;418394.223;4577717.755;45.760;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49991;To network;18833;418431.411;4577679.989;43.600;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49992;To network;18833;418434.305;4577664.796;44.410;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49993;To network;18834;418485.672;4577687.224;42.820;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49994;To network;18834;418487.409;4577673.767;42.840;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49995;To network;18835;418533.856;4577695.038;41.510;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49996;To network;18835;418536.316;4577681.870;41.540;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49999;To network;18837;418610.546;4577706.469;39.070;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50000;To network;18837;418613.151;4577690.697;39.270;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50001;To network;18838;418672.332;4577716.308;37.150;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50002;To network;18838;418675.515;4577701.549;37.200;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50003;To network;18836;418584.356;4577738.447;39.990;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50004;To network;18836;418592.170;4577739.894;39.980;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50005;To network;18834;418486.540;4577722.675;43.020;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50006;To network;18834;418493.341;4577723.977;42.900;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50007;To network;18853;418393.211;4577747.273;44.970;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50008;To network;18853;418391.908;4577757.402;44.670;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50010;To network;18854;418435.028;4577755.666;43.710;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50011;To network;18862;418473.952;4577773.753;42.480;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50012;To network;18855;418493.486;4577765.505;42.230;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50013;To network;18855;418492.039;4577772.595;41.990;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50014;To network;18856;418540.513;4577781.132;41.030;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50015;To network;18856;418541.525;4577774.476;41.010;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50016;To network;18911;418586.092;4577792.564;39.900;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50017;To network;18857;418591.301;4577782.435;39.840;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50018;To network;18858;418635.434;4577797.628;38.320;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50019;To network;18858;418636.881;4577790.683;38.830;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50020;To network;18911;418575.240;4577799.075;39.610;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50021;To network;18911;418584.211;4577801.101;39.390;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50022;To network;18876;418567.137;4577845.089;38.040;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50023;To network;18876;418575.963;4577846.680;38.150;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50024;To network;18876;418550.063;4577888.498;37.310;1.000;0.124;0.800;W/O;1.600;0.700;0.411;0.178;90
-50025;To network;18960;418568.439;4577902.678;36.210;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50026;To network;18877;418579.002;4577877.935;36.790;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50027;To network;18877;418577.989;4577887.919;36.680;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50028;To network;18878;418630.659;4577891.537;35.260;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50029;To network;18878;418631.817;4577882.421;35.190;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50030;To network;18876;418527.490;4577886.906;37.480;1.000;0.124;0.800;W/O;1.600;0.700;0.411;0.178;90
-50031;To network;18875;418513.599;4577874.173;37.470;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50032;To network;18862;418467.730;4577814.123;40.680;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50033;To network;18864;418466.283;4577827.002;40.250;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50034;To network;18862;418477.135;4577820.924;40.470;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50035;To network;18863;418419.690;4577816.005;41.670;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50036;To network;18863;418420.558;4577810.217;41.850;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50037;To network;18860;418380.188;4577801.535;42.770;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50038;To network;18863;418370.204;4577804.718;42.590;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50039;To network;18861;418378.596;4577813.111;42.000;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50040;To network;18860;418378.596;4577763.335;44.440;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50041;To network;18861;418361.956;4577848.272;38.890;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50042;To network;18861;418371.795;4577850.153;38.770;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50043;To network;18870;418355.010;4577909.769;33.870;1.000;0.325;0.800;W/O;1.600;0.700;0.595;0.347;90
-50044;To network;18865;418393.500;4577869.109;37.810;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50045;To network;18865;418395.092;4577859.993;38.290;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50046;To network;18864;418440.093;4577876.922;37.820;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50047;To network;18864;418441.684;4577867.662;37.950;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50048;To network;18864;418460.784;4577868.240;37.950;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50049;To network;18864;418469.466;4577869.398;37.840;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50050;To network;18874;418451.958;4577919.753;34.170;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50051;To network;18874;418461.508;4577921.344;34.140;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50052;To network;18879;418559.034;4577952.454;32.340;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50053;To network;18882;418540.078;4578001.507;31.450;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50054;To network;18882;418548.905;4578003.532;31.470;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50055;To network;18872;418440.816;4577988.050;33.180;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50056;To network;18872;418449.787;4577990.076;33.270;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50057;To network;18870;418342.566;4577944.785;36.660;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50058;To network;18871;418391.764;4577975.751;34.810;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50059;To network;18872;418434.160;4578006.426;33.450;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50060;To network;18887;418476.267;4578033.051;32.080;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50061;To network;18883;418525.464;4578055.624;30.390;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50062;To network;18884;418578.279;4578072.987;29.450;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-50009;To network;18854;418433.726;4577764.492;43.710;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-10119;To network;73;418938.384;4576452.404;52.840;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30018;To network;112;418926.282;4576934.563;59.040;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30122;To network;98;419203.109;4576424.990;39.810;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30123;To network;110;419220.584;4576425.471;39.570;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30128;To network;110;419226.682;4576440.354;39.060;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-30014;To network;48;418851.483;4576524.225;58.360;0.300;0.640;0.800;W/O;1.600;0.700;0.496;0.712;90
-49998;To network;18836;418586.092;4577689.973;40.020;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-49997;To network;18836;418584.066;4577703.285;40.100;0.345;0.776;0.800;W/O;1.600;0.700;0.457;0.759;90
-100013;To network;63;419026.748;4576651.486;46.400;0.364;0.780;0.800;W/O;1.600;0.700;0.568;0.742;90
-100012;To network;20607;419018.117;4576678.191;47.400;0.364;0.780;0.800;W/O;1.600;0.700;0.568;0.742;90
+gully_id outlet_type node_id xcoord ycoord zcoord width length depth method weir_cd orifice_cd a_param b_param efficiency
+10063 To_network 76 418940.661 4576439.176 51.980 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+10064 To_network 76 418919.825 4576437.352 52.980 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+10065 To_network 65 418881.033 4576462.317 55.690 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+10116 To_network 75 419066.233 4576368.291 43.690 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+10117 To_network 75 419071.899 4576365.603 43.310 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+10118 To_network 73 418932.959 4576456.101 53.070 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30009 To_network 34 418841.185 4576666.670 54.890 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30010 To_network 34 418855.852 4576705.077 54.570 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30011 To_network 34 418854.988 4576682.225 54.670 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30012 To_network 34 418854.172 4576666.237 54.830 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30013 To_network 46 418840.249 4576620.388 55.900 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30015 To_network 46 418853.740 4576619.236 55.610 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30016 To_network 32 418844.810 4576805.993 59.120 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30017 To_network 112 418940.733 4576959.672 58.060 0.295 0.565 0.800 W/O 1.600 0.700 0.454 0.659 90
+30019 To_network 112 418964.258 4576923.569 57.020 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30020 To_network 113 418978.373 4576899.708 56.190 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30021 To_network 113 418984.518 4576909.550 56.160 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30022 To_network 113 418983.942 4576890.106 55.620 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30023 To_network 113 418989.943 4576886.938 55.620 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30024 To_network 114 419000.889 4576884.441 54.860 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30025 To_network 114 419008.235 4576893.755 54.730 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30026 To_network 114 419025.902 4576881.705 53.290 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30027 To_network 115 419046.210 4576868.070 52.560 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30028 To_network 116 419074.920 4576848.674 50.680 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30029 To_network 116 419094.220 4576835.231 49.420 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30030 To_network 117 419094.124 4576821.597 49.010 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30031 To_network 117 419117.168 4576819.964 47.460 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30032 To_network 118 419139.253 4576805.177 45.990 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30033 To_network 118 419133.204 4576795.383 46.260 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30034 To_network 119 419179.197 4576765.617 43.010 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30035 To_network 120 419223.846 4576734.123 39.760 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30036 To_network 120 419230.567 4576743.629 39.510 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30037 To_network 43 419332.348 4576651.066 31.900 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30038 To_network 44 419366.050 4576636.279 29.700 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30039 To_network 44 419374.308 4576613.523 29.340 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30040 To_network 124 419427.407 4576582.317 26.820 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30041 To_network 124 419419.149 4576573.003 27.350 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30042 To_network 125 419467.687 4576539.156 24.380 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30043 To_network 123 419505.134 4576528.354 22.900 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30044 To_network 123 419498.029 4576519.136 23.250 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30045 To_network 234 419553.912 4576495.995 20.950 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30046 To_network 234 419547.959 4576486.009 21.000 0.295 0.565 0.800 W/O 1.600 0.700 0.454 0.659 90
+30047 To_network 20587 419585.070 4576475.303 19.670 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30048 To_network 20587 419579.693 4576465.317 19.860 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30049 To_network 123 419490.011 4576483.945 23.490 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30050 To_network 131 419446.706 4576446.017 25.470 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30051 To_network 127 419325.866 4576339.724 31.000 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30052 To_network 126 419299.029 4576316.151 32.180 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30053 To_network 95 419222.261 4576222.148 35.080 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30054 To_network 100 419269.983 4576263.821 32.870 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30055 To_network 129 419391.735 4576374.003 28.080 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30056 To_network 94 419147.751 4576226.421 37.090 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30057 To_network 92 419134.092 4576266.629 38.490 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30058 To_network 92 419122.858 4576259.140 38.450 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30059 To_network 91 419089.635 4576325.201 40.870 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30060 To_network 90 419070.431 4576327.794 41.290 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30061 To_network 78 418992.223 4576405.185 47.380 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30062 To_network 77 418966.778 4576406.145 48.220 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30066 To_network 52 418926.306 4576686.185 51.420 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30067 To_network 35 418971.435 4576662.949 49.710 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30068 To_network 35 418972.587 4576676.295 49.490 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30069 To_network 20607 418989.391 4576659.108 48.400 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30073 To_network 64 419083.586 4576654.019 43.730 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30074 To_network 64 419080.417 4576640.672 43.540 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30075 To_network 37 419114.888 4576633.567 41.960 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30076 To_network 37 419126.410 4576627.518 41.220 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30077 To_network 41 419253.060 4576615.611 35.320 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30079 To_network 43 419336.020 4576624.157 31.150 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30080 To_network 40 419234.432 4576646.482 36.210 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30081 To_network 40 419216.956 4576643.985 36.900 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30082 To_network 40 419211.195 4576595.591 38.360 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30083 To_network 101 419201.881 4576507.062 39.970 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30084 To_network 101 419224.446 4576508.310 39.330 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30085 To_network 88 419205.338 4576478.640 39.690 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30086 To_network 88 419200.441 4576491.506 40.010 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30087 To_network 87 419120.745 4576510.902 45.360 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30088 To_network 86 419089.443 4576503.221 47.200 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30089 To_network 82 419059.821 4576502.837 48.610 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30090 To_network 82 418999.425 4576533.467 51.410 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30091 To_network 68 418958.233 4576560.352 53.300 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30092 To_network 67 418949.207 4576566.882 53.350 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30093 To_network 67 418951.607 4576572.067 52.420 0.295 0.565 0.800 W/O 1.600 0.700 0.454 0.659 90
+30094 To_network 71 418975.612 4576620.268 49.650 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30095 To_network 71 418968.699 4576619.308 49.930 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30096 To_network 35 418975.540 4576655.675 49.410 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30097 To_network 35 418982.165 4576655.291 48.930 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30098 To_network 31 418865.193 4576816.215 57.650 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30099 To_network 54 418922.703 4576804.383 54.550 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30100 To_network 57 418942.248 4576801.013 53.670 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30101 To_network 58 418976.021 4576793.824 51.960 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30102 To_network 59 419034.979 4576782.038 50.140 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30103 To_network 59 419041.412 4576784.342 49.810 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30104 To_network 59 419048.182 4576782.182 49.810 0.295 0.565 0.800 W/O 1.600 0.700 0.454 0.659 90
+30105 To_network 59 419068.394 4576824.142 50.230 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30106 To_network 116 419078.476 4576827.119 50.070 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30107 To_network 116 419071.850 4576836.625 50.400 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30108 To_network 61 419036.035 4576769.844 49.850 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30109 To_network 62 419024.129 4576707.383 47.900 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30111 To_network 37 419119.620 4576626.775 41.640 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30112 To_network 83 419108.194 4576571.276 44.300 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30113 To_network 86 419094.367 4576505.791 46.990 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30114 To_network 80 419120.292 4576462.774 44.350 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30115 To_network 79 419105.505 4576427.247 44.070 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30120 To_network 68 418978.328 4576512.800 53.310 0.295 0.565 0.800 W/O 1.600 0.700 0.454 0.659 90
+30121 To_network 68 418983.993 4576532.388 52.150 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30124 To_network 98 419201.909 4576395.224 39.900 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30125 To_network 97 419199.796 4576352.976 39.210 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30126 To_network 96 419216.407 4576315.624 37.270 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30127 To_network 98 419219.384 4576393.688 39.530 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30129 To_network 110 419226.946 4576433.776 39.140 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30130 To_network 107 419355.611 4576511.936 30.950 0.475 0.975 0.800 W/O 1.600 0.700 0.818 0.758 90
+30131 To_network 106 419382.689 4576539.541 29.490 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30132 To_network 45 419406.166 4576576.461 27.910 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30133 To_network 45 419411.639 4576571.948 27.650 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30134 To_network 46 418854.319 4576642.066 55.020 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30135 To_network 82 419022.257 4576526.171 50.180 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30136 To_network 84 419104.641 4576523.194 46.120 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+30913 To_network 31 418842.001 4576854.207 60.250 1.000 0.325 0.800 W/O 1.600 0.700 0.595 0.347 90
+30914 To_network 125 419457.749 4576557.736 25.290 1.000 0.325 0.800 W/O 1.600 0.700 0.595 0.347 90
+30915 To_network 125 419452.612 4576550.966 25.340 1.000 0.195 0.800 W/O 1.600 0.700 0.473 0.244 90
+30917 To_network 39 419191.895 4576624.589 37.920 1.000 0.195 0.800 W/O 1.600 0.700 0.473 0.244 90
+30918 To_network 59 419033.275 4576779.037 50.050 1.000 0.325 0.800 W/O 1.600 0.700 0.595 0.347 90
+49812 To_network 18842 418508.580 4577581.405 36.780 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49813 To_network 18842 418518.491 4577582.852 36.910 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49814 To_network 18842 418501.779 4577622.282 38.240 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49815 To_network 18842 418511.618 4577623.873 38.150 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49816 To_network 18843 418601.331 4577602.458 33.940 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49817 To_network 18843 418615.222 4577605.208 34.090 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49818 To_network 18840 418593.806 4577648.038 37.140 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49819 To_network 18840 418607.408 4577650.353 37.030 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49820 To_network 18848 418488.177 4577581.043 38.220 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49821 To_network 18844 418637.939 4577596.526 32.380 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49822 To_network 18844 418640.254 4577580.030 32.370 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49823 To_network 20582 418690.609 4577605.497 30.970 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49824 To_network 20582 418693.937 4577589.291 30.770 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49825 To_network 20575 418699.291 4577623.873 31.580 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49826 To_network 18839 418692.056 4577672.347 34.530 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49827 To_network 18838 418681.348 4577729.503 37.040 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49828 To_network 18858 418672.088 4577787.960 37.570 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49829 To_network 18912 418668.326 4577811.980 37.170 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49830 To_network 18878 418657.618 4577874.779 34.820 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49831 To_network 18881 418651.251 4577901.403 34.030 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49832 To_network 18880 418640.833 4577961.887 31.770 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49833 To_network 18886 418638.229 4577986.196 30.940 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49834 To_network 18885 418629.257 4578044.075 29.450 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49983 To_network 18874 418446.495 4577939.649 33.270 1.000 0.475 0.800 W/O 1.600 0.700 0.779 0.323 90
+49984 To_network 18870 418341.119 4577922.212 33.970 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49985 To_network 18868 418323.900 4577903.836 35.680 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49986 To_network 18861 418330.701 4577862.163 38.130 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+49987 To_network 18867 418335.766 4577832.355 39.740 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49988 To_network 18866 418348.499 4577793.721 42.480 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49989 To_network 18866 418366.731 4577760.296 44.610 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49990 To_network 18852 418394.223 4577717.755 45.760 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49991 To_network 18833 418431.411 4577679.989 43.600 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49992 To_network 18833 418434.305 4577664.796 44.410 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49993 To_network 18834 418485.672 4577687.224 42.820 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49994 To_network 18834 418487.409 4577673.767 42.840 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49995 To_network 18835 418533.856 4577695.038 41.510 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49996 To_network 18835 418536.316 4577681.870 41.540 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49999 To_network 18837 418610.546 4577706.469 39.070 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50000 To_network 18837 418613.151 4577690.697 39.270 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50001 To_network 18838 418672.332 4577716.308 37.150 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50002 To_network 18838 418675.515 4577701.549 37.200 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50003 To_network 18836 418584.356 4577738.447 39.990 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50004 To_network 18836 418592.170 4577739.894 39.980 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50005 To_network 18834 418486.540 4577722.675 43.020 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50006 To_network 18834 418493.341 4577723.977 42.900 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50007 To_network 18853 418393.211 4577747.273 44.970 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50008 To_network 18853 418391.908 4577757.402 44.670 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50010 To_network 18854 418435.028 4577755.666 43.710 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50011 To_network 18862 418473.952 4577773.753 42.480 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50012 To_network 18855 418493.486 4577765.505 42.230 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50013 To_network 18855 418492.039 4577772.595 41.990 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50014 To_network 18856 418540.513 4577781.132 41.030 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50015 To_network 18856 418541.525 4577774.476 41.010 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50016 To_network 18911 418586.092 4577792.564 39.900 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50017 To_network 18857 418591.301 4577782.435 39.840 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50018 To_network 18858 418635.434 4577797.628 38.320 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50019 To_network 18858 418636.881 4577790.683 38.830 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50020 To_network 18911 418575.240 4577799.075 39.610 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50021 To_network 18911 418584.211 4577801.101 39.390 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50022 To_network 18876 418567.137 4577845.089 38.040 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50023 To_network 18876 418575.963 4577846.680 38.150 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50024 To_network 18876 418550.063 4577888.498 37.310 1.000 0.124 0.800 W/O 1.600 0.700 0.411 0.178 90
+50025 To_network 18960 418568.439 4577902.678 36.210 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50026 To_network 18877 418579.002 4577877.935 36.790 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50027 To_network 18877 418577.989 4577887.919 36.680 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50028 To_network 18878 418630.659 4577891.537 35.260 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50029 To_network 18878 418631.817 4577882.421 35.190 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50030 To_network 18876 418527.490 4577886.906 37.480 1.000 0.124 0.800 W/O 1.600 0.700 0.411 0.178 90
+50031 To_network 18875 418513.599 4577874.173 37.470 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50032 To_network 18862 418467.730 4577814.123 40.680 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50033 To_network 18864 418466.283 4577827.002 40.250 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50034 To_network 18862 418477.135 4577820.924 40.470 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50035 To_network 18863 418419.690 4577816.005 41.670 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50036 To_network 18863 418420.558 4577810.217 41.850 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50037 To_network 18860 418380.188 4577801.535 42.770 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50038 To_network 18863 418370.204 4577804.718 42.590 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50039 To_network 18861 418378.596 4577813.111 42.000 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50040 To_network 18860 418378.596 4577763.335 44.440 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50041 To_network 18861 418361.956 4577848.272 38.890 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50042 To_network 18861 418371.795 4577850.153 38.770 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50043 To_network 18870 418355.010 4577909.769 33.870 1.000 0.325 0.800 W/O 1.600 0.700 0.595 0.347 90
+50044 To_network 18865 418393.500 4577869.109 37.810 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50045 To_network 18865 418395.092 4577859.993 38.290 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50046 To_network 18864 418440.093 4577876.922 37.820 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50047 To_network 18864 418441.684 4577867.662 37.950 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50048 To_network 18864 418460.784 4577868.240 37.950 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50049 To_network 18864 418469.466 4577869.398 37.840 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50050 To_network 18874 418451.958 4577919.753 34.170 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50051 To_network 18874 418461.508 4577921.344 34.140 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50052 To_network 18879 418559.034 4577952.454 32.340 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50053 To_network 18882 418540.078 4578001.507 31.450 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50054 To_network 18882 418548.905 4578003.532 31.470 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50055 To_network 18872 418440.816 4577988.050 33.180 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50056 To_network 18872 418449.787 4577990.076 33.270 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50057 To_network 18870 418342.566 4577944.785 36.660 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50058 To_network 18871 418391.764 4577975.751 34.810 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50059 To_network 18872 418434.160 4578006.426 33.450 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50060 To_network 18887 418476.267 4578033.051 32.080 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50061 To_network 18883 418525.464 4578055.624 30.390 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50062 To_network 18884 418578.279 4578072.987 29.450 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+50009 To_network 18854 418433.726 4577764.492 43.710 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+10119 To_network 73 418938.384 4576452.404 52.840 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30018 To_network 112 418926.282 4576934.563 59.040 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30122 To_network 98 419203.109 4576424.990 39.810 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30123 To_network 110 419220.584 4576425.471 39.570 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30128 To_network 110 419226.682 4576440.354 39.060 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+30014 To_network 48 418851.483 4576524.225 58.360 0.300 0.640 0.800 W/O 1.600 0.700 0.496 0.712 90
+49998 To_network 18836 418586.092 4577689.973 40.020 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+49997 To_network 18836 418584.066 4577703.285 40.100 0.345 0.776 0.800 W/O 1.600 0.700 0.457 0.759 90
+100013 To_network 63 419026.748 4576651.486 46.400 0.364 0.780 0.800 W/O 1.600 0.700 0.568 0.742 90
+100012 To_network 20607 419018.117 4576678.191 47.400 0.364 0.780 0.800 W/O 1.600 0.700 0.568 0.742 90
diff --git a/test/test_create_project.py b/test/test_create_project.py
index f0d616a83..07030777c 100644
--- a/test/test_create_project.py
+++ b/test/test_create_project.py
@@ -11,7 +11,7 @@
from .test_giswater import GwTest
from ..core.admin.gis_file_create import GwGisFileCreate
from .. import global_vars
-from ..lib import tools_db
+from ..lib import tools_db, tools_log
# dummy instance to replace qgis.utils.iface
@@ -67,7 +67,7 @@ def connect_to_database(self, service_name):
if self.test_giswater.global_vars.session_vars['last_error']:
msg = self.test_giswater.global_vars.session_vars['last_error']
- print(f"Database connection error: {msg}")
+ tools_log.log_info(f"Database connection error: {msg}")
return False
return True