Skip to content

Commit

Permalink
8.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
semiautomaticgit committed Aug 2, 2024
1 parent 9ab5dd5 commit 7366b7f
Show file tree
Hide file tree
Showing 112 changed files with 67,830 additions and 43,090 deletions.
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# classification of remote sensing images, providing tools for the download,
# the preprocessing and postprocessing of images.
# begin: 2012-12-29
# Copyright (C) 2012-2023 by Luca Congedo.
# Copyright (C) 2012-2024 by Luca Congedo.
# Author: Luca Congedo
# Email: [email protected]
#
Expand Down Expand Up @@ -34,7 +34,7 @@ def description():


def version():
return 'Version 8.2.2 - Infinity'
return 'Version 8.3.0 - Infinity'


def icon():
Expand Down
11 changes: 7 additions & 4 deletions core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# classification of remote sensing images, providing tools for the download,
# the preprocessing and postprocessing of images.
# begin: 2012-12-29
# Copyright (C) 2012-2023 by Luca Congedo.
# Copyright (C) 2012-2024 by Luca Congedo.
# Author: Luca Congedo
# Email: [email protected]
#
Expand All @@ -27,9 +27,10 @@
scatter_plot_dlg = widget_dialog = settings = system_platform = logger = None
util_qgis = rs = bandset_catalog = plugin_dir = temp_dir = accuracy = None
dialog_accepted = class_report = class_vector = script = band_calc = None
cross_classification = dilation = erosion = sieve = neighbor = rgb_combo = None
reclassification = band_combination = pca_tab = vector_to_raster = None
stack_bandset = split_bands = reproject_bands = masking_bands = None
cross_classification = dilation = rgb_combo = neighbor = clustering = None
reclassification = band_combination = pca_tab = vector_to_raster = sieve = None
stack_bandset = split_bands = reproject_bands = masking_bands = erosion = None
spectral_distance = raster_zonal_stats = None
image_conversion = clip_bands = clip_bands_pointer = mosaic_bandsets = None
download_products = download_products_pointer = util_qt = translate = None
classification = working_toolbar = classification_preview_pointer = None
Expand Down Expand Up @@ -61,6 +62,8 @@
download_table = preprocess_band_table = None
# classification preview layer
classification_preview = classifier_preview = preview_point = None
# edit raster
edit_old_array = edit_column_start = edit_row_start = None
# saved directory
last_saved_dir = ''
project_path = ''
Expand Down
205 changes: 172 additions & 33 deletions core/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# classification of remote sensing images, providing tools for the download,
# the preprocessing and postprocessing of images.
# begin: 2012-12-29
# Copyright (C) 2012-2023 by Luca Congedo.
# Copyright (C) 2012-2024 by Luca Congedo.
# Author: Luca Congedo
# Email: [email protected]
#
Expand All @@ -21,7 +21,8 @@
# If not, see <https://www.gnu.org/licenses/>.


from PyQt5.QtWidgets import QMessageBox, QToolButton
from PyQt5.QtWidgets import QMessageBox, QToolButton, QApplication
# noinspection PyUnresolvedReferences
from qgis.core import Qgis

cfg = __import__(str(__name__).split('.')[0] + '.core.config', fromlist=[''])
Expand Down Expand Up @@ -52,7 +53,13 @@ def msg_bar(title, message):

# message bar information
def msg_bar_info(message):
msg_bar(cfg.translate('SCP information'), message)
# noinspection PyTypeChecker
msg_bar(
QApplication.translate(
'semiautomaticclassificationplugin',
'SCP information'
), message
)


# Message bar error
Expand All @@ -67,7 +74,11 @@ def msg_bar_critical(title, message):

# Message bar error
def msg_bar_error(message):
msg_bar_critical(cfg.translate('Error'), message=message)
# noinspection PyTypeChecker
msg_bar_critical(
QApplication.translate('semiautomaticclassificationplugin', 'Error'),
message=message
)


# message bar warning
Expand All @@ -82,7 +93,12 @@ def _msg_bar_warning(title, message):

# message bar warning
def msg_bar_warning(message):
_msg_bar_warning(title=cfg.translate('Warning'), message=message)
# noinspection PyTypeChecker
_msg_bar_warning(
title=QApplication.translate(
'semiautomaticclassificationplugin', 'Warning'
), message=message
)


''' Messages for callback '''
Expand All @@ -108,111 +124,234 @@ def error(message):


