diff --git a/CenIsere_AUTOMAP/CenIsere_AutoMap.py b/CenIsere_AUTOMAP/CenIsere_AutoMap.py index c64978f..2507612 100644 --- a/CenIsere_AUTOMAP/CenIsere_AutoMap.py +++ b/CenIsere_AUTOMAP/CenIsere_AutoMap.py @@ -50,7 +50,7 @@ class PgAutoMap: maj_verif(NAME) # Display About window on first use - version = qgis.utils.pluginMetadata('CenRa_AUTOMAP','version') + version = qgis.utils.pluginMetadata('CenIsere_AUTOMAP','version') s = QSettings() versionUse = s.value("automap/version", 1, type=str) if str(versionUse) != str(version) : @@ -61,20 +61,20 @@ class PgAutoMap: def initGui(self): """ Build the plugin GUI. """ - self.toolBar = iface.addToolBar("CenRa_AutoMap") - self.toolBar.setObjectName("CenRa_AutoMap") + self.toolBar = iface.addToolBar("CenIsere_AutoMap") + self.toolBar.setObjectName("CenIsere_AutoMap") icon = QIcon(resources_path('icons', 'icon.png')) # Open the online help - self.help_action = QAction(icon, 'CenRa_AutoMap', iface.mainWindow()) + self.help_action = QAction(icon, 'CenIsere_AutoMap', iface.mainWindow()) iface.pluginHelpMenu().addAction(self.help_action) self.help_action.triggered.connect(self.open_help) if not self.canvas_editor: self.canvas_editor = AutoMap_Editor() - self.automap_action = QAction(icon, 'CenRa_AutoMap',None) + self.automap_action = QAction(icon, 'CenIsere_AutoMap',None) self.toolBar.addAction(self.automap_action) self.automap_action.triggered.connect(self.open_editor) ''' @@ -118,7 +118,7 @@ class PgAutoMap: dialog.exec_() def open_help(): """ Open the online help. """ - QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/')) + QDesktopServices.openUrl(QUrl('https://plateformesig.CenIsere-outils.org/')) def open_editor(self): self.canvas_editor.show() @@ -127,7 +127,7 @@ class PgAutoMap: def unload(self): """ Unload the plugin. """ if self.canvas_editor: - iface.removePluginMenu('CenRa_AutoMap',self.automap_action) + iface.removePluginMenu('CenIsere_AutoMap',self.automap_action) if self.provider: QgsApplication.processingRegistry().removeProvider(self.provider) diff --git a/CenIsere_AUTOMAP/README.md b/CenIsere_AUTOMAP/README.md index 72f88d5..9ee5c05 100644 --- a/CenIsere_AUTOMAP/README.md +++ b/CenIsere_AUTOMAP/README.md @@ -1,4 +1 @@ -# CenRa_AutoMap ---- -Outil de création de mise en page, -Permet de préprogramé des mise en page pour les mêtre à disposition des collégue. +# CenIsere_AutoMap diff --git a/CenIsere_AUTOMAP/__init__.py b/CenIsere_AUTOMAP/__init__.py index f0ed432..8ce8350 100644 --- a/CenIsere_AUTOMAP/__init__.py +++ b/CenIsere_AUTOMAP/__init__.py @@ -1,10 +1,10 @@ -# -*- coding: utf-8 -*- __copyright__ = "Copyright 2021, 3Liz" __license__ = "GPL version 3" __email__ = "info@3liz.org" -def classFactory(iface): +# noinspection PyPep8Naming +def classFactory(iface): # pylint: disable=invalid-name _ = iface - from CenRa_AUTOMAP.CenRa_AutoMap import PgAutoMap + from CenIsere_AUTOMAP.CenIsere_AutoMap import PgAutoMap return PgAutoMap() diff --git a/CenIsere_AUTOMAP/about_form.py b/CenIsere_AUTOMAP/about_form.py index 3d9836b..bf9d5f2 100644 --- a/CenIsere_AUTOMAP/about_form.py +++ b/CenIsere_AUTOMAP/about_form.py @@ -12,7 +12,7 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType( os.path.join( str(Path(__file__).resolve().parent), 'tools/ui', - 'CenRa_AutoMap_about_form.ui' + 'CenIsere_AutoMap_about_form.ui' ) ) @@ -26,7 +26,7 @@ class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS): self.iface = iface self.setupUi(self) - self.viewer.setHtml(devlog('CenRa_AUTOMAP')) + self.viewer.setHtml(devlog('CenIsere_AUTOMAP')) self.rejected.connect(self.onReject) self.buttonBox.rejected.connect(self.onReject) @@ -43,4 +43,4 @@ class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS): Run some actions when the user closes the dialog """ - self.close() \ No newline at end of file + self.close() diff --git a/CenIsere_AUTOMAP/canvas_editor.py b/CenIsere_AUTOMAP/canvas_editor.py index 887c30a..354bdfe 100644 --- a/CenIsere_AUTOMAP/canvas_editor.py +++ b/CenIsere_AUTOMAP/canvas_editor.py @@ -8,7 +8,6 @@ from pathlib import Path from xml.dom.minidom import parseString from qgis.gui import * import qgis -from importlib import import_module from qgis.core import ( NULL, QgsApplication, @@ -57,7 +56,6 @@ from qgis.PyQt.QtWidgets import ( QTableWidgetItem, QVBoxLayout, ) -from PyQt5 import QtGui from qgis.PyQt.QtXml import QDomDocument from qgis.utils import iface import glob @@ -67,16 +65,12 @@ from .tools.resources import ( login_base, send_issues, ) -from .issues import CenRa_Issues - -from .tools.mises_en_pages import carto_standard -from .tools.mises_en_pages import full_page -from .tools.mises_en_pages import demo - +from .tools.mises_en_pages.canvas import (fletch_canvas) +from .issues import CenIsere_Issues from datetime import date -EDITOR_CLASS = load_ui('CenRa_AutoMap_base.ui') -LOGGER = logging.getLogger('CenRa_AutoMap') +EDITOR_CLASS = load_ui('CenIsere_AutoMap_base.ui') +LOGGER = logging.getLogger('CenIsere_AutoMap') url_osm = 'https://osm.datagrandest.fr/mapcache/?crs=EPSG:2154&featureCount=10&format=image/png&layers=pure&maxHeight=256&maxWidth=256&styles=&url=https://osm.datagrandest.fr/mapcache' url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service' url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt' @@ -104,9 +98,6 @@ data_source = [ 'Plan cadastral informatisé - Etalab - juillet 202X', 'Parcellaire Express - IGN - 202X', ] -A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}} -A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}} - class AutoMap_Editor(QDialog, EDITOR_CLASS): def __init__(self, parent=None): @@ -115,7 +106,6 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.setupUi(self) self.settings = QgsSettings() self.s = QSettings() - self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png'))) path = '' ix = 0 @@ -139,7 +129,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): ## On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" : mises_en_page = [] - for filename in glob.glob(resources_path("mises_en_pages","*.py")): + for filename in glob.glob(resources_path("mises_en_pages","*.qpt")): mises_en_page.append(filename) @@ -149,42 +139,32 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.comboBox.setCurrentIndex(1) self.template_parameters = { - 'Carte_size': None, - 'Carte_locals' : None, - 'Carte_rotate':None, - 'Carte_2_size' : None, - 'Carte_2_locals' : None, - 'Carte_2_rotate':None, - 'Legande_size': None, - 'Legande_locals': None, - 'Legande_rotate':None, - 'Arrow_size': None, - 'Arrow_locals': None, - 'Arrow_rotate':None, - 'Echelle_size': None, - 'Echelle_locals': None, - 'Echelle_rotate':None, - 'Logo_size': None, - 'Logo_locals': None, - 'Logo_rotate':None, - 'Titre_size':None, - 'Titre_locals':None, - 'Titre_rotate':None, - 'Sous_titre_size':None, - 'Sous_titre_locals':None, - 'Sous_titre_rotate':None, - 'Credit_size': None, - 'Credit_locals': None, - 'Credit_rotate':None, - 'Source_size': None, - 'Source_locals': None, - 'Source_rotate':None, - 'Logo_2_size': None, - 'Logo_2_locals': None, - 'Logo_2_rotate': None, - 'Echelle_2_size': None, - 'Echelle_2_locals': None, - 'Echelle_2_rotate': None, + 'map_size': None, + 'map_position' : None, + 'position_map_size' : None, + 'position_map_position' : None, + 'title_position': None, + 'title_size': None, + 'subtitle_position': None, + 'subtitle_size': None, + 'logo_position': None, + 'logo_size': None, + 'legend_position': None, + 'legend_size': None, + 'scalebarnumeric_position':None, + 'scalebarnumeric_size':None, + 'scalebar_position': None, + 'scalebar_size': None, + 'north_position': None, + 'north_size': None, + 'credit_text_position': None, + 'credit_text_size': None, + 'credit_text2_position': None, + 'credit_text2_size': None, + 'image_size':None, + 'image_position':None, + 'image_size_2':None, + 'image_position_2':None, # Add more variables as needed } self.update_logo_library() @@ -439,15 +419,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): doc.setContent(template_content) self.layout.loadFromTemplate(doc, QgsReadWriteContext(), True) self.layout.setName(layout_name) + - if self.radioButton_6.isChecked() and self.radioButton_7.isChecked(): - logo_div = A4_size['Portrait']['RIGHT'] - if self.radioButton_6.isChecked() and self.radioButton_8.isChecked(): - logo_div = A4_size['Portrait']['BOTTOM'] - if self.radioButton_5.isChecked() and self.radioButton_7.isChecked(): - logo_div = A3_size['Portrait']['RIGHT'] - if self.radioButton_5.isChecked() and self.radioButton_8.isChecked(): - logo_div = A3_size['Portrait']['BOTTOM'] if True:#os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt": self.actualisation_mise_en_page() @@ -460,10 +433,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.map_modele_test.setExtent(iface.mapCanvas().extent()) # Position de la carte dans le composeur - self.map_modele_test.setItemRotation(self.template_parameters['Carte_rotate']) - self.map_modele_test.attemptResize(self.template_parameters['Carte_size']) - self.map_modele_test.attemptMove(self.template_parameters['Carte_locals']) + self.map_modele_test.attemptMove(self.template_parameters['map_position']) + # on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210) + self.map_modele_test.attemptResize(self.template_parameters['map_size']) self.map_modele_test.setKeepLayerSet(True) self.map_modele_test.setKeepLayerStyles(True) if self.radioButton_11.isChecked() == 1: @@ -477,9 +450,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104)) self.position_map.setFollowVisibilityPreset(True) self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText()) - self.position_map.setItemRotation(self.template_parameters['Carte_2_rotate']) - self.position_map.attemptResize(self.template_parameters['Carte_2_size']) - self.position_map.attemptMove(self.template_parameters['Carte_2_locals']) + self.position_map.attemptMove(self.template_parameters['position_map_position']) + self.position_map.attemptResize(self.template_parameters['position_map_size']) overviewitem = QgsLayoutItemMapOverviewStack(self.position_map) map_overview = self.position_map.overview() map_overview.setLinkedMap(self.map_modele_test) @@ -487,28 +459,45 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): overviewitem.addOverview(map_overview) self.position_map.refresh() - self.map_modele_test.setFrameEnabled(True) + self.map_modele_test.setFrameEnabled(False) self.layout.addLayoutItem(self.position_map) - self.position_map.setId("Carte_locals") + self.position_map.setId("carte_position") self.map_modele_test.refresh() self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255)) - self.map_modele_test.setFrameEnabled(True) + + self.map_modele_test.setFrameEnabled(False) + if self.radioButton_9.isChecked() == 1: self.map_modele_test.setAtlasDriven(True) self.layout.addLayoutItem(self.map_modele_test) self.map_modele_test.setId("carte_principale") + + if self.comboBox.currentText() == "3. Modèle carto standard Cen Isere.qpt": + # Ajout de la vague haute + image1 = QgsLayoutItemPicture(self.layout) + image1.setPicturePath(resources_path("mises_en_pages","vague.png")) + image1.attemptMove(self.template_parameters['image_position']) + image1.attemptResize(self.template_parameters['image_size']) + self.layout.addLayoutItem(image1) + # Ajout de la vague basse + image2= QgsLayoutItemPicture(self.layout) + image2.setPicturePath(resources_path("mises_en_pages","vague2.png")) + image2.attemptMove(self.template_parameters['image_position_2']) + image2.attemptResize(self.template_parameters['image_size_2']) + self.layout.addLayoutItem(image2) + + + ## Ajout d'un titre à la mise en page title = QgsLayoutItemLabel(self.layout) self.layout.addLayoutItem(title) titre = layout_name title.setText(titre) title.setFont(QFont("Calibri", 15, QFont.Bold)) - title.setItemRotation(self.template_parameters['Titre_rotate']) - title.attemptResize(self.template_parameters['Titre_size']) - title.attemptMove(self.template_parameters['Titre_locals']) - + title.attemptMove(self.template_parameters['title_position']) + title.attemptResize(self.template_parameters['title_size']) title.setBackgroundEnabled(True) title.setBackgroundColor(QColor(255, 255, 255, 130)) self.layout.addItem(title) @@ -525,9 +514,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): titre = titre + ' [%' + self.comboBox_4.currentText() + '%]' subtitle.setText(titre) subtitle.setFont(QFont("MS Shell Dlg 2", 10)) - subtitle.setItemRotation(self.template_parameters['Sous_titre_rotate']) - subtitle.attemptResize(self.template_parameters['Sous_titre_size']) - subtitle.attemptMove(self.template_parameters['Sous_titre_locals']) + subtitle.attemptMove(self.template_parameters['subtitle_position']) + subtitle.attemptResize(self.template_parameters['subtitle_size']) subtitle.setId("SubTitle") subtitle.setBackgroundEnabled(True) subtitle.setBackgroundColor(QColor(255, 255, 255, 130)) @@ -540,10 +528,9 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): logo = QgsLayoutItemPicture(self.layout) logo.setResizeMode(QgsLayoutItemPicture.Zoom) logo.setMode(QgsLayoutItemPicture.FormatRaster) - logo.setItemRotation(self.template_parameters['Logo_rotate']) - logo.setFixedSize(self.template_parameters['Logo_size']) - logo.attemptMove(self.template_parameters['Logo_locals']) - logo.setPicturePath(resources_path("icons","CEN_RA.png")) + logo.attemptMove(self.template_parameters['logo_position']) + logo.setFixedSize(self.template_parameters['logo_size']) + logo.setPicturePath(resources_path("icons","CEN.png")) logo.setId('logo') self.layout.addLayoutItem(logo) @@ -618,7 +605,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.layout.refresh() legend.updateLegend() - legend.attemptMove(self.template_parameters['Legande_locals']) + legend.attemptMove(self.template_parameters['legend_position']) + ## Ajout de l'échelle numeric à la mise en page self.scalebarnumeric_qpt = QgsLayoutItemScaleBar(self.layout) @@ -630,9 +618,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.scalebarnumeric_qpt.setNumberOfSegments(2) self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0) - self.scalebarnumeric_qpt.attemptMove(self.template_parameters['Echelle_locals']) - self.scalebarnumeric_qpt.attemptResize(self.template_parameters['Echelle_size']) - self.scalebarnumeric_qpt.setItemRotation(self.template_parameters['Echelle_rotate']) + self.scalebarnumeric_qpt.attemptMove(self.template_parameters['scalebarnumeric_position']) + self.scalebarnumeric_qpt.attemptResize(self.template_parameters['scalebarnumeric_size']) self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1)) self.scalebarnumeric_qpt.setBackgroundEnabled(True) self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130)) @@ -649,9 +636,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.scalebar_qpt.setNumberOfSegments(2) self.scalebar_qpt.setNumberOfSegmentsLeft(0) - self.scalebar_qpt.attemptMove(self.template_parameters['Echelle_2_locals']) - self.scalebar_qpt.attemptResize(self.template_parameters['Echelle_2_size']) - self.scalebar_qpt.setItemRotation(self.template_parameters['Echelle_2_rotate']) + self.scalebar_qpt.attemptMove(self.template_parameters['scalebar_position']) + self.scalebar_qpt.attemptResize(self.template_parameters['scalebar_size']) self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1)) self.scalebar_qpt.setBackgroundEnabled(True) self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130)) @@ -663,47 +649,44 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): north = QgsLayoutItemPicture(self.layout) north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg")) self.layout.addLayoutItem(north) - north.attemptMove(self.template_parameters['Arrow_locals']) - north.attemptResize(self.template_parameters['Arrow_size']) - north.setItemRotation(self.template_parameters['Arrow_rotate']) + north.attemptMove(self.template_parameters['north_position']) + north.attemptResize(self.template_parameters['north_size']) if self.radioButton_10.isChecked() == 1: info_text = ["Source : " + self.mComboBox_3.currentText()][0] else: info_text = ["Source : " + self.lineEdit_4.text()][0] # ajout note info: - info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime( + info = ["Réalisation : " + "CEN Isère (" + date.today().strftime( "%d/%m/%Y") + ")"] credit_text = QgsLayoutItemLabel(self.layout) credit_text.setText(info[0]) credit_text.setFont(QFont("Calibri", 9)) credit_text.setHAlign(Qt.AlignRight) credit_text.setVAlign(Qt.AlignVCenter) + credit_text.setItemRotation(-90) credit_text2 = QgsLayoutItemLabel(self.layout) credit_text2.setText(info_text) credit_text2.setFont(QFont("Calibri", 9)) credit_text2.setHAlign(Qt.AlignRight) credit_text2.setVAlign(Qt.AlignVCenter) - credit_text.setItemRotation(self.template_parameters['Credit_rotate']) - credit_text.attemptResize(self.template_parameters['Credit_size']) - credit_text.attemptMove(self.template_parameters['Credit_locals']) - credit_text2.setItemRotation(self.template_parameters['Source_rotate']) - credit_text2.attemptResize(self.template_parameters['Source_size']) - credit_text2.attemptMove(self.template_parameters['Source_locals']) + credit_text.attemptMove(self.template_parameters['credit_text_position']) + credit_text.attemptResize(self.template_parameters['credit_text_size']) + credit_text2.attemptMove(self.template_parameters['credit_text2_position']) + credit_text2.attemptResize(self.template_parameters['credit_text2_size']) self.layout.addLayoutItem(credit_text) self.layout.addLayoutItem(credit_text2) ## Ajout du logo credit en bas à droit de la page - len_item = (len(self.mComboBox_4.checkedItems())) for logo_run in self.mComboBox_4.checkedItems(): logo_credit = QgsLayoutItemPicture(self.layout) logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom) logo_credit.setMode(QgsLayoutItemPicture.FormatRaster) - cur_x = self.template_parameters['Logo_2_locals'].x() - logo_credit.attemptMove(self.template_parameters['Logo_2_locals']) + cur_x = self.template_parameters['logo_credit_position'].x() + logo_credit.attemptMove(self.template_parameters['logo_credit_position']) logo_credit.setPictureAnchor(4) - self.template_parameters['Logo_2_locals'].setX(cur_x+(logo_div/len_item)) - logo_credit.setFixedSize(self.template_parameters['Logo_2_size']) + self.template_parameters['logo_credit_position'].setX(cur_x+51) + logo_credit.setFixedSize(self.template_parameters['logo_credit_size']) if logo_run[0] == ' ': logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str)+logo_run[1:]) else: @@ -739,6 +722,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): self.close() def actualisation_mise_en_page(self): + + A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}} + A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}} + values_page = self.comboBox.currentText() if self.radioButton_6.isChecked() and self.radioButton_7.isChecked(): @@ -757,24 +744,19 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS): pc = self.layout.pageCollection() pc.pages()[0].setPageSize('A3', QgsLayoutItemPage.Landscape) - if values_page == "demo.py": - self.template_parameters = demo.fletch_canvas(self) - if values_page == "carto_standard.py": - self.template_parameters = carto_standard.fletch_canvas(self) - if values_page == "full_page.py": - self.template_parameters = full_page.fletch_canvas(self) + self.template_parameters = fletch_canvas(self,values_page) def bar_echelle_auto(self, echelle, bar_echelle): if True: - if echelle.scale() >= 40000: + if echelle.scale() >= 20000: bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers) bar_echelle.setUnitLabel("km") - bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.04)/1000)) + bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.02)/1000)) else: bar_echelle.setUnits(QgsUnitTypes.DistanceMeters) bar_echelle.setUnitLabel("m") - bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.04)) + bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.02)) bar_echelle.update() diff --git a/CenIsere_AUTOMAP/issues.py b/CenIsere_AUTOMAP/issues.py index 92a4176..19cfab7 100644 --- a/CenIsere_AUTOMAP/issues.py +++ b/CenIsere_AUTOMAP/issues.py @@ -39,9 +39,9 @@ from .tools.resources import ( send_issues, ) -EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui') +EDITOR_CLASS = load_ui('CenIsere_IssuesSend.ui') -class CenRa_Issues(QDialog, EDITOR_CLASS): +class CenIsere_Issues(QDialog, EDITOR_CLASS): def __init__(self, parent=None): _ = parent diff --git a/CenIsere_AUTOMAP/metadata.txt b/CenIsere_AUTOMAP/metadata.txt index e0b57ef..6ff3623 100644 --- a/CenIsere_AUTOMAP/metadata.txt +++ b/CenIsere_AUTOMAP/metadata.txt @@ -3,12 +3,12 @@ # This file should be included when you package your plugin.# Mandatory items: [general] -name=CenRa_AutoMap +name=CenIsere_AutoMap qgisMinimumVersion=3.0 -description=CenRa_AutoMap -version=1.7 +description=CenIsere_AutoMap +version=1.6 author=Conservatoire d'Espaces Naturels de Rhône-Alpes -email=si_besoin@cen-rhonealpes.fr + about=Outils de création de mise en page prédéfinis pour simplifier et organiser cette étape. @@ -21,7 +21,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues hasProcessingProvider=no # Uncomment the following line and add your changelog: -changelog=

