Skip to content

Commit

Permalink
Files for QGIS 3 added
Browse files Browse the repository at this point in the history
  • Loading branch information
HUGIN-NSJ committed Oct 15, 2019
1 parent 7ba62c0 commit 41aa55e
Show file tree
Hide file tree
Showing 4 changed files with 900 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
HuginQGIS
A QGIS plugin
Perform spatial probabilistic analysis using HUGIN Bayesian Networks
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2019-10-10
copyright : (C) 2019 by Hugin Expert A/S
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
This script initializes the plugin, making it known to QGIS.
"""

__author__ = 'Hugin Expert A/S'
__date__ = '2019-10-10'
__copyright__ = '(C) 2019 by Hugin Expert A/S'


# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
"""Load HuginQGIS class from file HuginQGIS.
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
#
from .hugin_qgis import HuginQGISPlugin
return HuginQGISPlugin()
60 changes: 60 additions & 0 deletions src/hugin_qgis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-

"""
/***************************************************************************
HuginQGIS
A QGIS plugin
Perform spatial probabilistic analysis using HUGIN Bayesian Networks
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
-------------------
begin : 2019-10-10
copyright : (C) 2019 by Hugin Expert A/S
email : [email protected]
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""

__author__ = 'Hugin Expert A/S'
__date__ = '2019-10-10'
__copyright__ = '(C) 2019 by Hugin Expert A/S'

# This will get replaced with a git SHA1 when you do a git archive

__revision__ = '$Format:%H$'

import os
import sys
import inspect

from qgis.core import QgsProcessingAlgorithm, QgsApplication
from .hugin_qgis_provider import HuginQGISProvider

cmd_folder = os.path.split(inspect.getfile(inspect.currentframe()))[0]

if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)


class HuginQGISPlugin(object):

def __init__(self):
self.provider = None

def initProcessing(self):
"""Init Processing provider for QGIS >= 3.8."""
self.provider = HuginQGISProvider()
QgsApplication.processingRegistry().addProvider(self.provider)

def initGui(self):
self.initProcessing()

def unload(self):
QgsApplication.processingRegistry().removeProvider(self.provider)
Loading

0 comments on commit 41aa55e

Please sign in to comment.