[general]
name=Midvatten
qgisMinimumVersion=3.40
description=A toolset that makes QGIS an interface for editing/viewing hydrogeological observational data (drillings, water levels, seismic data etc) stored in a SQLite or PostgreSQL database.
about=The plugin is a toolset that makes QGIS an interface for editing/viewing hydrogeological observational data (drillings, water levels, seismic data etc) stored in a SQLite or PostgreSQL database. NOTE: This plugin requires the Python packages pandas and matplotlib (numpy is always present in QGIS). The qpip helper plugin (installed with Midvatten) offers to install them on first start — leave the preselected actions and press OK. This is a one-time step.
version=2.0.1
author=Henrik Spångmyr, Josef Källgården
email=midvattenplugin@midvatten.se
repository=https://github.com/henrikspa/qgis-midvatten-plugin.git
license=GPLv2
qgisMaximumVersion=4.99

#optional metadata entries
experimental=False
deprecated=False
tags=hydrogeology,groundwater,time series,stratigraphy,piper diagram,borehole
homepage=https://github.com/henrikspa/qgis-midvatten-plugin/wiki
tracker=https://github.com/henrikspa/qgis-midvatten-plugin/issues?state=open
icon=icons/MidvSettings.png
plugin_dependencies=qpip

hasProcessingProvider=no
supportsQt6=True

