37 lines
1.6 KiB
Python
Raw Normal View History

2016-04-24 16:17:39 +02:00
# -*- coding: utf-8 -*-
"""
***************************************************************************
i_evapo_mh.py
-------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
***************************************************************************
* *
* 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__ = 'Médéric Ribreux'
__date__ = 'March 2016'
__copyright__ = '(C) 2016, Médéric Ribreux'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
2017-12-29 17:13:30 +01:00
def checkParameterValuesBeforeExecuting(alg, parameters, context):
if (alg.parameterAsBool(parameters, '-h', context)
and alg.parameterAsLayer(parameters, 'precipitation', context)):
2016-04-24 16:17:39 +02:00
return alg.tr('You can\'t use original Hargreaves flag and precipitation parameter together!')
2017-12-29 17:13:30 +01:00
if (not alg.parameterAsBool(parameters, '-h', context)
and not alg.parameterAsLayer(parameters, 'precipitation', context)):
2016-04-24 16:17:39 +02:00
return alg.tr('If you don\'t use original Hargreaves flag, you must set the precipitation raster parameter!')
return None