def msg_test(message):
msg_box(cfg.translate('Test results'), message)
# noinspection PyTypeChecker
msg_box(
QApplication.translate(
'semiautomaticclassificationplugin', 'Test results'
), message
)


def msg_inf_1():
msg_bar_info(cfg.translate('Training input cannot be edited'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin',
'Training input cannot be edited'
)
)


def msg_inf_2():
msg_bar_info(cfg.translate('At least 3 points are required'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin',
'At least 3 points are required'
)
)


def msg_inf_3():
msg_bar_info(cfg.translate('Detailed log is active'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin', 'Detailed log is active'
)
)


def msg_inf_4():
msg_bar_info(cfg.translate('Training vector exported'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin', 'Training vector exported'
)
)


def msg_inf_5():
msg_bar_info(cfg.translate('Enter class values'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin', 'Enter class values'
)
)


def msg_inf_6():
msg_bar_info(cfg.translate('Process completed'))
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin', 'Process completed'
)
)


def msg_inf_7():
# noinspection PyTypeChecker
msg_bar_info(
QApplication.translate(
'semiautomaticclassificationplugin', 'Training Band set updated'
)
)


""" Errors """


def msg_err_1():
msg_bar_error(cfg.translate('Process failed'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Process failed'
)
)


def msg_err_2():
msg_bar_error(cfg.translate('Bandset not found'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Bandset not found'
)
)


def msg_err_3():
msg_bar_error(cfg.translate('Area coordinates error'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Area coordinates error'
)
)


def msg_err_4():
msg_bar_error(cfg.translate('Unable to create RGB color composite'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin',
'Unable to create RGB color composite'
)
)


def msg_err_5():
msg_bar_error(cfg.translate('Unable to open file'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Unable to open file'
)
)


def msg_err_6():
msg_bar_error(cfg.translate('Unable to calculate'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Unable to calculate'
)
)


def msg_err_7():
msg_bar_error(cfg.translate('Expression error'))
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin', 'Expression error'
)
)


def msg_err_8():
# noinspection PyTypeChecker
msg_bar_error(
QApplication.translate(
'semiautomaticclassificationplugin',
'Incompatible CRS, please create a new training input'
)
)


""" Warnings """


def msg_war_1():
msg_bar_warning(cfg.translate('Pixel resolution undefined'))
# noinspection PyTypeChecker
msg_bar_warning(
QApplication.translate(
'semiautomaticclassificationplugin', 'Pixel resolution undefined'
)
)


def msg_war_2():
# noinspection PyTypeChecker
msg_bar_warning(
cfg.translate(
QApplication.translate(
'semiautomaticclassificationplugin',
'Unable to define hidden layer size, setting default 100'
)
)
)


def msg_war_3():
# noinspection PyTypeChecker
msg_bar_warning(
cfg.translate(
QApplication.translate(
'semiautomaticclassificationplugin',
'Point outside band set or band set not defined'
)
)
)


def msg_war_4():
msg_bar_warning(cfg.translate('ROI not found'))
# noinspection PyTypeChecker
msg_bar_warning(
QApplication.translate(
'semiautomaticclassificationplugin', 'ROI not found'
)
)


def msg_war_5():
# noinspection PyTypeChecker
msg_bar_warning(
cfg.translate(
QApplication.translate(
'semiautomaticclassificationplugin',
'Select a training input; input is not loaded'
)
)
)


def msg_war_6(bandset_number=None):
# noinspection PyTypeChecker
msg_bar_warning(
cfg.translate('Band set') + ' ' + str(bandset_number) + ' '
+ cfg.translate('is empty')
QApplication.translate(
'semiautomaticclassificationplugin', 'Band set'
) + ' ' + str(bandset_number) + ' '
+ QApplication.translate(
'semiautomaticclassificationplugin', 'is empty'
)
)


def msg_war_7():
msg_bar_warning(cfg.translate(
'No band found. Check metadata inside the directory')
)
# noinspection PyTypeChecker
msg_bar_warning(
QApplication.translate(
'semiautomaticclassificationplugin',
'No band found. Check metadata inside the directory'
)
)


def msg_war_8():
msg_bar_warning(cfg.translate('No tool selected'))
# noinspection PyTypeChecker
msg_bar_warning(
QApplication.translate(
'semiautomaticclassificationplugin',
'No tool selected'
)
)
Loading

0 comments on commit 7366b7f

Please sign in to comment.