
from qgis.core import (
    QgsLayoutSize,
    QgsUnitTypes,
    QgsLayoutPoint,
)


def fletch_canvas(self):
    if self.radioButton_6.isChecked():
        values_page = 'A4'
    else:
        values_page = 'A3'
    if self.radioButton_7.isChecked():
        page_rotate = 'Portrait'
    else:
        page_rotate = 'Landscape'

    if page_rotate == 'Portrait':
        if values_page == 'A4':
            self.template_parameters['Carte_size'] = QgsLayoutSize(206.0, 200, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_locals'] = QgsLayoutPoint(2, 29, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_rotate'] = 0
            self.template_parameters['Carte_frame'] = True
            self.template_parameters['Carte_2_size'] = QgsLayoutSize(58.857142857142854, 40, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(146, 218, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_rotate'] = 0
            self.template_parameters['Carte_2_frame'] = True
            self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 36, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 260, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_rotate'] = 0
            self.template_parameters['Legande_frame'] = True
            self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_locals'] = QgsLayoutPoint(191, 32, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_rotate'] = 0
            self.template_parameters['Arrow_background'] = False
            self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
            self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_locals'] = QgsLayoutPoint(140, 244, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_rotate'] = 0
            self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_locals'] = QgsLayoutPoint(6, 241, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_rotate'] = 0
            self.template_parameters['Titre_size'] = QgsLayoutSize(206.0, 10, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 3, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_rotate'] = 0
            self.template_parameters['Credit_size'] = QgsLayoutSize(198.0, 5, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_locals'] = QgsLayoutPoint(3, 228.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_rotate'] = 270
            self.template_parameters['Credit_alignment'] = 0x0001
            self.template_parameters['Source_size'] = QgsLayoutSize(198.0, 5, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 228.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_rotate'] = 270
            self.template_parameters['Source_alignment'] = 0x0001
            self.template_parameters['Sous_titre_size'] = QgsLayoutSize(202.0, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(4, 13, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_rotate'] = 0
            self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(130, 233, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_rotate'] = 0
            self.template_parameters['Logo_2_size'] = QgsLayoutSize(80.0, 35, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(48, 234, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_rotate'] = 0
        if values_page == 'A3':
            self.template_parameters['Carte_size'] = QgsLayoutSize(290, 282, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_locals'] = QgsLayoutPoint(3, 41, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_rotate'] = 0
            self.template_parameters['Carte_frame'] = True
            self.template_parameters['Carte_2_size'] = QgsLayoutSize(83, 56, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(206, 307, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_rotate'] = 0
            self.template_parameters['Carte_2_frame'] = True
            self.template_parameters['Legande_size'] = QgsLayoutSize(280, 51, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 367, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_rotate'] = 0
            self.template_parameters['Legande_frame'] = True
            self.template_parameters['Arrow_size'] = QgsLayoutSize(20, 20, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_locals'] = QgsLayoutPoint(269, 45, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_rotate'] = 0
            self.template_parameters['Arrow_background'] = False
            self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
            self.template_parameters['Echelle_size'] = QgsLayoutSize(70, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_locals'] = QgsLayoutPoint(125, 350, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_rotate'] = 0
            self.template_parameters['Logo_size'] = QgsLayoutSize(56, 28, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_locals'] = QgsLayoutPoint(8, 330, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_rotate'] = 0
            self.template_parameters['Titre_size'] = QgsLayoutSize(290, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 4, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_rotate'] = 0
            self.template_parameters['Credit_size'] = QgsLayoutSize(280, 7, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 322, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_rotate'] = 270
            self.template_parameters['Credit_alignment'] = 0x0001
            self.template_parameters['Source_size'] = QgsLayoutSize(280, 7, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_locals'] = QgsLayoutPoint(11, 322, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_rotate'] = 270
            self.template_parameters['Source_alignment'] = 0x0001
            self.template_parameters['Sous_titre_size'] = QgsLayoutSize(285, 20, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(6, 19, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_rotate'] = 0
            self.template_parameters['Echelle_2_size'] = QgsLayoutSize(70, 19, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(125, 330, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_rotate'] = 0
            self.template_parameters['Logo_2_size'] = QgsLayoutSize(56, 28, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(68, 330, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_rotate'] = 0
    if page_rotate == 'Landscape':
        if values_page == 'A4':
            self.template_parameters['Carte_size'] = QgsLayoutSize(189.0, 189, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_rotate'] = 0
            self.template_parameters['Carte_frame'] = True
            self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(194, 20.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_rotate'] = 0
            self.template_parameters['Carte_2_frame'] = True
            self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_locals'] = QgsLayoutPoint(199, 63.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_rotate'] = 0
            self.template_parameters['Legande_frame'] = True
            self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_locals'] = QgsLayoutPoint(177, 20.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_rotate'] = 0
            self.template_parameters['Arrow_background'] = False
            self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
            self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_locals'] = QgsLayoutPoint(247, 43, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_rotate'] = 0
            self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_locals'] = QgsLayoutPoint(228, 149.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_rotate'] = 0
            self.template_parameters['Titre_size'] = QgsLayoutSize(289.0, 11, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_rotate'] = 0
            self.template_parameters['Credit_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 201, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_rotate'] = 0
            self.template_parameters['Credit_alignment'] = 0x0001
            self.template_parameters['Source_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 195, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_rotate'] = 0
            self.template_parameters['Source_alignment'] = 0x0001
            self.template_parameters['Sous_titre_size'] = QgsLayoutSize(289.0, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_rotate'] = 0
            self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(249, 30, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_rotate'] = 0
            self.template_parameters['Logo_2_size'] = QgsLayoutSize(80.0, 35, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(208, 172, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_rotate'] = 0
        if values_page == 'A3':
            self.template_parameters['Carte_size'] = QgsLayoutSize(305.0, 273, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_rotate'] = 0
            self.template_parameters['Carte_frame'] = True
            self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(311, 20.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Carte_2_rotate'] = 0
            self.template_parameters['Carte_2_frame'] = True
            self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_locals'] = QgsLayoutPoint(317, 63.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Legande_rotate'] = 0
            self.template_parameters['Legande_frame'] = True
            self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_locals'] = QgsLayoutPoint(296, 20.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Arrow_rotate'] = 0
            self.template_parameters['Arrow_background'] = False
            self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
            self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_locals'] = QgsLayoutPoint(364, 43, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_rotate'] = 0
            self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_locals'] = QgsLayoutPoint(320, 264.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_rotate'] = 0
            self.template_parameters['Titre_size'] = QgsLayoutSize(413.0, 11, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Titre_rotate'] = 0
            self.template_parameters['Credit_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 285, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Credit_rotate'] = 0
            self.template_parameters['Credit_alignment'] = 0x0001
            self.template_parameters['Source_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 279, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Source_rotate'] = 0
            self.template_parameters['Source_alignment'] = 0x0001
            self.template_parameters['Sous_titre_size'] = QgsLayoutSize(413.0, 6, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Sous_titre_rotate'] = 0
            self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(366, 30, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Echelle_2_rotate'] = 0
            self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(369, 264, QgsUnitTypes.LayoutMillimeters)
            self.template_parameters['Logo_2_rotate'] = 0
    return self.template_parameters