changelog=
        Version 2.0.1:
          - Packaging: Pass the plugins.qgis.org security scan. Annotated 104 safe SQL statements (identifiers built through the validated, quoted safe-SQL layer, with bound query parameters) as reviewed false positives, replaced one internal assert with an explicit error check, and cleared the executable bit from packaged Python files. No functional or user-facing changes.
        Version 2.0.0:
          - Qt6: The plugin now runs on both Qt5 and Qt6 builds of QGIS.
          - Qt6: The stratigraphy print dialog's legacy Qt5 orientation fallback now uses the scoped QPrinter.Orientation.Landscape spelling (Qt6 removed the unscoped QPrinter.Landscape). Also adopted the shared Qt6 static compatibility guard used across midv plugins.
          - Database: Added w_logger_series table; logger series metadata (source, instrument/serial, description, comment) moved there from w_levels_logger, with rows linked via series_id. Export to SpatiaLite migrates the old source column.
          - Database: Added screen (with diam_inner/diam_outer) and zz_screen_plots tables, plus tem_data and profile_images tables; w_qual_logger, s_qual_lab and spatial_history are regular tables in new databases.
          - Database: Added ON DELETE/UPDATE CASCADE to all obsid foreign keys, and unique indexes on (obsid, date_time) for w_levels_logger, w_levels, w_flow, w_qual_field and meteo.
          - Database: Unified duplicate-reading rule to one row per obsid per second on both SpatiaLite and PostGIS; date_time is stored raw. Existing PostgreSQL databases must run definitions/upgrade_postgresql_to_2_0_0.sql once to install midv_to_instant, deduplicate, and rebuild unique indexes.
          - Database: PostgreSQL/PostGIS now supports configurable schemas.
          - Security: CSV import validates declared column types; generated reports (drill reports, custom drill reports, water quality reports) escape text values; section plot TEM data is parsed safely instead of with eval(); reports and CSV exports are written to private per-run temporary folders. A malformed or malicious database can no longer inject or execute code.
          - Logger import: Unified import dialog for DiverOffice, Levelogger and HOBO files; DiverOffice Baro imports barometric pressure into the meteo table; instrument serial numbers are stored in w_logger_series; the format dropdown describes each format and its destination table.
          - Logger import: Parsing and database writes no longer block QGIS; progress dialog with working Cancel; fixed severe freezes on large tables (index-friendly duplicate check); a locked database now gives a Retry/Cancel dialog instead of a traceback; clearer timezone prompt.
          - LoggerEditor: New duplicate-timestamp resolution workflow - a banner and red period markers show where duplicates remain, and a non-modal dialog bulk-removes redundant copies, scoped to the selected period; duplicate timestamps no longer crash Save. All changes are undoable.
          - LoggerEditor: New Series tab for creating, assigning and editing w_logger_series metadata (modern schema); series changes participate in undo/redo and save atomically with level adjustments.
          - LoggerEditor: Much faster loading and saving on large and PostgreSQL datasets (caching, vectorised hot paths, batched range-based writes); reference series panel with filters and plot options; multicursor crosshair; clearer adjust-trend markers; starts clean until an obsid is selected; many plot and undo fixes.
          - CSV import: Reworked dialog with progressive disclosure - the table selector is in the left panel and Start import stays disabled until a file is loaded and a destination table is chosen; a logger series metadata block maps source/instrument/description/comment when importing to w_levels_logger; w_qual_lab parameter and unit strings are cleaned mechanically, with the cleaned values listed in the log.
          - Interlab4 import: Destination table toggle (w_qual_lab / s_qual_lab); bulk obsid assignment dialog with search, fill, skip and sort that keeps an in-session draft and no longer blocks the QGIS main window, so missing obs_points can be created and reloaded while assigning; parsing problems are collected into a single summary; UTF-16 files no longer trigger an unnecessary charset question.
          - FieldLogger: Import and export support FieldForm; settings changes update the open export dialog in place; resizable, scrollable export preview; fixed empty import window on cancelled file dialog and "wrapped C/C++ object ... has been deleted" errors.
          - SectionPlot: Support for TEM2Go data with fit plotting and gaps, background images (for example resistivity), a well screen overlay with configurable style, reverse x-axis button, clip checkbox, a button to detach the figure, and the section line name in the x-axis label; right-click flashes the distance on the section line; profile line layers without an obsid column are supported.
          - Reports: Drill reports and custom drill reports show a progress dialog with a working Cancel button.
          - Export CSV: New export dialog with an option to convert HTML rich-text fields to plain text (default on), fixing broken rows in Excel/LibreOffice.
          - Load layers: Added a screens tab linked to obs_points in the form view.
          - CustomPlot: Added a style-fix dialog to repair plot templates across matplotlib versions.
          - UX: Many status and "nothing selected" popups moved to the QGIS message bar; errors show a short message with full details in the log panel.
          - Reliability: The plugin loads with SpatiaLite databases even when psycopg2 is not installed; SpatiaLite databases on Windows paths with backslashes open correctly; fixed a stratigraphy plot crash on Windows; fixed a spurious "Database setting was empty" error for new projects.
          This release was developed and tested as the 1.9.0 beta series and is published as 2.0.0. The major version bump reflects that the frontend, the backend and the database schema changed enough to break third-party code built on 1.x. For detailed per-beta changes see CHANGELOG_HISTORY.
        Version 1.8.6:
        - LoggerEditor: " (uncalibrated)" now only written after obsids in the list when last value is NULL.
        Version 1.8.5:
        - CreateDb: Fix for Postgresql 17 (and probably earlier).
        - db_utils: Fix for Postgresql 17 (and probably earlier).
        Version 1.8.4:
        - DiverofficeImport: Added feature to add comment to source column during import.
        Version 1.8.3:
        - Fixes missing schema parameter in get_table_info.
        Version 1.8.2:
        - Fixed spelling for layer w_qual_field.
        Version 1.8.1
        - Database connection to PostgreSQL/PostGIS now supports "service" (pg_service.conf).
        - db_utils: Fixes to allow parts of the utils to be used with other database schemas.
        - Fixes for error messages.

        - LoggerEditor: Printing trend adjustment to log.
        - FieldloggerImport: Fixes support for import of FieldForm result files.
        - FieldLoggerImport: Fixes error "wrapped C/C++ object ... has been deleted".
        - FieldLoggerExport: Fixes support for FieldForm and changed vector layer list to QgsMapLayerComboBox.
        - Sectionplot: Fixes a bug in two templates.
        - Sectionplot: Fixes adjustment of graded dems to QGIS 3.40.
        - Sectionplot: Fix to only check geometry of selected layer.
        - PrepareforQgis2Threejs: Fixes for postgis databases.


        Version 1.8.0:
        - Added column "source" to table w_levels_logger table. Can be used to separate
            logger series in the logger editor.
        - Added column "type" to table comments. Can be used to group types of comments.
        - FieldLogger export: Added support for FieldForm.
        - Customplot: Adjustments for matplotlib 3.8.4.


        For changes until ver 1.8.0, see separate document CHANGELOG_HISTORY