CenRa_AutoMap:


21/10/2024 - Version 1.7:

- Epurations du code.


07/10/2024 - Version 1.6:

- Option de bibliotheque de logo custome.


03/10/2024 - Version 1.5:

- Remonte la fênetre dans la pille.
- Gestion du nombre de colonne dans la légend.


02/10/2024 - Version 1.4:

- Mise en page plein écrant.


01/10/2024 - Version 1.3:

- Récupération du titre et sous-titre pour mise en page existente.
- Integration de bibliotheque de logo.
- Integration de gestionaire pour les source de donnée.
- Mise en place d'une bar d'echelle adaptative.


30/09/2024 - Version 1.2:

- Activation du thème.
- Ajouter une carte de suivie.


27/09/2024 - Version 1.1:

- Ajout d'une liste déroulante pour les sources de données.
- Bouton pour ajouter des fonts de carte customisés.
- Fonctionnalité de génération d'atlas.


26/09/2024 - Version 1.0:

- Lancement du plugin CenRa_AutoMap avec une seul mise en page.


+changelog=

CenIsere_AutoMap:


07/10/2024 - Version 1.6:

- Option de bibliotheque de logo custome.


03/10/2024 - Version 1.5:

- Remonte la fênetre dans la pille.
- Gestion du nombre de colonne dans la légend.


02/10/2024 - Version 1.4:

- Mise en page plein écrant.


01/10/2024 - Version 1.3:

- Récupération du titre et sous-titre pour mise en page existente.
- Integration de bibliotheque de logo.
- Integration de gestionaire pour les source de donnée.
- Mise en place d'une bar d'echelle adaptative.


30/09/2024 - Version 1.2:

- Activation du thème.
- Ajouter une carte de suivie.


27/09/2024 - Version 1.1:

- Ajout d'une liste déroulante pour les sources de données.
- Bouton pour ajouter des fonts de carte customisés.
- Fonctionnalité de génération d'atlas.


26/09/2024 - Version 1.0:

- Lancement du plugin CenIsere_AutoMap avec une seul mise en page.


# Tags are comma separated with spaces allowed tags=python @@ -41,7 +41,7 @@ deprecated=False # plugin_dependencies= Category of the plugin: Raster, Vector, Database or Web -# category=cenra,mise en page,atlas +# category=CenIsere,mise en page,atlas # If the plugin can run on QGIS Server. server=False diff --git a/CenIsere_AUTOMAP/tools/__pycache__/resources.cpython-310.pyc b/CenIsere_AUTOMAP/tools/__pycache__/resources.cpython-310.pyc new file mode 100644 index 0000000..61a353d Binary files /dev/null and b/CenIsere_AUTOMAP/tools/__pycache__/resources.cpython-310.pyc differ diff --git a/CenIsere_AUTOMAP/tools/icons/CEN.png b/CenIsere_AUTOMAP/tools/icons/CEN.png new file mode 100644 index 0000000..2d9f1e3 Binary files /dev/null and b/CenIsere_AUTOMAP/tools/icons/CEN.png differ diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/1. Modèle carto standard.qpt b/CenIsere_AUTOMAP/tools/mises_en_pages/1. Modèle carto standard.qpt new file mode 100644 index 0000000..0660974 --- /dev/null +++ b/CenIsere_AUTOMAP/tools/mises_en_pages/1. Modèle carto standard.qpt @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/2. Modèle carto plein page.qpt b/CenIsere_AUTOMAP/tools/mises_en_pages/2. Modèle carto plein page.qpt new file mode 100644 index 0000000..0660974 --- /dev/null +++ b/CenIsere_AUTOMAP/tools/mises_en_pages/2. Modèle carto plein page.qpt @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/3. Modèle carto standard Cen Isere.qpt b/CenIsere_AUTOMAP/tools/mises_en_pages/3. Modèle carto standard Cen Isere.qpt new file mode 100644 index 0000000..883396e --- /dev/null +++ b/CenIsere_AUTOMAP/tools/mises_en_pages/3. Modèle carto standard Cen Isere.qpt @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/__pycache__/canvas.cpython-310.pyc b/CenIsere_AUTOMAP/tools/mises_en_pages/__pycache__/canvas.cpython-310.pyc new file mode 100644 index 0000000..45139ba Binary files /dev/null and b/CenIsere_AUTOMAP/tools/mises_en_pages/__pycache__/canvas.cpython-310.pyc differ diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/canvas.py b/CenIsere_AUTOMAP/tools/mises_en_pages/canvas.py new file mode 100644 index 0000000..72e8287 --- /dev/null +++ b/CenIsere_AUTOMAP/tools/mises_en_pages/canvas.py @@ -0,0 +1,492 @@ +from qgis.core import ( + QgsLayoutSize, + QgsUnitTypes, + QgsLayoutPoint, +) + +def fletch_canvas(self,values_page): + ### Modèle carto standard ### + if values_page == '1. Modèle carto standard.qpt': + if self.radioButton_6.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(199, 175, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(193, 214, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201, QgsUnitTypes.LayoutMillimeters) + + + + if self.radioButton_6.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters) + + + + if self.radioButton_5.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters) + + + + if self.radioButton_5.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters) + + ### Modèle carto plein page ### + if values_page == '2. Modèle carto plein page.qpt': + if self.radioButton_6.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(210, 297, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(133, 215, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 288, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 273, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(196, 283, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(55, 292, QgsUnitTypes.LayoutMillimeters) + + if self.radioButton_6.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(231, 135, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 201, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 186, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(283, 196, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 205, QgsUnitTypes.LayoutMillimeters) + + if self.radioButton_5.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(297, 420, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 370, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(219, 324, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 410, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 395, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(271, 394, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291, 125, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 414, QgsUnitTypes.LayoutMillimeters) + + if self.radioButton_5.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 247, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(341, 196, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 287, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 272, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(394, 271, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(414, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(185, 292, QgsUnitTypes.LayoutMillimeters) + + ### Modèle carto standard CEN ISERE### + if values_page == '3. Modèle carto standard Cen Isere.qpt': + if self.radioButton_6.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(199, 175, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(193, 214, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size'] = QgsLayoutSize(200, 175, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position'] = QgsLayoutPoint(4.5, 18, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size_2'] = QgsLayoutSize(200, 175, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position_2'] = QgsLayoutPoint(4.5, 194.9, QgsUnitTypes.LayoutMillimeters) + + if self.radioButton_6.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size'] = QgsLayoutSize(286, 145, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position'] = QgsLayoutPoint(5.5, 13, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size_2'] = QgsLayoutSize(286, 145, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 162.2, QgsUnitTypes.LayoutMillimeters) + + + if self.radioButton_5.isChecked() and self.radioButton_7.isChecked(): + + self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size'] = QgsLayoutSize(286, 260, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position'] = QgsLayoutPoint(5.5, 13, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size_2'] = QgsLayoutSize(286, 260, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 278.2, QgsUnitTypes.LayoutMillimeters) + + + + if self.radioButton_5.isChecked() and self.radioButton_8.isChecked(): + + self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['title_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size'] = QgsLayoutSize(409.3, 222, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position'] = QgsLayoutPoint(4.5, 8, QgsUnitTypes.LayoutMillimeters) + + self.template_parameters['image_size_2'] = QgsLayoutSize(409.3, 222, QgsUnitTypes.LayoutMillimeters) + self.template_parameters['image_position_2'] = QgsLayoutPoint(4.6, 237.15, QgsUnitTypes.LayoutMillimeters) + + # Retour des info # + return self.template_parameters diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/vague.png b/CenIsere_AUTOMAP/tools/mises_en_pages/vague.png new file mode 100644 index 0000000..4144194 Binary files /dev/null and b/CenIsere_AUTOMAP/tools/mises_en_pages/vague.png differ diff --git a/CenIsere_AUTOMAP/tools/mises_en_pages/vague2.png b/CenIsere_AUTOMAP/tools/mises_en_pages/vague2.png new file mode 100644 index 0000000..9c9f1ad Binary files /dev/null and b/CenIsere_AUTOMAP/tools/mises_en_pages/vague2.png differ diff --git a/CenIsere_AUTOMAP/tools/resources.py b/CenIsere_AUTOMAP/tools/resources.py index d202edc..c2bc15f 100644 --- a/CenIsere_AUTOMAP/tools/resources.py +++ b/CenIsere_AUTOMAP/tools/resources.py @@ -89,7 +89,7 @@ def resources_path(*args): :return: Absolute path to the resources folder. :rtype: str """ - path = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools"))) + path = abspath(abspath(join(plugin_path(), "CenIsere_AUTOMAP/tools"))) for item in args: path = abspath(join(path, item)) return path @@ -184,4 +184,4 @@ def devlog(NAME): import qgis devmaj = '' devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog') - return devmaj \ No newline at end of file + return devmaj